2 * Copyright 2000-2012 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.jetbrains.jps.uiDesigner.compiler;
18 import com.intellij.openapi.diagnostic.Logger;
19 import com.intellij.openapi.util.Key;
20 import com.intellij.openapi.util.io.FileUtilRt;
21 import org.jetbrains.annotations.NotNull;
22 import org.jetbrains.jps.incremental.BuilderCategory;
23 import org.jetbrains.jps.incremental.ModuleLevelBuilder;
26 import java.io.FileFilter;
27 import java.util.ArrayList;
28 import java.util.Collection;
32 * @author Eugene Zhuravlev
35 public abstract class FormsBuilder extends ModuleLevelBuilder {
36 protected static final Logger LOG = Logger.getInstance("#org.jetbrains.jps.uiDesigner.compiler.FormsInstrumenter");
37 protected static final Key<Map<File, Collection<File>>> FORMS_TO_COMPILE = Key.create("_forms-to_compile_");
38 protected static final String FORM_EXTENSION = "form";
39 protected static final FileFilter JAVA_SOURCES_FILTER = FileUtilRt.createFilterByExtension("java");
40 protected static final FileFilter FORM_SOURCES_FILTER = FileUtilRt.createFilterByExtension(FORM_EXTENSION);
42 private final String myBuilderName;
44 public FormsBuilder(BuilderCategory category, String name) {
51 public String getPresentableName() {
55 protected static void addBinding(File srcFile, File form, Map<File, Collection<File>> container) {
56 Collection<File> forms = container.get(srcFile);
58 forms = new ArrayList<File>();
59 container.put(srcFile, forms);