diff --git a/RegExpSupport/src/org/intellij/lang/regexp/RegExpCompletionContributor.java b/RegExpSupport/src/org/intellij/lang/regexp/RegExpCompletionContributor.java
index 4e7f6929b5bf..9330f028a553 100644
--- a/RegExpSupport/src/org/intellij/lang/regexp/RegExpCompletionContributor.java
+++ b/RegExpSupport/src/org/intellij/lang/regexp/RegExpCompletionContributor.java
@@ -21,7 +21,6 @@ import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.codeInsight.lookup.TailTypeDecorator;
import com.intellij.patterns.ElementPattern;
-import static com.intellij.patterns.PlatformPatterns.psiElement;
import com.intellij.psi.PsiElement;
import com.intellij.util.Icons;
import com.intellij.util.ProcessingContext;
@@ -32,12 +31,10 @@ import org.jetbrains.annotations.NotNull;
import javax.swing.*;
+import static com.intellij.patterns.PlatformPatterns.psiElement;
+
/**
- * Created by IntelliJ IDEA.
- * User: vnikolaenko
- * Date: 22.09.2008
- * Time: 12:14:14
- * To change this template use File | Settings | File Templates.
+ * @author vnikolaenko
*/
public class RegExpCompletionContributor extends CompletionContributor {
private static final Icon emptyIcon = new EmptyIcon(Icons.PROPERTY_ICON.getIconWidth(), Icons.PROPERTY_ICON.getIconHeight());
diff --git a/RegExpSupport/src/org/intellij/lang/regexp/RegExpDocumentationProvider.java b/RegExpSupport/src/org/intellij/lang/regexp/RegExpDocumentationProvider.java
index 1106b4805b08..eba87b3c1383 100644
--- a/RegExpSupport/src/org/intellij/lang/regexp/RegExpDocumentationProvider.java
+++ b/RegExpSupport/src/org/intellij/lang/regexp/RegExpDocumentationProvider.java
@@ -26,11 +26,7 @@ import org.intellij.lang.regexp.psi.impl.RegExpPropertyImpl;
import org.jetbrains.annotations.Nullable;
/**
- * Created by IntelliJ IDEA.
- * User: vnikolaenko
- * Date: 17.09.2008
- * Time: 19:24:29
- * To change this template use File | Settings | File Templates.
+ * @author vnikolaenko
*/
public class RegExpDocumentationProvider extends QuickDocumentationProvider {
@Override
diff --git a/build/lib/gant/lib/jps.jar b/build/lib/gant/lib/jps.jar
index 18b2cfe65445..5a618983c636 100644
Binary files a/build/lib/gant/lib/jps.jar and b/build/lib/gant/lib/jps.jar differ
diff --git a/images/src/org/intellij/images/actions/ToggleTransparencyChessboardAction.java b/images/src/org/intellij/images/actions/ToggleTransparencyChessboardAction.java
index 0fd76172942c..07634679fc41 100644
--- a/images/src/org/intellij/images/actions/ToggleTransparencyChessboardAction.java
+++ b/images/src/org/intellij/images/actions/ToggleTransparencyChessboardAction.java
@@ -27,12 +27,12 @@ import org.intellij.images.ui.ImageComponentDecorator;
*/
public final class ToggleTransparencyChessboardAction extends ToggleAction {
public boolean isSelected(AnActionEvent e) {
- ImageComponentDecorator decorator = (ImageComponentDecorator)e.getDataContext().getData(ImageComponentDecorator.class.getName());
+ ImageComponentDecorator decorator = ImageComponentDecorator.DATA_KEY.getData(e.getDataContext());
return decorator != null && decorator.isEnabledForActionPlace(e.getPlace()) && decorator.isTransparencyChessboardVisible();
}
public void setSelected(AnActionEvent e, boolean state) {
- ImageComponentDecorator decorator = (ImageComponentDecorator)e.getDataContext().getData(ImageComponentDecorator.class.getName());
+ ImageComponentDecorator decorator = ImageComponentDecorator.DATA_KEY.getData(e.getDataContext());
if (decorator != null && decorator.isEnabledForActionPlace(e.getPlace())) {
decorator.setTransparencyChessboardVisible(state);
}
@@ -40,7 +40,7 @@ public final class ToggleTransparencyChessboardAction extends ToggleAction {
public void update(final AnActionEvent e) {
super.update(e);
- ImageComponentDecorator decorator = (ImageComponentDecorator)e.getDataContext().getData(ImageComponentDecorator.class.getName());
+ ImageComponentDecorator decorator = ImageComponentDecorator.DATA_KEY.getData(e.getDataContext());
e.getPresentation().setEnabled(decorator != null && decorator.isEnabledForActionPlace(e.getPlace()));
e.getPresentation().setText(isSelected(e) ? "Hide Chessboard" : "Show Chessboard");
}
diff --git a/images/src/org/intellij/images/editor/impl/ImageEditorUI.java b/images/src/org/intellij/images/editor/impl/ImageEditorUI.java
index 9a6c8a2cd950..1a93527258d2 100644
--- a/images/src/org/intellij/images/editor/impl/ImageEditorUI.java
+++ b/images/src/org/intellij/images/editor/impl/ImageEditorUI.java
@@ -73,7 +73,7 @@ final class ImageEditorUI extends JPanel implements DataProvider {
final PsiActionSupportFactory factory = PsiActionSupportFactory.getInstance();
copyPasteSupport = factory.createPsiBasedCopyPasteSupport(editor.getProject(), this, new PsiActionSupportFactory.PsiElementSelector() {
public PsiElement[] getSelectedElements() {
- return (PsiElement[]) getData(DataConstants.PSI_ELEMENT_ARRAY);
+ return LangDataKeys.PSI_ELEMENT_ARRAY.getData(ImageEditorUI.this);
}
});
@@ -342,26 +342,26 @@ final class ImageEditorUI extends JPanel implements DataProvider {
@Nullable
public Object getData(String dataId) {
- if (DataConstants.PROJECT.equals(dataId)) {
+ if (PlatformDataKeys.PROJECT.is(dataId)) {
return editor.getProject();
- } else if (DataConstants.VIRTUAL_FILE.equals(dataId)) {
+ } else if (PlatformDataKeys.VIRTUAL_FILE.is(dataId)) {
return editor.getFile();
- } else if (DataConstants.VIRTUAL_FILE_ARRAY.equals(dataId)) {
+ } else if (PlatformDataKeys.VIRTUAL_FILE_ARRAY.is(dataId)) {
return new VirtualFile[]{editor.getFile()};
- } else if (DataConstants.PSI_FILE.equals(dataId)) {
- return getData(DataConstants.PSI_ELEMENT);
- } else if (DataConstants.PSI_ELEMENT.equals(dataId)) {
+ } else if (LangDataKeys.PSI_FILE.is(dataId)) {
+ return getData(LangDataKeys.PSI_ELEMENT.getName());
+ } else if (LangDataKeys.PSI_ELEMENT.is(dataId)) {
VirtualFile file = editor.getFile();
return file != null && file.isValid() ? PsiManager.getInstance(editor.getProject()).findFile(file) : null;
- } else if (DataConstants.PSI_ELEMENT_ARRAY.equals(dataId)) {
- return new PsiElement[]{(PsiElement) getData(DataConstants.PSI_ELEMENT)};
- } else if (DataConstants.COPY_PROVIDER.equals(dataId)) {
+ } else if (LangDataKeys.PSI_ELEMENT_ARRAY.is(dataId)) {
+ return new PsiElement[]{(PsiElement) getData(LangDataKeys.PSI_ELEMENT.getName())};
+ } else if (PlatformDataKeys.COPY_PROVIDER.is(dataId)) {
return copyPasteSupport.getCopyProvider();
- } else if (DataConstants.CUT_PROVIDER.equals(dataId)) {
+ } else if (PlatformDataKeys.CUT_PROVIDER.is(dataId)) {
return copyPasteSupport.getCutProvider();
- } else if (DataConstants.DELETE_ELEMENT_PROVIDER.equals(dataId)) {
+ } else if (PlatformDataKeys.DELETE_ELEMENT_PROVIDER.is(dataId)) {
return deleteProvider;
- } else if (ImageComponentDecorator.class.getName().equals(dataId)) {
+ } else if (ImageComponentDecorator.DATA_KEY.is(dataId)) {
return editor;
}
diff --git a/images/src/org/intellij/images/thumbnail/ThumbnailView.java b/images/src/org/intellij/images/thumbnail/ThumbnailView.java
index 5f20f1976979..cf0fc5d37b98 100644
--- a/images/src/org/intellij/images/thumbnail/ThumbnailView.java
+++ b/images/src/org/intellij/images/thumbnail/ThumbnailView.java
@@ -16,6 +16,7 @@
package org.intellij.images.thumbnail;
import com.intellij.openapi.Disposable;
+import com.intellij.openapi.actionSystem.DataKey;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import org.intellij.images.ImagesBundle;
@@ -28,45 +29,47 @@ import org.jetbrains.annotations.NotNull;
* @author Alexey Efimov
*/
public interface ThumbnailView extends Disposable, ImageComponentDecorator {
- String TOOLWINDOW_ID = ImagesBundle.message("thumbnails.toolwindow.name");
+ DataKey DATA_KEY = DataKey.create(ThumbnailView.class.getName());
- @NotNull
- Project getProject();
+ String TOOLWINDOW_ID = ImagesBundle.message("thumbnails.toolwindow.name");
- /**
- * Add virtual files to view
- *
- * @param root Root
- */
- void setRoot(@NotNull VirtualFile root);
+ @NotNull
+ Project getProject();
- /**
- * Return current root
- *
- * @return Current root
- */
- VirtualFile getRoot();
+ /**
+ * Add virtual files to view
+ *
+ * @param root Root
+ */
+ void setRoot(@NotNull VirtualFile root);
- boolean isRecursive();
+ /**
+ * Return current root
+ *
+ * @return Current root
+ */
+ VirtualFile getRoot();
- void setRecursive(boolean recursive);
+ boolean isRecursive();
- void setSelected(@NotNull VirtualFile file, boolean selected);
+ void setRecursive(boolean recursive);
- boolean isSelected(@NotNull VirtualFile file);
+ void setSelected(@NotNull VirtualFile file, boolean selected);
- @NotNull
- VirtualFile[] getSelection();
+ boolean isSelected(@NotNull VirtualFile file);
- /**
- * Scroll to selection. If ToolWindow is not active, then
- * it will perform activatation before scroll.
- */
- void scrollToSelection();
+ @NotNull
+ VirtualFile[] getSelection();
- void setVisible(boolean visible);
+ /**
+ * Scroll to selection. If ToolWindow is not active, then
+ * it will perform activatation before scroll.
+ */
+ void scrollToSelection();
- boolean isVisible();
+ void setVisible(boolean visible);
- void activate();
+ boolean isVisible();
+
+ void activate();
}
diff --git a/images/src/org/intellij/images/thumbnail/actionSystem/ThumbnailViewActionUtil.java b/images/src/org/intellij/images/thumbnail/actionSystem/ThumbnailViewActionUtil.java
index b53040ab543a..bf381dff43ee 100644
--- a/images/src/org/intellij/images/thumbnail/actionSystem/ThumbnailViewActionUtil.java
+++ b/images/src/org/intellij/images/thumbnail/actionSystem/ThumbnailViewActionUtil.java
@@ -16,7 +16,6 @@
package org.intellij.images.thumbnail.actionSystem;
import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.Presentation;
import org.intellij.images.thumbnail.ThumbnailView;
@@ -44,8 +43,7 @@ public final class ThumbnailViewActionUtil {
}
public static ThumbnailView getThumbnailView(AnActionEvent e) {
- DataContext dataContext = e.getDataContext();
- return (ThumbnailView) dataContext.getData(ThumbnailView.class.getName());
+ return ThumbnailView.DATA_KEY.getData(e.getDataContext());
}
/**
diff --git a/images/src/org/intellij/images/thumbnail/impl/ThumbnailViewUI.java b/images/src/org/intellij/images/thumbnail/impl/ThumbnailViewUI.java
index 490e742fe47f..2de28dd40660 100644
--- a/images/src/org/intellij/images/thumbnail/impl/ThumbnailViewUI.java
+++ b/images/src/org/intellij/images/thumbnail/impl/ThumbnailViewUI.java
@@ -90,7 +90,7 @@ final class ThumbnailViewUI extends JPanel implements DataProvider, Disposable {
final PsiActionSupportFactory factory = PsiActionSupportFactory.getInstance();
copyPasteSupport = factory.createPsiBasedCopyPasteSupport(thumbnailView.getProject(), this, new PsiActionSupportFactory.PsiElementSelector() {
public PsiElement[] getSelectedElements() {
- return (PsiElement[]) getData(DataConstants.PSI_ELEMENT_ARRAY);
+ return (PsiElement[]) getData(LangDataKeys.PSI_ELEMENT_ARRAY.getName());
}
});
@@ -410,32 +410,32 @@ final class ThumbnailViewUI extends JPanel implements DataProvider, Disposable {
@Nullable
public Object getData(String dataId) {
- if (DataConstants.PROJECT.equals(dataId)) {
+ if (PlatformDataKeys.PROJECT.is(dataId)) {
return thumbnailView.getProject();
- } else if (DataConstants.VIRTUAL_FILE.equals(dataId)) {
+ } else if (PlatformDataKeys.VIRTUAL_FILE.is(dataId)) {
VirtualFile[] selectedFiles = getSelectedFiles();
return selectedFiles.length > 0 ? selectedFiles[0] : null;
- } else if (DataConstants.VIRTUAL_FILE_ARRAY.equals(dataId)) {
+ } else if (PlatformDataKeys.VIRTUAL_FILE_ARRAY.is(dataId)) {
return getSelectedFiles();
- } else if (DataConstants.PSI_FILE.equals(dataId)) {
- return getData(DataConstants.PSI_ELEMENT);
- } else if (DataConstants.PSI_ELEMENT.equals(dataId)) {
+ } else if (LangDataKeys.PSI_FILE.is(dataId)) {
+ return getData(LangDataKeys.PSI_ELEMENT.getName());
+ } else if (LangDataKeys.PSI_ELEMENT.is(dataId)) {
VirtualFile[] selectedFiles = getSelectedFiles();
return selectedFiles.length > 0 ? PsiManager.getInstance(thumbnailView.getProject()).findFile(selectedFiles[0]) : null;
- } else if (DataConstants.PSI_ELEMENT_ARRAY.equals(dataId)) {
+ } else if (LangDataKeys.PSI_ELEMENT_ARRAY.is(dataId)) {
return getSelectedElements();
- } else if (DataConstants.NAVIGATABLE.equals(dataId)) {
+ } else if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
VirtualFile[] selectedFiles = getSelectedFiles();
return new ThumbnailNavigatable(selectedFiles.length > 0 ? selectedFiles[0] : null);
- } else if (DataConstants.COPY_PROVIDER.equals(dataId)) {
+ } else if (PlatformDataKeys.COPY_PROVIDER.is(dataId)) {
return copyPasteSupport.getCopyProvider();
- } else if (DataConstants.CUT_PROVIDER.equals(dataId)) {
+ } else if (PlatformDataKeys.CUT_PROVIDER.is(dataId)) {
return copyPasteSupport.getCutProvider();
- } else if (DataConstants.PASTE_PROVIDER.equals(dataId)) {
+ } else if (PlatformDataKeys.PASTE_PROVIDER.is(dataId)) {
return copyPasteSupport.getPasteProvider();
- } else if (DataConstants.DELETE_ELEMENT_PROVIDER.equals(dataId)) {
+ } else if (PlatformDataKeys.DELETE_ELEMENT_PROVIDER.is(dataId)) {
return deleteProvider;
- } else if (DataConstants.NAVIGATABLE_ARRAY.equals(dataId)) {
+ } else if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
VirtualFile[] selectedFiles = getSelectedFiles();
Set navigatables = new HashSet(selectedFiles.length);
for (VirtualFile selectedFile : selectedFiles) {
@@ -444,9 +444,9 @@ final class ThumbnailViewUI extends JPanel implements DataProvider, Disposable {
}
}
return navigatables.toArray(EMPTY_NAVIGATABLE_ARRAY);
- } else if (ThumbnailView.class.getName().equals(dataId)) {
+ } else if (ThumbnailView.DATA_KEY.is(dataId)) {
return thumbnailView;
- } else if (ImageComponentDecorator.class.getName().equals(dataId)) {
+ } else if (ImageComponentDecorator.DATA_KEY.is(dataId)) {
return thumbnailView;
}
@@ -466,7 +466,7 @@ final class ThumbnailViewUI extends JPanel implements DataProvider, Disposable {
psiElements.add(element);
}
}
- return psiElements.toArray(PsiElement.EMPTY_ARRAY);
+ return psiElements.toArray(new PsiElement[psiElements.size()]);
}
@NotNull
diff --git a/images/src/org/intellij/images/ui/ImageComponentDecorator.java b/images/src/org/intellij/images/ui/ImageComponentDecorator.java
index a0a711b62c5f..da9ef9215b3a 100644
--- a/images/src/org/intellij/images/ui/ImageComponentDecorator.java
+++ b/images/src/org/intellij/images/ui/ImageComponentDecorator.java
@@ -15,21 +15,25 @@
*/
package org.intellij.images.ui;
+import com.intellij.openapi.actionSystem.DataKey;
+
/**
* Image Component manager. It can toggle backround transparency, grid, etc.
*
* @author Alexey Efimov
*/
public interface ImageComponentDecorator {
- void setTransparencyChessboardVisible(boolean visible);
+ DataKey DATA_KEY = DataKey.create(ImageComponentDecorator.class.getName());
- boolean isTransparencyChessboardVisible();
+ void setTransparencyChessboardVisible(boolean visible);
- /**
- * Return true if this decorator is enabled for this action place.
- *
- * @param place Action place
- * @return true is decorator is enabled
- */
- boolean isEnabledForActionPlace(String place);
+ boolean isTransparencyChessboardVisible();
+
+ /**
+ * Return true if this decorator is enabled for this action place.
+ *
+ * @param place Action place
+ * @return true is decorator is enabled
+ */
+ boolean isEnabledForActionPlace(String place);
}
diff --git a/java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/InsetsPropertyCodeGenerator.java b/java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/InsetsPropertyCodeGenerator.java
index dbc93a94cb3f..3ecabe8118fe 100644
--- a/java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/InsetsPropertyCodeGenerator.java
+++ b/java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/InsetsPropertyCodeGenerator.java
@@ -15,24 +15,20 @@
*/
package com.intellij.uiDesigner.compiler;
+import org.objectweb.asm.Type;
import org.objectweb.asm.commons.GeneratorAdapter;
import org.objectweb.asm.commons.Method;
-import org.objectweb.asm.Type;
import java.awt.*;
/**
- * Created by IntelliJ IDEA.
- * User: yole
- * Date: 22.11.2005
- * Time: 17:46:41
- * To change this template use File | Settings | File Templates.
+ * @author yole
*/
public class InsetsPropertyCodeGenerator extends PropertyCodeGenerator {
private final Type myInsetsType = Type.getType(Insets.class);
public void generatePushValue(final GeneratorAdapter generator, final Object value) {
- final Insets insets = (Insets) value;
+ final Insets insets = (Insets)value;
generator.newInstance(myInsetsType);
generator.dup();
generator.push(insets.top);
diff --git a/java/compiler/forms-compiler/testSrc/com/intellij/uiDesigner/core/GridBagConverterTest.java b/java/compiler/forms-compiler/testSrc/com/intellij/uiDesigner/core/GridBagConverterTest.java
index 65cd0c6e523f..1785247b0763 100644
--- a/java/compiler/forms-compiler/testSrc/com/intellij/uiDesigner/core/GridBagConverterTest.java
+++ b/java/compiler/forms-compiler/testSrc/com/intellij/uiDesigner/core/GridBagConverterTest.java
@@ -22,11 +22,7 @@ import javax.swing.*;
import java.awt.*;
/**
- * Created by IntelliJ IDEA.
- * User: yole
- * Date: 23.11.2005
- * Time: 13:47:38
- * To change this template use File | Settings | File Templates.
+ * @author yole
*/
public class GridBagConverterTest extends TestCase {
/**
@@ -892,7 +888,7 @@ public class GridBagConverterTest extends TestCase {
assertEquals(100, field3.getHeight());
}
- private void applyConversionResults(final JPanel panel, final GridBagConverter converter) {
+ private static void applyConversionResults(final JPanel panel, final GridBagConverter converter) {
GridBagConverter.Result[] results = converter.convert();
for(int i=0; i nodes = new ArrayList