diff --git a/java/compiler/impl/src/com/intellij/compiler/CompileTaskBean.java b/java/compiler/impl/src/com/intellij/compiler/CompileTaskBean.java new file mode 100644 index 000000000000..1b4a26551261 --- /dev/null +++ b/java/compiler/impl/src/com/intellij/compiler/CompileTaskBean.java @@ -0,0 +1,61 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.compiler; + +import com.intellij.openapi.compiler.CompileTask; +import com.intellij.openapi.extensions.AbstractExtensionPointBean; +import com.intellij.openapi.extensions.ExtensionPointName; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.AtomicNotNullLazyValue; +import com.intellij.util.xmlb.annotations.Attribute; +import org.jetbrains.annotations.NotNull; + +/** + * @author nik + */ +public class CompileTaskBean extends AbstractExtensionPointBean { + public static final ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.compiler.task"); + public enum CompileTaskExecutionPhase { BEFORE, AFTER } + + private final Project myProject; + + public CompileTaskBean(Project project) { + myProject = project; + } + + @Attribute("execute") + public CompileTaskExecutionPhase myExecutionPhase = CompileTaskExecutionPhase.BEFORE; + + @Attribute("implementation") + public String myImplementation; + + private final AtomicNotNullLazyValue myInstanceHolder = new AtomicNotNullLazyValue() { + @NotNull + @Override + protected CompileTask compute() { + try { + return instantiate(myImplementation, myProject.getPicoContainer()); + } + catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + } + }; + + public CompileTask getTaskInstance() { + return myInstanceHolder.getValue(); + } +} diff --git a/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java b/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java index f50585503449..46a090da8a92 100644 --- a/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java +++ b/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java @@ -240,12 +240,22 @@ public class CompilerManagerImpl extends CompilerManager { @NotNull public CompileTask[] getBeforeTasks() { - return myBeforeTasks.toArray(new CompileTask[myBeforeTasks.size()]); + return getCompileTasks(myBeforeTasks, CompileTaskBean.CompileTaskExecutionPhase.BEFORE); + } + + private CompileTask[] getCompileTasks(List taskList, CompileTaskBean.CompileTaskExecutionPhase phase) { + List beforeTasks = new ArrayList(taskList); + for (CompileTaskBean extension : CompileTaskBean.EP_NAME.getExtensions(myProject)) { + if (extension.myExecutionPhase == phase) { + beforeTasks.add(extension.getTaskInstance()); + } + } + return beforeTasks.toArray(new CompileTask[beforeTasks.size()]); } @NotNull public CompileTask[] getAfterTasks() { - return myAfterTasks.toArray(new CompileTask[myAfterTasks.size()]); + return getCompileTasks(myAfterTasks, CompileTaskBean.CompileTaskExecutionPhase.AFTER); } public void compile(@NotNull VirtualFile[] files, CompileStatusNotification callback) { diff --git a/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/JavaBreakpointAdapter.java b/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/JavaBreakpointAdapter.java index c9f573506579..a6705848a44d 100644 --- a/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/JavaBreakpointAdapter.java +++ b/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/JavaBreakpointAdapter.java @@ -15,6 +15,8 @@ import com.intellij.xdebugger.breakpoints.XLineBreakpoint; import com.intellij.xdebugger.impl.breakpoints.XLineBreakpointImpl; import org.jetbrains.annotations.NotNull; +import java.util.Arrays; + public class JavaBreakpointAdapter extends JavaBreakpointAdapterBase { private static final Key OLD_JAVA_BREAKPOINT_KEY = Key.create("oldJavaBreakpoint"); @@ -26,6 +28,35 @@ public class JavaBreakpointAdapter extends JavaBreakpointAdapterBase { protected void configureCreatedBreakpoint(LineBreakpoint oldBreakpoint, XLineBreakpoint breakpoint) { oldBreakpoint.SUSPEND_POLICY = transformSuspendPolicy(breakpoint); applyCondition(oldBreakpoint, breakpoint); + applyFilters(oldBreakpoint, breakpoint); + } + + private boolean applyFilters(LineBreakpoint oldBreakpoint, XLineBreakpoint breakpoint) { + boolean changed = false; + JavaBreakpointProperties properties = (JavaBreakpointProperties)breakpoint.getProperties(); + + changed |= oldBreakpoint.COUNT_FILTER_ENABLED != properties.COUNT_FILTER_ENABLED; + oldBreakpoint.COUNT_FILTER_ENABLED = properties.COUNT_FILTER_ENABLED; + + changed |= oldBreakpoint.COUNT_FILTER != properties.COUNT_FILTER; + oldBreakpoint.COUNT_FILTER = properties.COUNT_FILTER; + + changed |= oldBreakpoint.CLASS_FILTERS_ENABLED != properties.CLASS_FILTERS_ENABLED; + oldBreakpoint.CLASS_FILTERS_ENABLED = properties.CLASS_FILTERS_ENABLED; + + changed |= !Arrays.equals(oldBreakpoint.getClassFilters(), properties.getClassFilters()); + oldBreakpoint.setClassFilters(properties.getClassFilters()); + + changed |= !Arrays.equals(oldBreakpoint.getClassExclusionFilters(), properties.getClassExclusionFilters()); + oldBreakpoint.setClassExclusionFilters(properties.getClassExclusionFilters()); + + changed |= oldBreakpoint.INSTANCE_FILTERS_ENABLED != properties.INSTANCE_FILTERS_ENABLED; + oldBreakpoint.INSTANCE_FILTERS_ENABLED = properties.INSTANCE_FILTERS_ENABLED; + + changed |= !Arrays.equals(oldBreakpoint.getInstanceFilters(), properties.getInstanceFilters()); + oldBreakpoint.setInstanceFilters(properties.getInstanceFilters()); + + return changed; } private static void applyCondition(LineBreakpoint oldBreakpoint, XLineBreakpoint breakpoint) { @@ -60,6 +91,10 @@ public class JavaBreakpointAdapter extends JavaBreakpointAdapterBase { changed = true; } + if (applyFilters(jBreakpoint, breakpoint)) { + changed = true; + } + if (jBreakpoint.getSourcePosition().getLine() != breakpoint.getLine()) { jBreakpoint.reload(); changed = true; @@ -101,6 +136,7 @@ public class JavaBreakpointAdapter extends JavaBreakpointAdapterBase { } }; + lineBreakpoint.setVisible(false); lineBreakpoint.init(); return lineBreakpoint; } diff --git a/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/JavaBreakpointPropertiesPanel.java b/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/JavaBreakpointPropertiesPanel.java index 784baf101dd3..e575973ea0ba 100644 --- a/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/JavaBreakpointPropertiesPanel.java +++ b/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/JavaBreakpointPropertiesPanel.java @@ -59,9 +59,9 @@ public class JavaBreakpointPropertiesPanel extends XBreakpointCustomPropertiesPa private final FieldPanel myInstanceFiltersField; private final FieldPanel myClassFiltersField; - private ClassFilter[] myClassFilters; - private ClassFilter[] myClassExclusionFilters; - private InstanceFilter[] myInstanceFilters; + private ClassFilter[] myClassFilters = ClassFilter.EMPTY_ARRAY; + private ClassFilter[] myClassExclusionFilters = ClassFilter.EMPTY_ARRAY; + private InstanceFilter[] myInstanceFilters = InstanceFilter.EMPTY_ARRAY; protected final Project myProject; private PsiClass myBreakpointPsiClass; @@ -207,8 +207,8 @@ public class JavaBreakpointPropertiesPanel extends XBreakpointCustomPropertiesPa XSourcePosition position = breakpoint.getSourcePosition(); // TODO: need to calculate psi class //myBreakpointPsiClass = breakpoint.getPsiClass(); - updateCheckboxes(); } + updateCheckboxes(); } private void updateInstanceFilterEditor(boolean updateText) { diff --git a/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/JavaBreakpointType.java b/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/JavaBreakpointType.java index c14ca38662bf..5e55a49658f8 100644 --- a/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/JavaBreakpointType.java +++ b/java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/JavaBreakpointType.java @@ -60,6 +60,12 @@ public class JavaBreakpointType extends XLineBreakpointTypeBase { return new JavaBreakpointProperties(); } + @Nullable + @Override + public XBreakpointProperties createBreakpointProperties(@NotNull VirtualFile file, int line) { + return new JavaBreakpointProperties(); + } + @Nullable @Override public XBreakpointCustomPropertiesPanel> createCustomRightPropertiesPanel(@NotNull Project project) { diff --git a/platform/lang-api/src/com/intellij/framework/detection/DetectionExcludesConfiguration.java b/platform/lang-api/src/com/intellij/framework/detection/DetectionExcludesConfiguration.java index d1aaf71f63b0..49bfd386cf6b 100644 --- a/platform/lang-api/src/com/intellij/framework/detection/DetectionExcludesConfiguration.java +++ b/platform/lang-api/src/com/intellij/framework/detection/DetectionExcludesConfiguration.java @@ -30,8 +30,19 @@ public abstract class DetectionExcludesConfiguration { return ServiceManager.getService(project, DetectionExcludesConfiguration.class); } + /** + * Suppress detection of framework {@code type} everywhere in the project + */ public abstract void addExcludedFramework(@NotNull FrameworkType type); - public abstract void addExcludedFile(@NotNull VirtualFile file, @Nullable FrameworkType type); + + /** + * Suppress detection of framework {@code type} in the specified file or directory + */ + public abstract void addExcludedFile(@NotNull VirtualFile fileOrDirectory, @Nullable FrameworkType type); + + /** + * Suppress detection of framework {@code type} in the file or directory specified by {@code url} + */ public abstract void addExcludedUrl(@NotNull String url, @Nullable FrameworkType type); public abstract boolean isExcludedFromDetection(@NotNull VirtualFile file, @NotNull FrameworkType frameworkType); diff --git a/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java b/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java index 8f7600865961..0c7bf390a5e2 100644 --- a/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java +++ b/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java @@ -1468,8 +1468,6 @@ public class AbstractPopup implements JBPopup { public static Window setSize(JComponent content, final Dimension size) { final Window popupWindow = SwingUtilities.windowForComponent(content); - final Point location = popupWindow.getLocation(); - popupWindow.setLocation(location.x, location.y); Insets insets = content.getInsets(); if (insets != null) { size.width += insets.left + insets.right; diff --git a/resources/src/idea/RichPlatformPlugin.xml b/resources/src/idea/RichPlatformPlugin.xml index 61c0b6f00c09..e6ab127a6b67 100644 --- a/resources/src/idea/RichPlatformPlugin.xml +++ b/resources/src/idea/RichPlatformPlugin.xml @@ -83,6 +83,7 @@ +