mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -22,7 +22,7 @@ settings.preffered.smart.zoom.width=Preferred minimum wi&dth for smart zooming (
|
||||
settings.preffered.smart.zoom.height=Preferred minimum &height for smart zooming (pixels):
|
||||
show.grid.lines=Show &Grid lines by default
|
||||
show.transparency.chessboard=Show &transparency chessboard by default
|
||||
enable.mousewheel.zooming=Use &mouse wheel for image zooming (Ctrl+Wheel)
|
||||
enable.mousewheel.zooming=Use &mouse wheel for image zooming ({0}+Wheel)
|
||||
smart.zoom=Enable smart &zooming for small images
|
||||
chessboard.cell.size=Chessboard cell &size (pixels):
|
||||
show.grid.every=Show Grid line after &every (pixels):
|
||||
|
||||
@@ -49,207 +49,212 @@ import java.awt.event.ItemListener;
|
||||
* @author <a href="mailto:aefimov.box@gmail.com">Alexey Efimov</a>
|
||||
*/
|
||||
final class OptionsUIForm {
|
||||
private JPanel contentPane;
|
||||
private JCheckBox showGrid;
|
||||
private JLabel gridLineZoomFactorlLabel;
|
||||
private JSpinner gridLineZoomFactor;
|
||||
private JLabel gridLineSpanLabel;
|
||||
private JSpinner gridLineSpan;
|
||||
private JCheckBox showChessboard;
|
||||
private JSpinner chessboardSize;
|
||||
private JLabel chessboardSizeLabel;
|
||||
private JCheckBox wheelZooming;
|
||||
private JCheckBox smartZooming;
|
||||
private JSpinner smartZoomingWidth;
|
||||
private JLabel smartZoomingWidthLabel;
|
||||
private JSpinner smartZoomingHeight;
|
||||
private JLabel smartZoomingHeightLabel;
|
||||
private JLabel gridLineColorLabel;
|
||||
private ColorPanel gridLineColor;
|
||||
private JLabel chessboardWhiteColorLabel;
|
||||
private JLabel chessboardBlackColorLabel;
|
||||
private ColorPanel chessboardBlackColor;
|
||||
private ColorPanel chessboardWhiteColor;
|
||||
private JLabel externalEditorLabel;
|
||||
private TextFieldWithBrowseButton externalEditorPath;
|
||||
private JPanel contentPane;
|
||||
private JCheckBox showGrid;
|
||||
private JLabel gridLineZoomFactorlLabel;
|
||||
private JSpinner gridLineZoomFactor;
|
||||
private JLabel gridLineSpanLabel;
|
||||
private JSpinner gridLineSpan;
|
||||
private JCheckBox showChessboard;
|
||||
private JSpinner chessboardSize;
|
||||
private JLabel chessboardSizeLabel;
|
||||
private JCheckBox wheelZooming;
|
||||
private JCheckBox smartZooming;
|
||||
private JSpinner smartZoomingWidth;
|
||||
private JLabel smartZoomingWidthLabel;
|
||||
private JSpinner smartZoomingHeight;
|
||||
private JLabel smartZoomingHeightLabel;
|
||||
private JLabel gridLineColorLabel;
|
||||
private ColorPanel gridLineColor;
|
||||
private JLabel chessboardWhiteColorLabel;
|
||||
private JLabel chessboardBlackColorLabel;
|
||||
private ColorPanel chessboardBlackColor;
|
||||
private ColorPanel chessboardWhiteColor;
|
||||
private JLabel externalEditorLabel;
|
||||
private TextFieldWithBrowseButton externalEditorPath;
|
||||
|
||||
// Options
|
||||
private final Options options = new OptionsImpl();
|
||||
// Options
|
||||
private final Options options = new OptionsImpl();
|
||||
|
||||
OptionsUIForm() {
|
||||
// Setup labels
|
||||
gridLineZoomFactorlLabel.setLabelFor(gridLineZoomFactor);
|
||||
gridLineSpanLabel.setLabelFor(gridLineSpan);
|
||||
chessboardSizeLabel.setLabelFor(chessboardSize);
|
||||
smartZoomingWidthLabel.setLabelFor(smartZoomingWidth);
|
||||
smartZoomingHeightLabel.setLabelFor(smartZoomingHeight);
|
||||
gridLineColorLabel.setLabelFor(gridLineColor);
|
||||
chessboardWhiteColorLabel.setLabelFor(chessboardWhiteColor);
|
||||
chessboardBlackColorLabel.setLabelFor(chessboardBlackColor);
|
||||
externalEditorLabel.setLabelFor(externalEditorPath);
|
||||
OptionsUIForm() {
|
||||
|
||||
// Setup listeners for enabling and disabling linked checkbox groups
|
||||
smartZooming.addItemListener(new LinkEnabledListener(new JComponent[]{
|
||||
smartZoomingHeightLabel,
|
||||
smartZoomingHeight,
|
||||
smartZoomingWidthLabel,
|
||||
smartZoomingWidth,
|
||||
}));
|
||||
// Setup spinners models
|
||||
gridLineZoomFactor.setModel(new SpinnerNumberModel(GridOptions.DEFAULT_LINE_ZOOM_FACTOR, 2, 8, 1));
|
||||
gridLineSpan.setModel(new SpinnerNumberModel(GridOptions.DEFAULT_LINE_SPAN, 1, 100, 1));
|
||||
chessboardSize.setModel(new SpinnerNumberModel(TransparencyChessboardOptions.DEFAULT_CELL_SIZE, 1, 100, 1));
|
||||
smartZoomingWidth.setModel(new SpinnerNumberModel(ZoomOptions.DEFAULT_PREFFERED_SIZE.width, 1, 9999, 1));
|
||||
smartZoomingHeight.setModel(new SpinnerNumberModel(ZoomOptions.DEFAULT_PREFFERED_SIZE.height, 1, 9999, 1));
|
||||
wheelZooming.setText(ImagesBundle.message("enable.mousewheel.zooming", SystemInfo.isMac ? "Cmd" : "Ctrl"));
|
||||
|
||||
// Setup labels
|
||||
gridLineZoomFactorlLabel.setLabelFor(gridLineZoomFactor);
|
||||
gridLineSpanLabel.setLabelFor(gridLineSpan);
|
||||
chessboardSizeLabel.setLabelFor(chessboardSize);
|
||||
smartZoomingWidthLabel.setLabelFor(smartZoomingWidth);
|
||||
smartZoomingHeightLabel.setLabelFor(smartZoomingHeight);
|
||||
gridLineColorLabel.setLabelFor(gridLineColor);
|
||||
chessboardWhiteColorLabel.setLabelFor(chessboardWhiteColor);
|
||||
chessboardBlackColorLabel.setLabelFor(chessboardBlackColor);
|
||||
externalEditorLabel.setLabelFor(externalEditorPath);
|
||||
|
||||
// Setup listeners for chnages
|
||||
showGrid.addItemListener(new CheckboxOptionsListener(GridOptions.ATTR_SHOW_DEFAULT));
|
||||
gridLineZoomFactor.addChangeListener(new SpinnerOptionsListener(GridOptions.ATTR_LINE_ZOOM_FACTOR));
|
||||
gridLineSpan.addChangeListener(new SpinnerOptionsListener(GridOptions.ATTR_LINE_SPAN));
|
||||
showChessboard.addItemListener(new CheckboxOptionsListener(TransparencyChessboardOptions.ATTR_SHOW_DEFAULT));
|
||||
chessboardSize.addChangeListener(new SpinnerOptionsListener(TransparencyChessboardOptions.ATTR_CELL_SIZE));
|
||||
wheelZooming.addItemListener(new CheckboxOptionsListener(ZoomOptions.ATTR_WHEEL_ZOOMING));
|
||||
smartZooming.addItemListener(new CheckboxOptionsListener(ZoomOptions.ATTR_SMART_ZOOMING));
|
||||
smartZoomingWidth.addChangeListener(new SpinnerOptionsListener(ZoomOptions.ATTR_PREFFERED_WIDTH));
|
||||
smartZoomingHeight.addChangeListener(new SpinnerOptionsListener(ZoomOptions.ATTR_PREFFERED_HEIGHT));
|
||||
gridLineColor.addActionListener(new ColorOptionsListener(GridOptions.ATTR_LINE_COLOR));
|
||||
chessboardWhiteColor.addActionListener(new ColorOptionsListener(TransparencyChessboardOptions.ATTR_WHITE_COLOR));
|
||||
chessboardBlackColor.addActionListener(new ColorOptionsListener(TransparencyChessboardOptions.ATTR_BLACK_COLOR));
|
||||
externalEditorPath.getTextField().getDocument().addDocumentListener(new TextDocumentOptionsListener(ExternalEditorOptions.ATTR_EXECUTABLE_PATH));
|
||||
// Setup listeners for enabling and disabling linked checkbox groups
|
||||
smartZooming.addItemListener(new LinkEnabledListener(new JComponent[]{
|
||||
smartZoomingHeightLabel,
|
||||
smartZoomingHeight,
|
||||
smartZoomingWidthLabel,
|
||||
smartZoomingWidth,
|
||||
}));
|
||||
// Setup spinners models
|
||||
gridLineZoomFactor.setModel(new SpinnerNumberModel(GridOptions.DEFAULT_LINE_ZOOM_FACTOR, 2, 8, 1));
|
||||
gridLineSpan.setModel(new SpinnerNumberModel(GridOptions.DEFAULT_LINE_SPAN, 1, 100, 1));
|
||||
chessboardSize.setModel(new SpinnerNumberModel(TransparencyChessboardOptions.DEFAULT_CELL_SIZE, 1, 100, 1));
|
||||
smartZoomingWidth.setModel(new SpinnerNumberModel(ZoomOptions.DEFAULT_PREFFERED_SIZE.width, 1, 9999, 1));
|
||||
smartZoomingHeight.setModel(new SpinnerNumberModel(ZoomOptions.DEFAULT_PREFFERED_SIZE.height, 1, 9999, 1));
|
||||
|
||||
externalEditorPath.addActionListener(new ExternalEditorPathActionListener());
|
||||
// Setup listeners for chnages
|
||||
showGrid.addItemListener(new CheckboxOptionsListener(GridOptions.ATTR_SHOW_DEFAULT));
|
||||
gridLineZoomFactor.addChangeListener(new SpinnerOptionsListener(GridOptions.ATTR_LINE_ZOOM_FACTOR));
|
||||
gridLineSpan.addChangeListener(new SpinnerOptionsListener(GridOptions.ATTR_LINE_SPAN));
|
||||
showChessboard.addItemListener(new CheckboxOptionsListener(TransparencyChessboardOptions.ATTR_SHOW_DEFAULT));
|
||||
chessboardSize.addChangeListener(new SpinnerOptionsListener(TransparencyChessboardOptions.ATTR_CELL_SIZE));
|
||||
wheelZooming.addItemListener(new CheckboxOptionsListener(ZoomOptions.ATTR_WHEEL_ZOOMING));
|
||||
smartZooming.addItemListener(new CheckboxOptionsListener(ZoomOptions.ATTR_SMART_ZOOMING));
|
||||
smartZoomingWidth.addChangeListener(new SpinnerOptionsListener(ZoomOptions.ATTR_PREFFERED_WIDTH));
|
||||
smartZoomingHeight.addChangeListener(new SpinnerOptionsListener(ZoomOptions.ATTR_PREFFERED_HEIGHT));
|
||||
gridLineColor.addActionListener(new ColorOptionsListener(GridOptions.ATTR_LINE_COLOR));
|
||||
chessboardWhiteColor.addActionListener(new ColorOptionsListener(TransparencyChessboardOptions.ATTR_WHITE_COLOR));
|
||||
chessboardBlackColor.addActionListener(new ColorOptionsListener(TransparencyChessboardOptions.ATTR_BLACK_COLOR));
|
||||
externalEditorPath.getTextField().getDocument()
|
||||
.addDocumentListener(new TextDocumentOptionsListener(ExternalEditorOptions.ATTR_EXECUTABLE_PATH));
|
||||
|
||||
updateUI();
|
||||
externalEditorPath.addActionListener(new ExternalEditorPathActionListener());
|
||||
|
||||
updateUI();
|
||||
}
|
||||
|
||||
public JPanel getContentPane() {
|
||||
return contentPane;
|
||||
}
|
||||
|
||||
private static class LinkEnabledListener implements ItemListener {
|
||||
private final JComponent[] children;
|
||||
|
||||
LinkEnabledListener(JComponent[] children) {
|
||||
this.children = children.clone();
|
||||
}
|
||||
|
||||
public JPanel getContentPane() {
|
||||
return contentPane;
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
setSelected(e.getStateChange() == ItemEvent.SELECTED);
|
||||
}
|
||||
|
||||
private static class LinkEnabledListener implements ItemListener {
|
||||
private final JComponent[] children;
|
||||
private void setSelected(boolean selected) {
|
||||
for (JComponent component : children) {
|
||||
component.setEnabled(selected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LinkEnabledListener(JComponent[] children) {
|
||||
this.children = children.clone();
|
||||
}
|
||||
public Options getOptions() {
|
||||
return options;
|
||||
}
|
||||
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
setSelected(e.getStateChange() == ItemEvent.SELECTED);
|
||||
}
|
||||
public void updateUI() {
|
||||
// Grid options
|
||||
EditorOptions editorOptions = options.getEditorOptions();
|
||||
ExternalEditorOptions externalEditorOptions = options.getExternalEditorOptions();
|
||||
|
||||
private void setSelected(boolean selected) {
|
||||
for (JComponent component : children) {
|
||||
component.setEnabled(selected);
|
||||
}
|
||||
}
|
||||
GridOptions gridOptions = editorOptions.getGridOptions();
|
||||
showGrid.setSelected(gridOptions.isShowDefault());
|
||||
gridLineZoomFactor.setValue(gridOptions.getLineZoomFactor());
|
||||
gridLineSpan.setValue(gridOptions.getLineSpan());
|
||||
gridLineColor.setSelectedColor(gridOptions.getLineColor());
|
||||
TransparencyChessboardOptions transparencyChessboardOptions = editorOptions.getTransparencyChessboardOptions();
|
||||
showChessboard.setSelected(transparencyChessboardOptions.isShowDefault());
|
||||
chessboardSize.setValue(transparencyChessboardOptions.getCellSize());
|
||||
chessboardWhiteColor.setSelectedColor(transparencyChessboardOptions.getWhiteColor());
|
||||
chessboardBlackColor.setSelectedColor(transparencyChessboardOptions.getBlackColor());
|
||||
ZoomOptions zoomOptions = editorOptions.getZoomOptions();
|
||||
wheelZooming.setSelected(zoomOptions.isWheelZooming());
|
||||
smartZooming.setSelected(zoomOptions.isSmartZooming());
|
||||
Dimension prefferedSize = zoomOptions.getPrefferedSize();
|
||||
smartZoomingWidth.setValue(prefferedSize.width);
|
||||
smartZoomingHeight.setValue(prefferedSize.height);
|
||||
externalEditorPath.setText(externalEditorOptions.getExecutablePath());
|
||||
}
|
||||
|
||||
private final class CheckboxOptionsListener implements ItemListener {
|
||||
private final String name;
|
||||
|
||||
private CheckboxOptionsListener(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Options getOptions() {
|
||||
return options;
|
||||
@SuppressWarnings({"UnnecessaryBoxing"})
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
options.setOption(name, Boolean.valueOf(ItemEvent.SELECTED == e.getStateChange()));
|
||||
}
|
||||
}
|
||||
|
||||
private final class SpinnerOptionsListener implements ChangeListener {
|
||||
private final String name;
|
||||
|
||||
private SpinnerOptionsListener(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void updateUI() {
|
||||
// Grid options
|
||||
EditorOptions editorOptions = options.getEditorOptions();
|
||||
ExternalEditorOptions externalEditorOptions = options.getExternalEditorOptions();
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
JSpinner source = (JSpinner)e.getSource();
|
||||
options.setOption(name, source.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
GridOptions gridOptions = editorOptions.getGridOptions();
|
||||
showGrid.setSelected(gridOptions.isShowDefault());
|
||||
gridLineZoomFactor.setValue(gridOptions.getLineZoomFactor());
|
||||
gridLineSpan.setValue(gridOptions.getLineSpan());
|
||||
gridLineColor.setSelectedColor(gridOptions.getLineColor());
|
||||
TransparencyChessboardOptions transparencyChessboardOptions = editorOptions.getTransparencyChessboardOptions();
|
||||
showChessboard.setSelected(transparencyChessboardOptions.isShowDefault());
|
||||
chessboardSize.setValue(transparencyChessboardOptions.getCellSize());
|
||||
chessboardWhiteColor.setSelectedColor(transparencyChessboardOptions.getWhiteColor());
|
||||
chessboardBlackColor.setSelectedColor(transparencyChessboardOptions.getBlackColor());
|
||||
ZoomOptions zoomOptions = editorOptions.getZoomOptions();
|
||||
wheelZooming.setSelected(zoomOptions.isWheelZooming());
|
||||
smartZooming.setSelected(zoomOptions.isSmartZooming());
|
||||
Dimension prefferedSize = zoomOptions.getPrefferedSize();
|
||||
smartZoomingWidth.setValue(prefferedSize.width);
|
||||
smartZoomingHeight.setValue(prefferedSize.height);
|
||||
externalEditorPath.setText(externalEditorOptions.getExecutablePath());
|
||||
private final class ColorOptionsListener implements ActionListener {
|
||||
private final String name;
|
||||
|
||||
private ColorOptionsListener(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
private final class CheckboxOptionsListener implements ItemListener {
|
||||
private final String name;
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
ColorPanel source = (ColorPanel)e.getSource();
|
||||
options.setOption(name, source.getSelectedColor());
|
||||
}
|
||||
}
|
||||
|
||||
private CheckboxOptionsListener(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
private final class TextDocumentOptionsListener extends DocumentAdapter {
|
||||
private final String name;
|
||||
|
||||
@SuppressWarnings({"UnnecessaryBoxing"})
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
options.setOption(name, Boolean.valueOf(ItemEvent.SELECTED == e.getStateChange()));
|
||||
}
|
||||
public TextDocumentOptionsListener(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
private final class SpinnerOptionsListener implements ChangeListener {
|
||||
private final String name;
|
||||
|
||||
private SpinnerOptionsListener(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
JSpinner source = (JSpinner)e.getSource();
|
||||
options.setOption(name, source.getValue());
|
||||
}
|
||||
protected void textChanged(DocumentEvent documentEvent) {
|
||||
Document document = documentEvent.getDocument();
|
||||
Position startPosition = document.getStartPosition();
|
||||
try {
|
||||
options.setOption(name, document.getText(startPosition.getOffset(), document.getLength()));
|
||||
}
|
||||
catch (BadLocationException e) {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final class ColorOptionsListener implements ActionListener {
|
||||
private final String name;
|
||||
|
||||
private ColorOptionsListener(String name) {
|
||||
this.name = name;
|
||||
private final class ExternalEditorPathActionListener implements ActionListener {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Application application = ApplicationManager.getApplication();
|
||||
VirtualFile previous = application.runWriteAction(new Computable<VirtualFile>() {
|
||||
public VirtualFile compute() {
|
||||
return LocalFileSystem.getInstance().refreshAndFindFileByPath(externalEditorPath.getText().replace('\\', '/'));
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
ColorPanel source = (ColorPanel)e.getSource();
|
||||
options.setOption(name, source.getSelectedColor());
|
||||
}
|
||||
}
|
||||
|
||||
private final class TextDocumentOptionsListener extends DocumentAdapter {
|
||||
private final String name;
|
||||
|
||||
public TextDocumentOptionsListener(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
protected void textChanged(DocumentEvent documentEvent) {
|
||||
Document document = documentEvent.getDocument();
|
||||
Position startPosition = document.getStartPosition();
|
||||
try {
|
||||
options.setOption(name, document.getText(startPosition.getOffset(), document.getLength()));
|
||||
} catch (BadLocationException e) {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final class ExternalEditorPathActionListener implements ActionListener {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Application application = ApplicationManager.getApplication();
|
||||
VirtualFile previous = application.runWriteAction(new Computable<VirtualFile>() {
|
||||
public VirtualFile compute() {
|
||||
return LocalFileSystem.getInstance().refreshAndFindFileByPath(externalEditorPath.getText().replace('\\', '/'));
|
||||
}
|
||||
});
|
||||
FileChooserDescriptor fileDescriptor = new FileChooserDescriptor(true, SystemInfo.isMac, false, false, false, false);
|
||||
fileDescriptor.setShowFileSystemRoots(true);
|
||||
fileDescriptor.setTitle(ImagesBundle.message("select.external.executable.title"));
|
||||
fileDescriptor.setDescription(ImagesBundle.message("select.external.executable.message"));
|
||||
FileChooser.chooseFilesWithSlideEffect(fileDescriptor, null, previous, new Consumer<VirtualFile[]>() {
|
||||
@Override
|
||||
public void consume(VirtualFile[] virtualFiles) {
|
||||
if (virtualFiles != null && virtualFiles.length > 0) {
|
||||
String path = virtualFiles[0].getPath();
|
||||
externalEditorPath.setText(path);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
FileChooserDescriptor fileDescriptor = new FileChooserDescriptor(true, SystemInfo.isMac, false, false, false, false);
|
||||
fileDescriptor.setShowFileSystemRoots(true);
|
||||
fileDescriptor.setTitle(ImagesBundle.message("select.external.executable.title"));
|
||||
fileDescriptor.setDescription(ImagesBundle.message("select.external.executable.message"));
|
||||
FileChooser.chooseFilesWithSlideEffect(fileDescriptor, null, previous, new Consumer<VirtualFile[]>() {
|
||||
@Override
|
||||
public void consume(VirtualFile[] virtualFiles) {
|
||||
if (virtualFiles != null && virtualFiles.length > 0) {
|
||||
String path = virtualFiles[0].getPath();
|
||||
externalEditorPath.setText(path);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,16 +15,26 @@
|
||||
*/
|
||||
package com.intellij.compiler.actions;
|
||||
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CommonShortcuts;
|
||||
import com.intellij.openapi.actionSystem.Presentation;
|
||||
import com.intellij.openapi.compiler.CompileScope;
|
||||
import com.intellij.openapi.compiler.CompilerManager;
|
||||
import com.intellij.openapi.keymap.KeymapUtil;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.ui.popup.ListSeparator;
|
||||
import com.intellij.openapi.ui.popup.PopupStep;
|
||||
import com.intellij.openapi.ui.popup.util.BaseListPopupStep;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.packaging.artifacts.Artifact;
|
||||
import com.intellij.packaging.impl.artifacts.ArtifactUtil;
|
||||
import com.intellij.packaging.impl.compiler.ArtifactCompileScope;
|
||||
@@ -37,9 +47,8 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
@@ -102,10 +111,9 @@ public class BuildArtifactAction extends AnAction {
|
||||
}
|
||||
|
||||
protected static void doBuild(@NotNull Project project, final @NotNull ArtifactPopupItem item, boolean rebuild) {
|
||||
final Artifact artifact = item.getArtifact();
|
||||
final List<Artifact> artifacts = artifact != null ? Collections.singletonList(artifact) : ArtifactUtil.getArtifactWithOutputPaths(project);
|
||||
final List<Artifact> artifacts = item.getArtifacts(project);
|
||||
final CompileScope scope = ArtifactCompileScope.createArtifactsScope(project, artifacts);
|
||||
ArtifactsWorkspaceSettings.getInstance(project).setArtifactsToBuild(ContainerUtil.createMaybeSingletonList(artifact));
|
||||
ArtifactsWorkspaceSettings.getInstance(project).setArtifactsToBuild(ContainerUtil.createMaybeSingletonList(item.getArtifact()));
|
||||
if (!rebuild) {
|
||||
CompilerManager.getInstance(project).make(scope, null);
|
||||
}
|
||||
@@ -125,6 +133,70 @@ public class BuildArtifactAction extends AnAction {
|
||||
}
|
||||
}
|
||||
|
||||
private static class CleanArtifactItem extends ArtifactActionItem {
|
||||
private CleanArtifactItem(@NotNull ArtifactPopupItem item, @NotNull Project project) {
|
||||
super(item, project, "Clean");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Set<VirtualFile> parents = new HashSet<VirtualFile>();
|
||||
final VirtualFile[] roots = ProjectRootManager.getInstance(myProject).getContentSourceRoots();
|
||||
for (VirtualFile root : roots) {
|
||||
VirtualFile parent = root;
|
||||
while (parent != null && !parents.contains(parent)) {
|
||||
parents.add(parent);
|
||||
parent = parent.getParent();
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, String> outputPathContainingSourceRoots = new HashMap<String, String>();
|
||||
final List<File> files = new ArrayList<File>();
|
||||
for (Artifact artifact : myArtifactPopupItem.getArtifacts(myProject)) {
|
||||
String outputPath = artifact.getOutputFilePath();
|
||||
if (outputPath != null) {
|
||||
files.add(new File(FileUtil.toSystemDependentName(outputPath)));
|
||||
final VirtualFile outputFile = LocalFileSystem.getInstance().findFileByPath(outputPath);
|
||||
if (parents.contains(outputFile)) {
|
||||
outputPathContainingSourceRoots.put(artifact.getName(), outputPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!outputPathContainingSourceRoots.isEmpty()) {
|
||||
final String message;
|
||||
if (outputPathContainingSourceRoots.size() == 1 && outputPathContainingSourceRoots.values().size() == 1) {
|
||||
final String name = ContainerUtil.getFirstItem(outputPathContainingSourceRoots.keySet());
|
||||
final String output = outputPathContainingSourceRoots.get(name);
|
||||
message = "The output directory '" + output + "' of '" + name + "' artifact contains source roots of the project. Do you want to continue and clear it?";
|
||||
}
|
||||
else {
|
||||
StringBuilder info = new StringBuilder();
|
||||
for (String name : outputPathContainingSourceRoots.keySet()) {
|
||||
info.append(" '").append(name).append("' artifact ('").append(outputPathContainingSourceRoots.get(name)).append("')\n");
|
||||
}
|
||||
message = "The output directories of the following artifacts contains source roots:\n" +
|
||||
info + "Do you want to continue and clear these directories?";
|
||||
}
|
||||
final int answer = Messages.showYesNoDialog(myProject, message, "Clean Artifacts", null);
|
||||
if (answer != 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
new Task.Backgroundable(myProject, "Cleaning artifacts...", true) {
|
||||
@Override
|
||||
public void run(@NotNull ProgressIndicator indicator) {
|
||||
for (File file : files) {
|
||||
indicator.checkCanceled();
|
||||
FileUtil.delete(file);
|
||||
}
|
||||
LocalFileSystem.getInstance().refreshIoFiles(files, true, true, null);
|
||||
}
|
||||
}.queue();
|
||||
}
|
||||
}
|
||||
|
||||
private static class RebuildArtifactItem extends ArtifactActionItem {
|
||||
private RebuildArtifactItem(ArtifactPopupItem item, Project project) {
|
||||
super(item, project, "Rebuild");
|
||||
@@ -189,6 +261,11 @@ public class BuildArtifactAction extends AnAction {
|
||||
public Icon getIcon() {
|
||||
return myIcon;
|
||||
}
|
||||
|
||||
public List<Artifact> getArtifacts(Project project) {
|
||||
final Artifact artifact = getArtifact();
|
||||
return artifact != null ? Collections.singletonList(artifact) : ArtifactUtil.getArtifactWithOutputPaths(project);
|
||||
}
|
||||
}
|
||||
|
||||
private static class ChooseArtifactStep extends BaseListPopupStep<ArtifactPopupItem> {
|
||||
@@ -244,6 +321,7 @@ public class BuildArtifactAction extends AnAction {
|
||||
final List<ArtifactActionItem> actions = new ArrayList<ArtifactActionItem>();
|
||||
actions.add(new BuildArtifactItem(selectedValue, myProject));
|
||||
actions.add(new RebuildArtifactItem(selectedValue, myProject));
|
||||
actions.add(new CleanArtifactItem(selectedValue, myProject));
|
||||
if (mySettingsService != null) {
|
||||
actions.add(new EditArtifactItem(selectedValue, myProject, mySettingsService));
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.intellij.packaging.artifacts.ArtifactProperties;
|
||||
import com.intellij.packaging.artifacts.ArtifactType;
|
||||
import com.intellij.packaging.elements.*;
|
||||
import com.intellij.packaging.impl.elements.*;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.Processor;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -554,5 +555,9 @@ public class ArtifactUtil {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String suggestArtifactFileName(String artifactName) {
|
||||
return PathUtil.suggestFileName(artifactName, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
*/
|
||||
package com.intellij.packaging.impl.artifacts;
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.packaging.artifacts.ArtifactTemplate;
|
||||
import com.intellij.packaging.artifacts.ArtifactType;
|
||||
import com.intellij.packaging.elements.CompositePackagingElement;
|
||||
import com.intellij.packaging.elements.PackagingElementOutputKind;
|
||||
import com.intellij.packaging.elements.PackagingElementResolvingContext;
|
||||
import com.intellij.packaging.impl.elements.ArchivePackagingElement;
|
||||
import com.intellij.util.PathUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -54,7 +54,7 @@ public class JarArtifactType extends ArtifactType {
|
||||
@NotNull
|
||||
@Override
|
||||
public CompositePackagingElement<?> createRootElement(@NotNull String artifactName) {
|
||||
return new ArchivePackagingElement(FileUtil.sanitizeFileName(artifactName) + ".jar");
|
||||
return new ArchivePackagingElement(ArtifactUtil.suggestArtifactFileName(artifactName) + ".jar");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+1
-2
@@ -24,7 +24,6 @@ import com.intellij.openapi.roots.OrderRootType;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.roots.libraries.Library;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.packaging.artifacts.ArtifactTemplate;
|
||||
@@ -94,7 +93,7 @@ public class JarFromModulesTemplate extends ArtifactTemplate {
|
||||
String name = modules.length == 1 ? modules[0].getName() : project.getName();
|
||||
|
||||
final PackagingElementFactory factory = PackagingElementFactory.getInstance();
|
||||
final CompositePackagingElement<?> archive = factory.createArchive(FileUtil.sanitizeFileName(name) + ".jar");
|
||||
final CompositePackagingElement<?> archive = factory.createArchive(ArtifactUtil.suggestArtifactFileName(name) + ".jar");
|
||||
|
||||
OrderEnumerator orderEnumerator = ProjectRootManager.getInstance(project).orderEntries(Arrays.asList(modules));
|
||||
|
||||
|
||||
+2
-2
@@ -429,14 +429,14 @@ public class ArtifactEditorImpl implements ArtifactEditorEx {
|
||||
setOutputPath(ArtifactUtil.getDefaultArtifactOutputPath(newArtifactName, myProject));
|
||||
final CompositePackagingElement<?> root = getRootElement();
|
||||
if (root instanceof ArchivePackagingElement) {
|
||||
String oldFileName = FileUtil.sanitizeFileName(oldArtifactName);
|
||||
String oldFileName = ArtifactUtil.suggestArtifactFileName(oldArtifactName);
|
||||
final String name = ((ArchivePackagingElement)root).getArchiveFileName();
|
||||
final String fileName = FileUtil.getNameWithoutExtension(name);
|
||||
final String extension = FileUtil.getExtension(name);
|
||||
if (fileName.equals(oldFileName) && extension.length() > 0) {
|
||||
myLayoutTreeComponent.editLayout(new Runnable() {
|
||||
public void run() {
|
||||
((ArchivePackagingElement)getRootElement()).setArchiveFileName(FileUtil.sanitizeFileName(newArtifactName) + "." + extension);
|
||||
((ArchivePackagingElement)getRootElement()).setArchiveFileName(ArtifactUtil.suggestArtifactFileName(newArtifactName) + "." + extension);
|
||||
}
|
||||
});
|
||||
myLayoutTreeComponent.updateRootNode();
|
||||
|
||||
+10
-3
@@ -152,8 +152,15 @@ public class CreateConstructorParameterFromFieldFix implements IntentionAction {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
addParameterToConstructor(project, file, editor, constructor, constrs.size() == constructors.length ? fields.toArray(new PsiField[fields.size()]) : new PsiField[]{getField()});
|
||||
Collections.sort(fields, new Comparator<PsiField>() {
|
||||
@Override
|
||||
public int compare(PsiField o1, PsiField o2) {
|
||||
return o1.getTextOffset() - o2.getTextOffset();
|
||||
}
|
||||
});
|
||||
addParameterToConstructor(project, file, editor, constructor, constrs.size() == constructors.length
|
||||
? fields.toArray(new PsiField[fields.size()])
|
||||
: new PsiField[]{getField()});
|
||||
fieldsToFix.clear();
|
||||
}
|
||||
}
|
||||
@@ -217,7 +224,7 @@ public class CreateConstructorParameterFromFieldFix implements IntentionAction {
|
||||
expressions[i++] = factory.createExpressionFromText(field.getName(), constructor);
|
||||
}
|
||||
if (constructor.isVarArgs()) {
|
||||
ArrayUtil.swap(expressions, parameters.length - 1, expressions.length - 1);
|
||||
ArrayUtil.rotateLeft(expressions, parameters.length - 1, expressions.length - 1);
|
||||
}
|
||||
final SmartPointerManager manager = SmartPointerManager.getInstance(project);
|
||||
final SmartPsiElementPointer constructorPointer = manager.createSmartPsiElementPointer(constructor);
|
||||
|
||||
@@ -477,6 +477,8 @@ public class JavaSdkImpl extends JavaSdk {
|
||||
if (jarDir != null && jarDir.isDirectory()) {
|
||||
File[] jarFiles = jarDir.listFiles(jarFileFilter);
|
||||
for (File jarFile : jarFiles) {
|
||||
final String jarFileName = jarFile.getName();
|
||||
if (jarFileName.equals("alt-rt.jar") || jarFileName.equals("alt-string.jar")) continue;
|
||||
try {
|
||||
// File.getCanonicalFile() allows us to filter out duplicate (symbolically linked) jar files,
|
||||
// commonly found in osx JDK distributions
|
||||
|
||||
+2
-6
@@ -707,12 +707,8 @@ public String getAccessorsVisibility() {
|
||||
}
|
||||
|
||||
private void configureColors(boolean isSelected, JTable table, boolean hasFocus, final int row, final int column) {
|
||||
if (isSelected) {
|
||||
setForeground(table.getSelectionForeground());
|
||||
} else {
|
||||
setForeground(UIUtil.getTableForeground());
|
||||
}
|
||||
|
||||
setForeground(isSelected ? UIUtil.getTableSelectionForeground() : UIUtil.getTableForeground());
|
||||
setBackground(isSelected ? UIUtil.getTableSelectionBackground() : UIUtil.getTableBackground());
|
||||
if (hasFocus) {
|
||||
if (table.isCellEditable(row, column)) {
|
||||
super.setForeground(UIUtil.getTableFocusCellForeground());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2011 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.
|
||||
@@ -15,31 +15,23 @@
|
||||
*/
|
||||
package com.intellij.codeInsight.daemon;
|
||||
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.AbstractBundle;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.PropertyKey;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
/**
|
||||
* @author max
|
||||
*/
|
||||
public class JavaErrorMessages {
|
||||
public class JavaErrorMessages extends AbstractBundle {
|
||||
public static final JavaErrorMessages INSTANCE = new JavaErrorMessages();
|
||||
|
||||
@NonNls public static final String BUNDLE = "messages.JavaErrorMessages";
|
||||
|
||||
private JavaErrorMessages() {
|
||||
super(BUNDLE);
|
||||
}
|
||||
|
||||
public static String message(@PropertyKey(resourceBundle = BUNDLE)String key, Object... params) {
|
||||
return CommonBundle.message(getBundle(), key, params);
|
||||
}
|
||||
|
||||
private static class ResourceBundleHolder {
|
||||
private static final ResourceBundle ourBundle = ResourceBundle.getBundle(BUNDLE);
|
||||
}
|
||||
|
||||
private static ResourceBundle getBundle() {
|
||||
return ResourceBundleHolder.ourBundle;
|
||||
return INSTANCE.getMessage(key, params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.intellij.lang.java.parser;
|
||||
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.AbstractBundle;
|
||||
import com.intellij.codeInsight.daemon.JavaErrorMessages;
|
||||
import com.intellij.lang.PsiBuilder;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
@@ -27,8 +27,6 @@ import com.intellij.psi.tree.TokenSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import static com.intellij.lang.PsiBuilderUtil.expect;
|
||||
import static com.intellij.lang.java.parser.JavaParserUtil.*;
|
||||
|
||||
@@ -52,14 +50,17 @@ public class FileParser {
|
||||
}
|
||||
|
||||
public void parse(final PsiBuilder builder) {
|
||||
parseFile(builder, IMPORT_LIST_STOPPER_SET, JavaErrorMessages.BUNDLE, "expected.class.or.interface");
|
||||
parseFile(builder, IMPORT_LIST_STOPPER_SET, JavaErrorMessages.INSTANCE, "expected.class.or.interface");
|
||||
}
|
||||
|
||||
private static String error(@NotNull String bundle, @NotNull String errorMessageKey) {
|
||||
return CommonBundle.message(ResourceBundle.getBundle(bundle), errorMessageKey);
|
||||
private static String error(@NotNull AbstractBundle bundle, @NotNull String errorMessageKey) {
|
||||
return bundle.getMessage(errorMessageKey);
|
||||
}
|
||||
|
||||
public void parseFile(final PsiBuilder builder, final TokenSet importListStoppers, @NotNull String bundle, @NotNull String errorMessageKey) {
|
||||
public void parseFile(@NotNull final PsiBuilder builder,
|
||||
@NotNull final TokenSet importListStoppers,
|
||||
@NotNull final AbstractBundle bundle,
|
||||
@NotNull final String errorMessageKey) {
|
||||
parsePackageStatement(builder);
|
||||
|
||||
final Pair<PsiBuilder.Marker, Boolean> impListInfo = parseImportList(builder, importListStoppers);
|
||||
|
||||
+3
-3
@@ -3,10 +3,10 @@ class A {
|
||||
private final int field;
|
||||
private final Object o;
|
||||
private final Runnable runnable;
|
||||
A(int field, Runnable runnable, Object o, String... strs) {
|
||||
this.field = field;<caret>
|
||||
this.runnable = runnable;
|
||||
A(int field, Object o, Runnable runnable, String... strs) {
|
||||
this.field = field;
|
||||
this.o = o;
|
||||
this.runnable = runnable;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -4,9 +4,9 @@ public class A {
|
||||
private final Object o;
|
||||
private final Runnable runnable;
|
||||
|
||||
public A(Runnable runnable, Object o, int field) {
|
||||
this.runnable = runnable;
|
||||
public A(int field, Object o, Runnable runnable) {
|
||||
this.field = field;
|
||||
this.o = o;
|
||||
this.field = field;<caret>
|
||||
this.runnable = runnable;
|
||||
}
|
||||
}
|
||||
|
||||
+34
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2011 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.
|
||||
@@ -13,26 +13,40 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @author max
|
||||
*/
|
||||
package com.intellij.openapi.vfs.newvfs.events;
|
||||
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileSystem;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
/**
|
||||
* @author max
|
||||
*/
|
||||
public class VFileCreateEvent extends VFileEvent {
|
||||
private final VirtualFile myParent;
|
||||
private final boolean myDirectory;
|
||||
private final String myChildName;
|
||||
private final boolean myReCreation;
|
||||
|
||||
public VFileCreateEvent(final Object requestor, final VirtualFile parent, final String childName, boolean isDirectory, boolean isFromRefresh) {
|
||||
public VFileCreateEvent(final Object requestor,
|
||||
final VirtualFile parent,
|
||||
final String childName,
|
||||
final boolean isDirectory,
|
||||
final boolean isFromRefresh) {
|
||||
this(requestor, parent, childName, isDirectory, isFromRefresh, false);
|
||||
}
|
||||
|
||||
public VFileCreateEvent(final Object requestor,
|
||||
final VirtualFile parent,
|
||||
final String childName,
|
||||
final boolean isDirectory,
|
||||
final boolean isFromRefresh,
|
||||
final boolean isReCreation) {
|
||||
super(requestor, isFromRefresh);
|
||||
myChildName = childName;
|
||||
myParent = parent;
|
||||
myDirectory = isDirectory;
|
||||
myReCreation = isReCreation;
|
||||
}
|
||||
|
||||
public String getChildName() {
|
||||
@@ -48,8 +62,10 @@ public class VFileCreateEvent extends VFileEvent {
|
||||
}
|
||||
|
||||
@NonNls
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VfsEvent[create " + (isDirectory() ? "dir " : "file ") + myChildName + " in " + myParent.getUrl() + "]";
|
||||
return "VfsEvent[" + (myReCreation ? "re" : "") + "create " + (myDirectory ? "dir " : "file ") +
|
||||
myChildName + " in " + myParent.getUrl() + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,9 +85,15 @@ public class VFileCreateEvent extends VFileEvent {
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return myParent.isValid() && myParent.findChild(myChildName) == null;
|
||||
if (myParent.isValid()) {
|
||||
final VirtualFile child = myParent.findChild(myChildName);
|
||||
return !myReCreation && child == null || myReCreation && child != null;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
@@ -81,15 +103,17 @@ public class VFileCreateEvent extends VFileEvent {
|
||||
if (myDirectory != event.myDirectory) return false;
|
||||
if (!myChildName.equals(event.myChildName)) return false;
|
||||
if (!myParent.equals(event.myParent)) return false;
|
||||
if (myReCreation != event.myReCreation) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result;
|
||||
result = myParent.hashCode();
|
||||
int result = myParent.hashCode();
|
||||
result = 31 * result + (myDirectory ? 1 : 0);
|
||||
result = 31 * result + myChildName.hashCode();
|
||||
result = 31 * result + (myReCreation ? 1 : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -105,7 +105,9 @@ public class InitialConfigurationDialog extends DialogWrapper {
|
||||
myColorSchemeComboBox.setRenderer(new ListCellRendererWrapper(myColorSchemeComboBox.getRenderer()) {
|
||||
@Override
|
||||
public void customize(JList list, Object value, int index, boolean selected, boolean cellHasFocus) {
|
||||
setText(((EditorColorsScheme)value).getName());
|
||||
if (value != null) {
|
||||
setText(((EditorColorsScheme)value).getName());
|
||||
}
|
||||
}
|
||||
});
|
||||
myColorSchemeComboBox.addActionListener(new ActionListener() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
*
|
||||
@@ -113,9 +114,9 @@ public class ClickNavigator {
|
||||
public static String highlightingTypeFromTokenType(IElementType tokenType, SyntaxHighlighter highlighter) {
|
||||
TextAttributesKey[] highlights = highlighter.getTokenHighlights(tokenType);
|
||||
String s = null;
|
||||
for (TextAttributesKey highlight : highlights) {
|
||||
if (highlight != HighlighterColors.TEXT) {
|
||||
s = highlight.getExternalName();
|
||||
for (int i = highlights.length - 1; i >= 0; i--) {
|
||||
if (highlights[i] != HighlighterColors.TEXT) {
|
||||
s = highlights[i].getExternalName();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+44
-54
@@ -2,7 +2,7 @@
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.application.options.editor.EditorOptionsPanel">
|
||||
<tabbedpane id="97a1e">
|
||||
<constraints>
|
||||
<xy x="22" y="49" width="750" height="639"/>
|
||||
<xy x="22" y="49" width="770" height="654"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
@@ -26,7 +26,7 @@
|
||||
<grid id="8dc1a" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
@@ -44,9 +44,7 @@
|
||||
</component>
|
||||
<component id="34803" class="javax.swing.JCheckBox" binding="myCbEnableDnD">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="328" height="22"/>
|
||||
</grid>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.enable.drag.n.drop.functionality.in.editor"/>
|
||||
@@ -54,9 +52,7 @@
|
||||
</component>
|
||||
<component id="d0105" class="javax.swing.JCheckBox" binding="myCbEnableWheelFontChange">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="328" height="22"/>
|
||||
</grid>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.enable.ctrl.mousewheel.changes.font.size"/>
|
||||
@@ -67,7 +63,7 @@
|
||||
<grid id="5342a" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="2" col-span="1" vsize-policy="0" hsize-policy="0" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="1" row-span="2" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
@@ -77,7 +73,7 @@
|
||||
<children>
|
||||
<component id="400d4" class="javax.swing.JCheckBox" binding="myCbVirtualPageAtBottom">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="7" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="8" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.show.virtual.space.at.file.bottom"/>
|
||||
@@ -85,7 +81,7 @@
|
||||
</component>
|
||||
<component id="f762" class="javax.swing.JCheckBox" binding="myCbCaretInsideTabs">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.allow.placement.of.caret.inside.tabs"/>
|
||||
@@ -93,17 +89,17 @@
|
||||
</component>
|
||||
<component id="bb18b" class="javax.swing.JCheckBox" binding="myCbVirtualSpace">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<selected value="true"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.allow.placement.of.caret.after.end.of.line"/>
|
||||
</properties>
|
||||
</component>
|
||||
<grid id="2a884" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="2a884" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
@@ -117,51 +113,51 @@
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.use.soft.wraps.at.editor"/>
|
||||
</properties>
|
||||
</component>
|
||||
<grid id="ed5fd" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="ed5fd" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="0">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="90205" class="javax.swing.JCheckBox" binding="myCbUseCustomSoftWrapIndent">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<enabled value="false"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.use.custom.soft.wraps.indent"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="4450c" class="javax.swing.JCheckBox" binding="myCbUseSoftWrapsAtConsole">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.use.soft.wraps.at.console"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="e9ebf" class="javax.swing.JTextField" binding="myCustomSoftWrapIndent">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="35" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<enabled value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<component id="e9ebf" class="javax.swing.JTextField" binding="myCustomSoftWrapIndent">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="35" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<enabled value="false"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="c659c" class="javax.swing.JCheckBox" binding="myCbShowAllSoftWraps">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.show.all.softwraps"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="4450c" class="javax.swing.JCheckBox" binding="myCbUseSoftWrapsAtConsole">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.use.soft.wraps.at.console"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
@@ -169,7 +165,7 @@
|
||||
<grid id="54c3d" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
@@ -206,7 +202,7 @@
|
||||
<grid id="dcf48" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
@@ -244,7 +240,7 @@
|
||||
<grid id="7fdc1" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
@@ -254,9 +250,7 @@
|
||||
<children>
|
||||
<component id="498f1" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="247" height="14"/>
|
||||
</grid>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="editbox.maximum.number.of.contents.to.keep.in.clipboard"/>
|
||||
@@ -264,7 +258,7 @@
|
||||
</component>
|
||||
<component id="25b75" class="javax.swing.JTextField" binding="myClipboardContentLimitTextField">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="9" fill="0" indent="0" use-parent-layout="false">
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="4" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="35" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -274,9 +268,7 @@
|
||||
</component>
|
||||
<component id="48bb5" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="247" height="14"/>
|
||||
</grid>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="editbox.recent.files.limit"/>
|
||||
@@ -284,9 +276,7 @@
|
||||
</component>
|
||||
<component id="f8fa5" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="247" height="14"/>
|
||||
</grid>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="editbox.console.history.limit"/>
|
||||
@@ -294,7 +284,7 @@
|
||||
</component>
|
||||
<component id="695ab" class="javax.swing.JTextField" binding="myRecentFilesLimitField">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="35" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -304,7 +294,7 @@
|
||||
</component>
|
||||
<component id="8f324" class="javax.swing.JTextField" binding="myCommandsHistoryLimitField">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="35" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -317,7 +307,7 @@
|
||||
<grid id="358be" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
@@ -346,7 +336,7 @@
|
||||
<grid id="7f3f5" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
@@ -378,7 +368,7 @@
|
||||
</component>
|
||||
<component id="c0a29" class="javax.swing.JCheckBox" binding="myCbRenameLocalVariablesInplace">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.rename.local.variables.inplace"/>
|
||||
|
||||
@@ -72,7 +72,6 @@ import javax.swing.border.Border;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import javax.swing.tree.DefaultTreeModel;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
@@ -160,8 +159,8 @@ public class FileStructurePopup implements Disposable {
|
||||
ElementFilter filter = new FileStructurePopupFilter();
|
||||
final FilteringTreeStructure treeStructure = new FilteringTreeStructure(project, filter, smartTreeStructure);
|
||||
|
||||
final DefaultTreeModel model = new DefaultTreeModel(new DefaultMutableTreeNode(treeStructure.getRootElement()));
|
||||
myTree = new Tree(model);
|
||||
//final DefaultTreeModel model = new DefaultTreeModel(new DefaultMutableTreeNode(treeStructure.getRootElement()));
|
||||
myTree = new Tree(new DefaultMutableTreeNode(treeStructure.getRootElement()));
|
||||
myTree.setRootVisible(false);
|
||||
myTree.setShowsRootHandles(true);
|
||||
|
||||
@@ -183,6 +182,7 @@ public class FileStructurePopup implements Disposable {
|
||||
.setResizable(true)
|
||||
.setFocusable(true)
|
||||
.setMovable(true)
|
||||
.setCancelKeyEnabled(false)
|
||||
.setDimensionServiceKey(null, getDimensionServiceKey(), false)
|
||||
.createPopup();
|
||||
Disposer.register(myPopup, myDisposable);
|
||||
@@ -284,6 +284,16 @@ public class FileStructurePopup implements Disposable {
|
||||
}
|
||||
}.registerCustomShortcutSet(shortcutSet, panel);
|
||||
|
||||
new AnAction() {
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
if (mySpeedSearch != null && mySpeedSearch.isPopupActive()) {
|
||||
mySpeedSearch.hidePopup();
|
||||
} else {
|
||||
myPopup.cancel();
|
||||
}
|
||||
}
|
||||
}.registerCustomShortcutSet(CustomShortcutSet.fromString("ESCAPE"), myTree);
|
||||
|
||||
//myCommanderPanel.setPreferredSize(new Dimension(400, 500));
|
||||
|
||||
addNarrowDownCheckbox(comboPanel);
|
||||
@@ -296,20 +306,36 @@ public class FileStructurePopup implements Disposable {
|
||||
addCheckbox(comboPanel, provider);
|
||||
}
|
||||
|
||||
//myCommanderPanel.setBorder(IdeBorderFactory.createBorder(SideBorder.TOP));
|
||||
panel.add(comboPanel, BorderLayout.NORTH);
|
||||
panel.add(ScrollPaneFactory.createScrollPane(myAbstractTreeBuilder.getTree()), BorderLayout.CENTER);
|
||||
//new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private AbstractTreeNode getSelectedNode() {
|
||||
Object component = myTree.getSelectionPath().getLastPathComponent();
|
||||
if (component instanceof DefaultMutableTreeNode) {
|
||||
component = ((DefaultMutableTreeNode)component).getUserObject();
|
||||
if (component instanceof FilteringTreeStructure.Node) {
|
||||
component = ((FilteringTreeStructure.Node)component).getDelegate();
|
||||
if (component instanceof FilteringTreeStructure.Node) {
|
||||
component = ((FilteringTreeStructure.Node)component).getDelegate();
|
||||
if (component instanceof AbstractTreeNode) {
|
||||
return (AbstractTreeNode)component;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean navigateSelectedElement() {
|
||||
final Ref<Boolean> succeeded = new Ref<Boolean>();
|
||||
final CommandProcessor commandProcessor = CommandProcessor.getInstance();
|
||||
commandProcessor.executeCommand(myProject, new Runnable() {
|
||||
public void run() {
|
||||
final AbstractTreeNode selectedNode = (AbstractTreeNode)myTree.getSelectionPath().getLastPathComponent();
|
||||
final AbstractTreeNode selectedNode = getSelectedNode();
|
||||
if (selectedNode != null) {
|
||||
if (selectedNode.canNavigateToSource()) {
|
||||
selectedNode.navigate(true);
|
||||
@@ -377,6 +403,7 @@ public class FileStructurePopup implements Disposable {
|
||||
}
|
||||
final boolean state = chkFilter.isSelected();
|
||||
myTreeActionsOwner.setActionIncluded(action, action instanceof FileStructureFilter ? !state : state);
|
||||
myAbstractTreeBuilder.refilter(); //todo full update
|
||||
myAbstractTreeBuilder.queueUpdate();
|
||||
if (currentParent != null) {
|
||||
boolean oldNarrowDown = myShouldNarrowDown;
|
||||
|
||||
+1
-1
@@ -318,7 +318,7 @@ public class LayeredLexerEditorHighlighter extends LexerEditorHighlighter {
|
||||
public TextAttributes getAttributes(IElementType tokenType) {
|
||||
TextAttributes attrs = myAttributesMap.get(tokenType);
|
||||
if (attrs == null) {
|
||||
attrs = convertAttributes(SyntaxHighlighterBase.pack(mySyntaxHighlighter.getTokenHighlights(tokenType), myBackground));
|
||||
attrs = convertAttributes(SyntaxHighlighterBase.pack(myBackground, mySyntaxHighlighter.getTokenHighlights(tokenType)));
|
||||
myAttributesMap.put(tokenType, attrs);
|
||||
}
|
||||
return attrs;
|
||||
|
||||
+5
-1
@@ -38,7 +38,11 @@ public class ChangesBrowserModuleNode extends ChangesBrowserNode<Module> {
|
||||
|
||||
renderer.append(module.isDisposed() ? "" : module.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
|
||||
appendCount(renderer);
|
||||
renderer.setIcon(ModuleType.get(module).getNodeIcon(expanded));
|
||||
if (module.isDisposed()) {
|
||||
renderer.setIcon(ModuleType.EMPTY.getNodeIcon(expanded));
|
||||
} else {
|
||||
renderer.setIcon(ModuleType.get(module).getNodeIcon(expanded));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -302,14 +302,14 @@ public class ToolEditorDialog extends DialogWrapper {
|
||||
constr.gridy = 2;
|
||||
constr.insets = new Insets(5, 0, 0, 0);
|
||||
constr.fill = GridBagConstraints.HORIZONTAL;
|
||||
constr.anchor = GridBagConstraints.WEST;
|
||||
constr.anchor = GridBagConstraints.BASELINE_LEADING;
|
||||
myInsertWorkingDirectoryMacroButton = new JButton(ToolsBundle.message("tools.insert.macro.button.c"));
|
||||
pane.add(myInsertWorkingDirectoryMacroButton, constr);
|
||||
|
||||
// for normal resizing
|
||||
constr = new GridBagConstraints();
|
||||
constr.gridy = 3;
|
||||
constr.fill = GridBagConstraints.VERTICAL;
|
||||
constr.fill = GridBagConstraints.BASELINE_LEADING;
|
||||
constr.weighty = 1.0;
|
||||
pane.add(new JLabel(), constr);
|
||||
|
||||
|
||||
@@ -88,6 +88,14 @@ public class JBScrollPane extends JScrollPane {
|
||||
return new MyScrollBar(JScrollBar.HORIZONTAL);
|
||||
}
|
||||
|
||||
public boolean isHaveBorder() {
|
||||
return getBorder() != null;
|
||||
}
|
||||
|
||||
public void setHaveBorder(boolean haveBorder) {
|
||||
setBorder(haveBorder ? IdeBorderFactory.createBorder() : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JViewport createViewport() {
|
||||
return new JBViewport();
|
||||
|
||||
@@ -101,10 +101,15 @@ public class PathUtil {
|
||||
|
||||
@NotNull
|
||||
public static String suggestFileName(@NotNull String text) {
|
||||
return suggestFileName(text, false, false);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String suggestFileName(@NotNull String text, final boolean allowDots, final boolean allowSpaces) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
char c = text.charAt(i);
|
||||
if (!isValidFileNameChar(c) || c == '.' || Character.isWhitespace(c)) {
|
||||
if (!isValidFileNameChar(c) || (!allowDots && c == '.') || (!allowSpaces && Character.isWhitespace(c))) {
|
||||
result.append('_');
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -18,12 +18,14 @@ package com.intellij.ide.impl;
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.ide.GeneralSettings;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.ide.highlighter.InternalFileType;
|
||||
import com.intellij.ide.highlighter.ProjectFileType;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.components.StorageScheme;
|
||||
import com.intellij.openapi.components.impl.stores.IProjectStore;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.project.ex.ProjectEx;
|
||||
@@ -262,4 +264,8 @@ public class ProjectUtil {
|
||||
IdeFocusManager.getInstance(p).requestFocus(cmd, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isProjectOrWorkspaceFile(final VirtualFile file) {
|
||||
return com.intellij.openapi.project.ProjectUtil.isProjectOrWorkspaceFile(file);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ public class InstalledPluginsManagerMain extends PluginManagerMain {
|
||||
Messages.showErrorDialog("Fail to load plugin descriptor from file " + file.getName(), CommonBundle.getErrorTitle());
|
||||
return;
|
||||
}
|
||||
PluginDownloader.install(file, file.getName());
|
||||
PluginDownloader.install(file, file.getName(), false);
|
||||
((InstalledPluginsTableModel)pluginsModel).appendOrUpdateDescriptor(pluginDescriptor);
|
||||
select(pluginDescriptor);
|
||||
setRequireShutdown(true);
|
||||
|
||||
@@ -185,7 +185,7 @@ public class InstalledPluginsTableModel extends PluginTableModel {
|
||||
}
|
||||
}
|
||||
);
|
||||
if (enabled == null && !myDependentToRequiredListMap.containsKey(pluginId)) {
|
||||
if (enabled == null && !myDependentToRequiredListMap.containsKey(pluginId) && !PluginManager.isIncompatible(descriptor)) {
|
||||
myEnabled.put(pluginId, true);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -78,8 +78,7 @@ public class BasicSentUsagesPersistenceComponent extends SentUsagesPersistence {
|
||||
|
||||
|
||||
@NotNull
|
||||
public Map<GroupDescriptor, Set<UsageDescriptor>> getSentUsages
|
||||
() {
|
||||
public Map<GroupDescriptor, Set<UsageDescriptor>> getSentUsages () {
|
||||
return mySentDescriptors;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -79,7 +79,11 @@ public class UsageStatisticsPersistenceComponent extends BasicSentUsagesPersiste
|
||||
|
||||
String valueData = groupElement.getAttributeValue(DATA_ATTR);
|
||||
if (!StringUtil.isEmptyOrSpaces(groupId) && !StringUtil.isEmptyOrSpaces(valueData)) {
|
||||
getSentUsages().putAll(ConvertUsagesUtil.convertValueString(GroupDescriptor.create(groupId, groupPriority), valueData));
|
||||
try {
|
||||
getSentUsages().putAll(ConvertUsagesUtil.convertValueString(GroupDescriptor.create(groupId, groupPriority), valueData));
|
||||
} catch (AssertionError e) {
|
||||
//don't load incorrect groups
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+37
-1
@@ -30,10 +30,16 @@ import com.intellij.openapi.fileTypes.FileTypes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectUtil;
|
||||
import com.intellij.openapi.project.ex.ProjectManagerEx;
|
||||
import com.intellij.openapi.util.EmptyRunnable;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.projectImport.ProjectOpenProcessor;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public interface MergeVersion {
|
||||
Document createWorkingDocument(Project project);
|
||||
@@ -91,13 +97,38 @@ public interface MergeVersion {
|
||||
|
||||
FileDocumentManager.getInstance().saveDocument(myDocument);
|
||||
final VirtualFile file = getFile();
|
||||
reportProjectFileChangeIfNeeded(project, file);
|
||||
}
|
||||
|
||||
public static void reportProjectFileChangeIfNeeded(Project project, VirtualFile file) {
|
||||
if (file != null) {
|
||||
if (ProjectUtil.isProjectOrWorkspaceFile(file)) {
|
||||
if (ProjectUtil.isProjectOrWorkspaceFile(file) || isProjectFile(file)) {
|
||||
ProjectManagerEx.getInstanceEx().saveChangedProjectFile(file, project);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Runnable prepareToReportChangedProjectFiles(final Project project, final Collection<VirtualFile> files) {
|
||||
final Set<VirtualFile> vfs = new HashSet<VirtualFile>();
|
||||
for (VirtualFile vf : files) {
|
||||
if (vf != null) {
|
||||
if (ProjectUtil.isProjectOrWorkspaceFile(vf) || isProjectFile(vf)) {
|
||||
vfs.add(vf);
|
||||
}
|
||||
}
|
||||
}
|
||||
return vfs.isEmpty() ? null : new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ProjectManagerEx ex = ProjectManagerEx.getInstanceEx();
|
||||
for (VirtualFile vf : vfs) {
|
||||
ex.saveChangedProjectFile(vf, project);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreOriginalContent(final Project project) {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@@ -107,6 +138,11 @@ public interface MergeVersion {
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isProjectFile(VirtualFile file) {
|
||||
final ProjectOpenProcessor importProvider = ProjectOpenProcessor.getImportProvider(file);
|
||||
return importProvider != null && importProvider.lookForProjectsInDirectory();
|
||||
}
|
||||
|
||||
protected void doRestoreOriginalContent(Project project) {
|
||||
setDocumentText(myDocument, myTextBeforeMerge, "", project);
|
||||
}
|
||||
|
||||
+8
-2
@@ -185,6 +185,10 @@ public class PluginDownloader {
|
||||
}
|
||||
|
||||
public static void install(final File fromFile, final String pluginName) throws IOException {
|
||||
install(fromFile, pluginName, true);
|
||||
}
|
||||
|
||||
public static void install(final File fromFile, final String pluginName, boolean deleteFromFile) throws IOException {
|
||||
//noinspection HardCodedStringLiteral
|
||||
if (fromFile.getName().endsWith(".jar")) {
|
||||
// add command to copy file to the IDEA/plugins path
|
||||
@@ -207,8 +211,10 @@ public class PluginDownloader {
|
||||
}
|
||||
|
||||
// add command to remove temp plugin file
|
||||
StartupActionScriptManager.ActionCommand deleteTemp = new StartupActionScriptManager.DeleteCommand(fromFile);
|
||||
StartupActionScriptManager.addActionCommand(deleteTemp);
|
||||
if (deleteFromFile) {
|
||||
StartupActionScriptManager.ActionCommand deleteTemp = new StartupActionScriptManager.DeleteCommand(fromFile);
|
||||
StartupActionScriptManager.addActionCommand(deleteTemp);
|
||||
}
|
||||
}
|
||||
|
||||
private File downloadPlugin(final ProgressIndicator pi) throws IOException {
|
||||
|
||||
@@ -1,120 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.openapi.vfs.impl.local;
|
||||
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileSystem;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
public class VirtualFileImpl extends VirtualFile {
|
||||
@SuppressWarnings({"WeakerAccess"}) public long myTimeStamp = -1; // -1, if file content has not been requested yet
|
||||
|
||||
@SuppressWarnings({"WeakerAccess"})
|
||||
public void cacheIsWritableInitialized() {
|
||||
}
|
||||
|
||||
//do not delete or rename or change visibility without correcting native code
|
||||
@SuppressWarnings({"WeakerAccess"})
|
||||
public void cacheIsWritable(final boolean canWrite) {
|
||||
}
|
||||
|
||||
//do not delete or rename or change visibility without correcting native code
|
||||
@SuppressWarnings({"WeakerAccess"})
|
||||
public void cacheIsDirectory(final boolean isDirectory) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public byte[] contentsToByteArray() throws IOException {
|
||||
throw new UnsupportedOperationException("contentsToByteArray is not implemented"); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public VirtualFile[] getChildren() {
|
||||
throw new UnsupportedOperationException("getChildren is not implemented"); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public VirtualFileSystem getFileSystem() {
|
||||
throw new UnsupportedOperationException("getFileSystem is not implemented"); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getInputStream() throws IOException {
|
||||
throw new UnsupportedOperationException("getInputStream is not implemented"); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getLength() {
|
||||
throw new UnsupportedOperationException("getLength is not implemented"); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
@NonNls
|
||||
public String getName() {
|
||||
throw new UnsupportedOperationException("getName is not implemented"); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public OutputStream getOutputStream(final Object requestor, final long newModificationStamp, final long newTimeStamp) throws IOException {
|
||||
throw new UnsupportedOperationException("getOutputStream is not implemented"); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public VirtualFile getParent() {
|
||||
throw new UnsupportedOperationException("getParent is not implemented"); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath() {
|
||||
throw new UnsupportedOperationException("getPath is not implemented"); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTimeStamp() {
|
||||
throw new UnsupportedOperationException("getTimeStamp is not implemented"); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDirectory() {
|
||||
throw new UnsupportedOperationException("isDirectory is not implemented"); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
throw new UnsupportedOperationException("isValid is not implemented"); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWritable() {
|
||||
throw new UnsupportedOperationException("isWritable is not implemented"); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh(final boolean asynchronous, final boolean recursive, final Runnable postRunnable) {
|
||||
throw new UnsupportedOperationException("refresh is not implemented"); // TODO
|
||||
}
|
||||
}
|
||||
+47
-35
@@ -13,12 +13,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @author max
|
||||
*/
|
||||
package com.intellij.openapi.vfs.newvfs.persistent;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.application.ex.ApplicationEx;
|
||||
@@ -45,6 +42,7 @@ import com.intellij.util.containers.StripedLockIntObjectConcurrentHashMap;
|
||||
import com.intellij.util.io.DupOutputStream;
|
||||
import com.intellij.util.io.ReplicatorInputStream;
|
||||
import com.intellij.util.messages.MessageBus;
|
||||
import gnu.trove.TIntHashSet;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -53,6 +51,9 @@ import java.io.*;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/**
|
||||
* @author max
|
||||
*/
|
||||
public class PersistentFS extends ManagingFS implements ApplicationComponent {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vfs.newvfs.persistent.PersistentFS");
|
||||
|
||||
@@ -638,48 +639,58 @@ public class PersistentFS extends ManagingFS implements ApplicationComponent {
|
||||
processEvents(Collections.singletonList(event));
|
||||
}
|
||||
|
||||
private static final Comparator<VFileDeleteEvent> DEPTH_COMPARATOR = new Comparator<VFileDeleteEvent>() {
|
||||
private static class EventWrapper {
|
||||
private final VFileDeleteEvent event;
|
||||
private final int id;
|
||||
|
||||
private EventWrapper(final VFileDeleteEvent event, final int id) {
|
||||
this.event = event;
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
private static final Comparator<EventWrapper> DEPTH_COMPARATOR = new Comparator<EventWrapper>() {
|
||||
@Override
|
||||
public int compare(final VFileDeleteEvent o1, final VFileDeleteEvent o2) {
|
||||
return o1.getFileDepth() - o2.getFileDepth();
|
||||
public int compare(final EventWrapper o1, final EventWrapper o2) {
|
||||
return o1.event.getFileDepth() - o2.event.getFileDepth();
|
||||
}
|
||||
};
|
||||
|
||||
private static List<? extends VFileEvent> validateEvents(List<? extends VFileEvent> events) {
|
||||
List<VFileEvent> filtered = new ArrayList<VFileEvent>(events.size());
|
||||
List<VFileDeleteEvent> deletionList = new ArrayList<VFileDeleteEvent>();
|
||||
|
||||
for (VFileEvent event : events) {
|
||||
if (event.isValid()) {
|
||||
if (event instanceof VFileDeleteEvent) {
|
||||
deletionList.add((VFileDeleteEvent)event);
|
||||
}
|
||||
else {
|
||||
filtered.add(event);
|
||||
}
|
||||
private static List<? extends VFileEvent> validateEvents(final List<? extends VFileEvent> events) {
|
||||
final List<EventWrapper> deletionEvents = Lists.newArrayList();
|
||||
for (int i = 0, size = events.size(); i < size; i++) {
|
||||
final VFileEvent event = events.get(i);
|
||||
if (event instanceof VFileDeleteEvent && event.isValid()) {
|
||||
deletionEvents.add(new EventWrapper((VFileDeleteEvent)event, i));
|
||||
}
|
||||
}
|
||||
|
||||
ContainerUtil.quickSort(deletionList, DEPTH_COMPARATOR);
|
||||
List<VirtualFile> filesToBeDeleted = new ArrayList<VirtualFile>();
|
||||
for (VFileDeleteEvent event : deletionList) {
|
||||
boolean ok = true;
|
||||
VirtualFile candidate = event.getFile();
|
||||
for (VirtualFile file : filesToBeDeleted) {
|
||||
ContainerUtil.quickSort(deletionEvents, DEPTH_COMPARATOR);
|
||||
|
||||
final TIntHashSet invalidIDs = new TIntHashSet(deletionEvents.size());
|
||||
final List<VirtualFile> dirsToBeDeleted = new ArrayList<VirtualFile>();
|
||||
nextEvent:
|
||||
for (EventWrapper wrapper : deletionEvents) {
|
||||
final VirtualFile candidate = wrapper.event.getFile();
|
||||
for (VirtualFile file : dirsToBeDeleted) {
|
||||
if (VfsUtilCore.isAncestor(file, candidate, false)) {
|
||||
ok = false;
|
||||
break;
|
||||
invalidIDs.add(wrapper.id);
|
||||
continue nextEvent;
|
||||
}
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
filtered.add(event);
|
||||
if (candidate.isDirectory()) {
|
||||
filesToBeDeleted.add(candidate);
|
||||
}
|
||||
if (candidate.isDirectory()) {
|
||||
dirsToBeDeleted.add(candidate);
|
||||
}
|
||||
}
|
||||
|
||||
final List<VFileEvent> filtered = Lists.newArrayListWithCapacity(events.size() - invalidIDs.size());
|
||||
for (int i = 0, size = events.size(); i < size; i++) {
|
||||
final VFileEvent event = events.get(i);
|
||||
if (event.isValid() && !(event instanceof VFileDeleteEvent && invalidIDs.contains(i))) {
|
||||
filtered.add(event);
|
||||
}
|
||||
}
|
||||
return filtered;
|
||||
}
|
||||
|
||||
@@ -829,6 +840,7 @@ public class PersistentFS extends ManagingFS implements ApplicationComponent {
|
||||
return _findFileById(id, true);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private NewVirtualFile _findFileById(int id, final boolean cachedOnly) {
|
||||
final NewVirtualFile cached = myIdToDirCache.get(id);
|
||||
if (cached != null) {
|
||||
@@ -951,9 +963,9 @@ public class PersistentFS extends ManagingFS implements ApplicationComponent {
|
||||
}
|
||||
|
||||
private static void appendIdToParentList(final int parentId, final int childId) {
|
||||
int[] childrenlist = FSRecords.list(parentId);
|
||||
childrenlist = ArrayUtil.append(childrenlist, childId);
|
||||
FSRecords.updateList(parentId, childrenlist);
|
||||
int[] childrenList = FSRecords.list(parentId);
|
||||
childrenList = ArrayUtil.append(childrenList, childId);
|
||||
FSRecords.updateList(parentId, childrenList);
|
||||
}
|
||||
|
||||
private void executeDelete(final VirtualFile file) {
|
||||
|
||||
+14
-7
@@ -13,10 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @author max
|
||||
*/
|
||||
package com.intellij.openapi.vfs.newvfs.persistent;
|
||||
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
@@ -32,6 +28,9 @@ import com.intellij.util.containers.Queue;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author max
|
||||
*/
|
||||
public class RefreshWorker {
|
||||
private final VirtualFile myRefreshRoot;
|
||||
private final boolean myIsRecursive;
|
||||
@@ -135,10 +134,14 @@ public class RefreshWorker {
|
||||
|
||||
private void scheduleChildRefresh(final VirtualFileSystemEntry file, final VirtualFile child, final NewVirtualFileSystem delegate) {
|
||||
final boolean currentIsDirectory = child.isDirectory();
|
||||
final boolean currentIsSymlink = child.isSymLink();
|
||||
final boolean currentIsSpecial = child.isSpecialFile();
|
||||
final boolean upToDateIsDirectory = delegate.isDirectory(child);
|
||||
if (currentIsDirectory != upToDateIsDirectory) {
|
||||
final boolean upToDateIsSymlink = delegate.isSymLink(child);
|
||||
final boolean upToDateIsSpecial = delegate.isSpecialFile(child);
|
||||
if (currentIsDirectory != upToDateIsDirectory || currentIsSymlink != upToDateIsSymlink || currentIsSpecial != upToDateIsSpecial) {
|
||||
scheduleDeletion(child);
|
||||
scheduleCreation(file, child.getName(), upToDateIsDirectory);
|
||||
scheduleReCreation(file, child.getName(), upToDateIsDirectory);
|
||||
}
|
||||
else if (myIsRecursive || !currentIsDirectory) {
|
||||
myRefreshQueue.addLast(child);
|
||||
@@ -156,7 +159,11 @@ public class RefreshWorker {
|
||||
}
|
||||
|
||||
private void scheduleCreation(final VirtualFileSystemEntry parent, final String childName, final boolean isDirectory) {
|
||||
myEvents.add(new VFileCreateEvent(null, parent, childName, isDirectory, true));
|
||||
myEvents.add(new VFileCreateEvent(null, parent, childName, isDirectory, true, false));
|
||||
}
|
||||
|
||||
private void scheduleReCreation(final VirtualFileSystemEntry parent, final String childName, final boolean isDirectory) {
|
||||
myEvents.add(new VFileCreateEvent(null, parent, childName, isDirectory, true, true));
|
||||
}
|
||||
|
||||
private void scheduleDeletion(final VirtualFile file) {
|
||||
|
||||
@@ -270,6 +270,10 @@ public abstract class SpeedSearchBase<Comp extends JComponent> extends SpeedSear
|
||||
return null;
|
||||
}
|
||||
|
||||
public void hidePopup() {
|
||||
manageSearchPopup(null);
|
||||
}
|
||||
|
||||
private void processKeyEvent(KeyEvent e) {
|
||||
if (e.isAltDown()) return;
|
||||
if (mySearchPopup != null) {
|
||||
@@ -462,7 +466,7 @@ public abstract class SpeedSearchBase<Comp extends JComponent> extends SpeedSear
|
||||
return keyCode == KeyEvent.VK_HOME || keyCode == KeyEvent.VK_END || keyCode == KeyEvent.VK_UP || keyCode == KeyEvent.VK_DOWN;
|
||||
}
|
||||
|
||||
private void manageSearchPopup(SearchPopup searchPopup) {
|
||||
private void manageSearchPopup(@Nullable SearchPopup searchPopup) {
|
||||
final Project project;
|
||||
if (ApplicationManager.getApplication() != null && !ApplicationManager.getApplication().isDisposed()) {
|
||||
project = PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(myComponent));
|
||||
|
||||
@@ -34,9 +34,9 @@ tools.parameters.label=Parameters:
|
||||
tools.insert.macro.button.a=Insert m&acro...
|
||||
tools.working.directory.label=Working directory:
|
||||
tools.insert.macro.button.c=Insert ma&cro...
|
||||
tools.menu.group=Menu
|
||||
tools.menu.group=Show In
|
||||
tools.options.group=Options
|
||||
tools.tool.group=Tool Options
|
||||
tools.tool.group=Tool Settings
|
||||
tools.settings=Tools
|
||||
tools.completed.message=External tool ''{0}'' completed with exit code {1}
|
||||
tools.add.button=&Add...
|
||||
|
||||
+51
-17
@@ -15,27 +15,22 @@
|
||||
*/
|
||||
package com.intellij.openapi.vfs.local;
|
||||
|
||||
import com.intellij.execution.ExecutionException;
|
||||
import com.intellij.execution.configurations.GeneralCommandLine;
|
||||
import com.intellij.openapi.application.AccessToken;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.testFramework.LightPlatformTestCase;
|
||||
import com.intellij.testFramework.PlatformTestCase;
|
||||
import com.intellij.testFramework.LightPlatformLangTestCase;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class SymLinkHandlingTest extends LightPlatformTestCase {
|
||||
public class SymLinkHandlingTest extends LightPlatformLangTestCase {
|
||||
private LocalFileSystem myFileSystem;
|
||||
|
||||
@SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
|
||||
public SymLinkHandlingTest() {
|
||||
PlatformTestCase.initPlatformLangPrefix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
@@ -135,25 +130,64 @@ public class SymLinkHandlingTest extends LightPlatformTestCase {
|
||||
assertTrue(childFile.exists());
|
||||
}
|
||||
|
||||
public void testTransGenderRefresh() throws Exception {
|
||||
if (!SystemInfo.areSymLinksSupported) return;
|
||||
|
||||
final File targetFile = FileUtil.createTempFile("target", "");
|
||||
final File targetDir = FileUtil.createTempDirectory("targetDir", "");
|
||||
|
||||
// file link
|
||||
File link = createTempLink(targetFile.getAbsolutePath(), "link");
|
||||
VirtualFile vFile1 = refreshAndFind(link);
|
||||
assertTrue("link=" + link + ", vLink=" + vFile1,
|
||||
vFile1 != null && !vFile1.isDirectory() && vFile1.isSymLink());
|
||||
|
||||
// file link => dir
|
||||
assertTrue(link.getAbsolutePath(), link.delete() && link.mkdir() && link.isDirectory());
|
||||
VirtualFile vFile2 = refreshAndFind(link);
|
||||
assertTrue("link=" + link + ", vLink=" + vFile2,
|
||||
!vFile1.isValid() && vFile2 != null && vFile2.isDirectory() && !vFile2.isSymLink());
|
||||
|
||||
// dir => dir link
|
||||
assertTrue(link.getAbsolutePath(), link.delete());
|
||||
link = createTempLink(targetDir.getAbsolutePath(), "link");
|
||||
vFile1 = refreshAndFind(link);
|
||||
assertTrue("link=" + link + ", vLink=" + vFile1,
|
||||
!vFile2.isValid() && vFile1 != null && vFile1.isDirectory() && vFile1.isSymLink());
|
||||
|
||||
// dir link => file
|
||||
assertTrue(link.getAbsolutePath(), link.delete() && link.createNewFile() && link.isFile());
|
||||
vFile2 = refreshAndFind(link);
|
||||
assertTrue("link=" + link + ", vLink=" + vFile1,
|
||||
!vFile1.isValid() && vFile2 != null && !vFile2.isDirectory() && !vFile2.isSymLink());
|
||||
|
||||
// file => file link
|
||||
assertTrue(link.getAbsolutePath(), link.delete());
|
||||
link = createTempLink(targetFile.getAbsolutePath(), "link");
|
||||
vFile1 = refreshAndFind(link);
|
||||
assertTrue("link=" + link + ", vLink=" + vFile1,
|
||||
!vFile2.isValid() && vFile1 != null && !vFile1.isDirectory() && vFile1.isSymLink());
|
||||
}
|
||||
|
||||
// todo[r.sh] use NIO2 API after migration to JDK 7
|
||||
private static File createTempLink(final String target, final String link) throws IOException, InterruptedException {
|
||||
private static File createTempLink(final String target, final String link) throws InterruptedException, ExecutionException {
|
||||
final File linkFile = new File(FileUtil.getTempDirectory(), link);
|
||||
assertTrue(link, !linkFile.exists() || linkFile.delete());
|
||||
final File parentDir = linkFile.getParentFile();
|
||||
assertTrue("link=" + link + ", parent=" + parentDir, parentDir != null && (parentDir.isDirectory() || parentDir.mkdirs()));
|
||||
|
||||
final ProcessBuilder builder;
|
||||
final GeneralCommandLine commandLine;
|
||||
if (SystemInfo.isWindows) {
|
||||
builder = new File(target).isDirectory()
|
||||
? new ProcessBuilder("cmd", "/C", "mklink", "/D", linkFile.getAbsolutePath(), target)
|
||||
: new ProcessBuilder("cmd", "/C", "mklink", linkFile.getAbsolutePath(), target);
|
||||
commandLine = new File(target).isDirectory()
|
||||
? new GeneralCommandLine("cmd", "/C", "mklink", "/D", linkFile.getAbsolutePath(), target)
|
||||
: new GeneralCommandLine("cmd", "/C", "mklink", linkFile.getAbsolutePath(), target);
|
||||
}
|
||||
else {
|
||||
builder = new ProcessBuilder("ln", "-s", target, linkFile.getAbsolutePath());
|
||||
commandLine = new GeneralCommandLine("ln", "-s", target, linkFile.getAbsolutePath());
|
||||
}
|
||||
final Process process = builder.start();
|
||||
final Process process = commandLine.createProcess();
|
||||
final int res = process.waitFor();
|
||||
assertTrue(builder.command() + ": " + res, res == 0);
|
||||
assertTrue(commandLine.getCommandLineString() + ": " + res, res == 0);
|
||||
final File targetFile = new File(target);
|
||||
assertEquals("target=" + target + ", link=" + linkFile, targetFile.exists(), linkFile.exists());
|
||||
return linkFile;
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2000-2011 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;
|
||||
|
||||
import com.intellij.util.containers.ConcurrentHashMap;
|
||||
@@ -27,33 +42,31 @@ import java.util.ResourceBundle;
|
||||
* @author Denis Zhdanov
|
||||
* @since 8/1/11 2:37 PM
|
||||
*/
|
||||
public class AbstractBundle {
|
||||
|
||||
@NonNls
|
||||
private final String myPathToBundle;
|
||||
public abstract class AbstractBundle {
|
||||
@NonNls private final String myPathToBundle;
|
||||
|
||||
protected AbstractBundle(@NonNls @NotNull String pathToBundle) {
|
||||
myPathToBundle = pathToBundle;
|
||||
}
|
||||
|
||||
public String getMessage(String key, Object... params) {
|
||||
public String getMessage(@NotNull String key, Object... params) {
|
||||
return CommonBundle.message(getBundle(), key, params);
|
||||
}
|
||||
|
||||
private ResourceBundle getBundle() {
|
||||
return getResourceBundle(myPathToBundle, getClass().getClassLoader());
|
||||
}
|
||||
|
||||
@SuppressWarnings("MismatchedQueryAndUpdateOfCollection")
|
||||
private static FactoryMap<ClassLoader, ConcurrentHashMap<String, SoftReference<ResourceBundle>>> ourCache =
|
||||
new ConcurrentWeakFactoryMap<ClassLoader, ConcurrentHashMap<String, SoftReference<ResourceBundle>>>() {
|
||||
@Override
|
||||
protected ConcurrentHashMap<String, SoftReference<ResourceBundle>> create(ClassLoader key) {
|
||||
return new ConcurrentHashMap<String, SoftReference<ResourceBundle>>();
|
||||
}
|
||||
};
|
||||
|
||||
public static ResourceBundle getResourceBundle(String pathToBundle, ClassLoader loader) {
|
||||
@SuppressWarnings("MismatchedQueryAndUpdateOfCollection")
|
||||
private static final FactoryMap<ClassLoader, ConcurrentHashMap<String, SoftReference<ResourceBundle>>> ourCache =
|
||||
new ConcurrentWeakFactoryMap<ClassLoader, ConcurrentHashMap<String, SoftReference<ResourceBundle>>>() {
|
||||
@Override
|
||||
protected ConcurrentHashMap<String, SoftReference<ResourceBundle>> create(ClassLoader key) {
|
||||
return new ConcurrentHashMap<String, SoftReference<ResourceBundle>>();
|
||||
}
|
||||
};
|
||||
|
||||
public static ResourceBundle getResourceBundle(@NotNull String pathToBundle, @NotNull ClassLoader loader) {
|
||||
ConcurrentHashMap<String, SoftReference<ResourceBundle>> map = ourCache.get(loader);
|
||||
SoftReference<ResourceBundle> reference = map.get(pathToBundle);
|
||||
ResourceBundle result = reference == null ? null : reference.get();
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ public class VcsContentAnnotationImpl implements VcsContentAnnotation {
|
||||
public boolean intervalRecentlyChanged(VirtualFile file, TextRange lineInterval, VcsRevisionNumber currentRevisionNumber) {
|
||||
final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject);
|
||||
final AbstractVcs vcs = vcsManager.getVcsFor(file);
|
||||
if (vcs == null) return false;
|
||||
if (vcs == null || vcs.getDiffProvider() == null) return false;
|
||||
if (currentRevisionNumber == null) {
|
||||
currentRevisionNumber = vcs.getDiffProvider().getCurrentRevision(file);
|
||||
assert currentRevisionNumber != null;
|
||||
|
||||
@@ -58,6 +58,7 @@ public class ContentRevisionCache {
|
||||
}
|
||||
|
||||
private void put(FilePath path, VcsRevisionNumber number, @NotNull VcsKey vcsKey, @NotNull UniqueType type, final byte[] bytes) {
|
||||
if (bytes == null) return;
|
||||
synchronized (myLock) {
|
||||
myCache.put(new Key(path, number, vcsKey, type), bytes);
|
||||
}
|
||||
|
||||
+29
-6
@@ -18,6 +18,7 @@ package com.intellij.openapi.diff.impl.patch.formove;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.diff.impl.mergeTool.MergeVersion;
|
||||
import com.intellij.openapi.diff.impl.patch.ApplyPatchContext;
|
||||
import com.intellij.openapi.diff.impl.patch.ApplyPatchStatus;
|
||||
import com.intellij.openapi.diff.impl.patch.FilePatch;
|
||||
@@ -33,10 +34,7 @@ import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vcs.FilePathImpl;
|
||||
import com.intellij.openapi.vcs.VcsBundle;
|
||||
import com.intellij.openapi.vcs.VcsFileListenerContextHelper;
|
||||
import com.intellij.openapi.vcs.*;
|
||||
import com.intellij.openapi.vcs.changes.*;
|
||||
import com.intellij.openapi.vcs.changes.patch.ApplyPatchAction;
|
||||
import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier;
|
||||
@@ -45,12 +43,14 @@ import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.newvfs.RefreshQueue;
|
||||
import com.intellij.openapi.vfs.newvfs.RefreshSession;
|
||||
import com.intellij.ui.GuiUtils;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.WaitForProgressToShow;
|
||||
import com.intellij.util.continuation.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
@@ -289,7 +289,7 @@ public class PatchApplier<BinaryType extends FilePatch> {
|
||||
}
|
||||
}
|
||||
|
||||
protected void refreshFiles(final Collection<FilePath> additionalDirectly, @Nullable final ContinuationPause context) {
|
||||
protected void refreshFiles(final Collection<FilePath> additionalDirectly, @Nullable final ContinuationContext context) {
|
||||
final List<FilePath> directlyAffected = myVerifier.getDirectlyAffected();
|
||||
final List<VirtualFile> indirectlyAffected = myVerifier.getAllAffected();
|
||||
directlyAffected.addAll(additionalDirectly);
|
||||
@@ -305,11 +305,32 @@ public class PatchApplier<BinaryType extends FilePatch> {
|
||||
return myVerifier.getAllAffected();
|
||||
}
|
||||
|
||||
public static void refreshPassedFilesAndMoveToChangelist(final Project project, final ContinuationPause context,
|
||||
public static void refreshPassedFilesAndMoveToChangelist(final Project project, final ContinuationContext context,
|
||||
final Collection<FilePath> directlyAffected, final Collection<VirtualFile> indirectlyAffected, final Consumer<Collection<FilePath>> targetChangelistMover) {
|
||||
if (context != null) {
|
||||
context.suspend();
|
||||
}
|
||||
|
||||
final Runnable projectFilesReload =
|
||||
MergeVersion.MergeDocumentVersion.prepareToReportChangedProjectFiles(project, ObjectsConvertor.fp2vf(directlyAffected));
|
||||
final TaskDescriptor projectFilesReloadTaskDescriptor = projectFilesReload == null ? null : new TaskDescriptor("", Where.AWT) {
|
||||
@Override
|
||||
public void run(final ContinuationContext context) {
|
||||
projectFilesReload.run();
|
||||
}
|
||||
};
|
||||
final Runnable scheduleProjectFilesReload = new Runnable() {
|
||||
public void run() {
|
||||
if (projectFilesReloadTaskDescriptor != null) {
|
||||
if (context != null) {
|
||||
context.last(projectFilesReloadTaskDescriptor);
|
||||
} else {
|
||||
SwingUtilities.invokeLater(projectFilesReload);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
final RefreshSession session = RefreshQueue.getInstance().createSession(false, true, new Runnable() {
|
||||
public void run() {
|
||||
if (project.isDisposed()) return;
|
||||
@@ -322,6 +343,7 @@ public class PatchApplier<BinaryType extends FilePatch> {
|
||||
if (targetChangelistMover != null) {
|
||||
targetChangelistMover.consume(directlyAffected);
|
||||
}
|
||||
scheduleProjectFilesReload.run();
|
||||
if (context != null) {
|
||||
context.ping();
|
||||
}
|
||||
@@ -338,6 +360,7 @@ public class PatchApplier<BinaryType extends FilePatch> {
|
||||
final VcsDirtyScopeManager vcsDirtyScopeManager = VcsDirtyScopeManager.getInstance(project);
|
||||
// will schedule update
|
||||
vcsDirtyScopeManager.filePathsDirty(directlyAffected, null);
|
||||
scheduleProjectFilesReload.run();
|
||||
if (context != null) {
|
||||
context.ping();
|
||||
}
|
||||
|
||||
+3
-3
@@ -369,7 +369,7 @@ public class ShelveChangesManager implements ProjectComponent, JDOMExternalizabl
|
||||
final boolean silentAddDelete) {
|
||||
context.next(new TaskDescriptor("", Where.AWT) {
|
||||
@Override
|
||||
public void run(ContinuationContext context) {
|
||||
public void run(ContinuationContext contextInner) {
|
||||
final List<FilePatch> remainingPatches = new ArrayList<FilePatch>();
|
||||
|
||||
final CommitContext commitContext = new CommitContext();
|
||||
@@ -402,7 +402,7 @@ public class ShelveChangesManager implements ProjectComponent, JDOMExternalizabl
|
||||
patches, targetChangeList, binaryPatchApplier, commitContext);
|
||||
|
||||
// after patch applier part
|
||||
context.next(new TaskDescriptor("", Where.AWT) {
|
||||
contextInner.next(new TaskDescriptor("", Where.AWT) {
|
||||
@Override
|
||||
public void run(ContinuationContext context) {
|
||||
remainingPatches.addAll(patchApplier.getRemainingPatches());
|
||||
@@ -416,7 +416,7 @@ public class ShelveChangesManager implements ProjectComponent, JDOMExternalizabl
|
||||
}
|
||||
});
|
||||
|
||||
patchApplier.scheduleSelf(showSuccessNotification, context, silentAddDelete);
|
||||
patchApplier.scheduleSelf(showSuccessNotification, contextInner, silentAddDelete);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -17,12 +17,14 @@
|
||||
package com.intellij.openapi.vcs.merge;
|
||||
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.ide.impl.ProjectUtil;
|
||||
import com.intellij.ide.presentation.VirtualFilePresentation;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diff.ActionButtonPresentation;
|
||||
import com.intellij.openapi.diff.DiffManager;
|
||||
import com.intellij.openapi.diff.DiffRequestFactory;
|
||||
import com.intellij.openapi.diff.MergeRequest;
|
||||
import com.intellij.openapi.diff.impl.mergeTool.MergeVersion;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -323,17 +325,7 @@ public class MultipleFileMergeDialog extends DialogWrapper {
|
||||
}
|
||||
|
||||
private void checkMarkModifiedProject(final VirtualFile file) {
|
||||
if (file.getFileType() == StdFileTypes.IDEA_MODULE ||
|
||||
file.getFileType() == StdFileTypes.IDEA_PROJECT ||
|
||||
file.getFileType() == StdFileTypes.IDEA_WORKSPACE ||
|
||||
isProjectFile(file)) {
|
||||
myProjectManager.saveChangedProjectFile(file, myProject);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isProjectFile(VirtualFile file) {
|
||||
final ProjectOpenProcessor importProvider = ProjectOpenProcessor.getImportProvider(file);
|
||||
return importProvider != null && importProvider.lookForProjectsInDirectory();
|
||||
MergeVersion.MergeDocumentVersion.reportProjectFileChangeIfNeeded(myProject, file);
|
||||
}
|
||||
|
||||
private static String decodeContent(final VirtualFile file, final byte[] content) {
|
||||
|
||||
@@ -190,15 +190,21 @@ public class XDebuggerTestUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static void assertVariableTypeMatches(@NotNull XValue var,
|
||||
@Nullable String name,
|
||||
public static void assertVariableTypeMatches(@NotNull Collection<XValue> vars,
|
||||
@Nullable String name,
|
||||
@Nullable @Language("RegExp") String typePattern) throws InterruptedException {
|
||||
assertVariableTypeMatches(findVar(vars, name), name, typePattern);
|
||||
}
|
||||
|
||||
public static void assertVariableTypeMatches(@NotNull XValue var,
|
||||
@Nullable String name,
|
||||
@Nullable @Language("RegExp") String typePattern) throws InterruptedException {
|
||||
XTestValueNode node = computePresentation(var);
|
||||
if (name != null) {
|
||||
Assert.assertEquals(name, node.myName);
|
||||
}
|
||||
if (typePattern != null) {
|
||||
Assert.assertTrue("Expected type" + typePattern + " Actual type: " + node.myType, node.myType.matches(typePattern));
|
||||
Assert.assertTrue("Expected type: " + typePattern + " Actual type: " + node.myType, node.myType.matches(typePattern));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,14 @@
|
||||
|
||||
package org.jetbrains.android;
|
||||
|
||||
import com.android.sdklib.SdkConstants;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.psi.util.CachedValue;
|
||||
@@ -30,20 +32,19 @@ import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.util.PsiModificationTracker;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.xml.XmlSchemaProvider;
|
||||
import com.android.sdklib.SdkConstants;
|
||||
import gnu.trove.THashMap;
|
||||
import org.jetbrains.android.dom.manifest.ManifestDomFileDescription;
|
||||
import org.jetbrains.android.facet.AndroidFacet;
|
||||
import org.jetbrains.android.resourceManagers.ResourceManager;
|
||||
import org.jetbrains.android.dom.manifest.ManifestDomFileDescription;
|
||||
import org.jetbrains.android.util.AndroidUtils;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
@@ -87,7 +88,8 @@ public class AndroidXmlSchemaProvider extends XmlSchemaProvider {
|
||||
public boolean isAvailable(@NotNull final XmlFile file) {
|
||||
return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
|
||||
public Boolean compute() {
|
||||
if (ResourceManager.isInResourceSubdirectory(file, null) || ManifestDomFileDescription.isManifestFile(file)) {
|
||||
if (isXmlResourceFile(file) ||
|
||||
ManifestDomFileDescription.isManifestFile(file)) {
|
||||
return AndroidFacet.getInstance(file) != null;
|
||||
}
|
||||
return false;
|
||||
@@ -95,6 +97,24 @@ public class AndroidXmlSchemaProvider extends XmlSchemaProvider {
|
||||
});
|
||||
}
|
||||
|
||||
private static boolean isXmlResourceFile(XmlFile file) {
|
||||
if (!ResourceManager.isInResourceSubdirectory(file, null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final PsiDirectory parent = file.getParent();
|
||||
if (parent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final String resType = ResourceManager.getResourceTypeByDirName(parent.getName());
|
||||
if (resType == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !resType.equals("raw");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<String> getAvailableNamespaces(@NotNull XmlFile file, @Nullable String tagName) {
|
||||
|
||||
@@ -36,6 +36,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.*;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
@@ -724,28 +725,43 @@ public class AndroidCompileUtil {
|
||||
public static void packClassFilesIntoJar(@NotNull String[] firstPackageDirPaths,
|
||||
@NotNull String[] libFirstPackageDirPaths,
|
||||
@NotNull File jarFile) throws IOException {
|
||||
final JarOutputStream jos = new JarOutputStream(new FileOutputStream(jarFile));
|
||||
try {
|
||||
for (String path : firstPackageDirPaths) {
|
||||
final File firstPackageDir = new File(path);
|
||||
if (firstPackageDir.exists()) {
|
||||
addFileToJar(jos, firstPackageDir, firstPackageDir.getParentFile(), true);
|
||||
}
|
||||
}
|
||||
|
||||
for (String path : libFirstPackageDirPaths) {
|
||||
final File firstPackageDir = new File(path);
|
||||
if (firstPackageDir.exists()) {
|
||||
addFileToJar(jos, firstPackageDir, firstPackageDir.getParentFile(), false);
|
||||
}
|
||||
final List<Pair<File, String>> files = new ArrayList<Pair<File, String>>();
|
||||
for (String path : firstPackageDirPaths) {
|
||||
final File firstPackageDir = new File(path);
|
||||
if (firstPackageDir.exists()) {
|
||||
addFileToJar(firstPackageDir, firstPackageDir.getParentFile(), true, files);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
jos.close();
|
||||
|
||||
for (String path : libFirstPackageDirPaths) {
|
||||
final File firstPackageDir = new File(path);
|
||||
if (firstPackageDir.exists()) {
|
||||
addFileToJar(firstPackageDir, firstPackageDir.getParentFile(), false, files);
|
||||
}
|
||||
}
|
||||
|
||||
if (files.size() > 0) {
|
||||
final JarOutputStream jos = new JarOutputStream(new FileOutputStream(jarFile));
|
||||
try {
|
||||
for (Pair<File, String> pair : files) {
|
||||
packIntoJar(jos, pair.getFirst(), pair.getSecond());
|
||||
}
|
||||
}
|
||||
finally {
|
||||
jos.close();
|
||||
}
|
||||
}
|
||||
else if (jarFile.isFile()) {
|
||||
if (!jarFile.delete()) {
|
||||
throw new IOException("Cannot delete file " + FileUtil.toSystemDependentName(jarFile.getPath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void addFileToJar(@NotNull JarOutputStream jar, @NotNull File file, @NotNull File rootDirectory, boolean packRClasses)
|
||||
private static void addFileToJar(@NotNull File file,
|
||||
@NotNull File rootDirectory,
|
||||
boolean packRClasses,
|
||||
@NotNull List<Pair<File, String>> files)
|
||||
throws IOException {
|
||||
|
||||
if (file.isDirectory()) {
|
||||
@@ -753,7 +769,7 @@ public class AndroidCompileUtil {
|
||||
|
||||
if (children != null) {
|
||||
for (File child : children) {
|
||||
addFileToJar(jar, child, rootDirectory, packRClasses);
|
||||
addFileToJar(child, rootDirectory, packRClasses, files);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -774,22 +790,26 @@ public class AndroidCompileUtil {
|
||||
path = path.substring(1);
|
||||
}
|
||||
|
||||
final JarEntry entry = new JarEntry(path);
|
||||
entry.setTime(file.lastModified());
|
||||
jar.putNextEntry(entry);
|
||||
files.add(new Pair<File, String>(file, path));
|
||||
}
|
||||
}
|
||||
|
||||
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
|
||||
try {
|
||||
final byte[] buffer = new byte[1024];
|
||||
int count;
|
||||
while ((count = bis.read(buffer)) != -1) {
|
||||
jar.write(buffer, 0, count);
|
||||
}
|
||||
jar.closeEntry();
|
||||
}
|
||||
finally {
|
||||
bis.close();
|
||||
private static void packIntoJar(@NotNull JarOutputStream jar, @NotNull File file, @NotNull String path) throws IOException {
|
||||
final JarEntry entry = new JarEntry(path);
|
||||
entry.setTime(file.lastModified());
|
||||
jar.putNextEntry(entry);
|
||||
|
||||
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
|
||||
try {
|
||||
final byte[] buffer = new byte[1024];
|
||||
int count;
|
||||
while ((count = bis.read(buffer)) != -1) {
|
||||
jar.write(buffer, 0, count);
|
||||
}
|
||||
jar.closeEntry();
|
||||
}
|
||||
finally {
|
||||
bis.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema
|
||||
xmlns:ex="urn:some-exmaple"
|
||||
targetNamespace="urn:some-exmaple"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
|
||||
|
||||
<xs:element name="foo" type="ex:foo"/>
|
||||
|
||||
<xs:complexType name="foo">
|
||||
<xs:sequence>
|
||||
<xs:element name="bar" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
@@ -356,7 +356,19 @@ public class AndroidLayoutDomTest extends AndroidDomTest {
|
||||
actions.get(0).invoke(getProject(), myFixture.getEditor(), myFixture.getFile());
|
||||
}
|
||||
}.execute();
|
||||
myFixture.checkResultByFile("res/values/drawables.xml", testFolder + '/' + getTestName(true) + "_drawable_after.xml", true);
|
||||
myFixture.checkResultByFile("res/values/drawables.xml", testFolder + '/' + getTestName(true) + "_drawable_after.xml", true);
|
||||
}
|
||||
|
||||
public void testXsdFile1() throws Throwable {
|
||||
final VirtualFile virtualFile = copyFileToProject("XsdFile.xsd", "res/raw/XsdFile.xsd");
|
||||
myFixture.configureFromExistingVirtualFile(virtualFile);
|
||||
myFixture.checkHighlighting(false, false, false);
|
||||
}
|
||||
|
||||
public void testXsdFile2() throws Throwable {
|
||||
final VirtualFile virtualFile = copyFileToProject("XsdFile.xsd", "res/assets/XsdFile.xsd");
|
||||
myFixture.configureFromExistingVirtualFile(virtualFile);
|
||||
myFixture.checkHighlighting(false, false, false);
|
||||
}
|
||||
|
||||
private void copyOnClickClasses() throws IOException {
|
||||
|
||||
+1
@@ -111,6 +111,7 @@ public class GroovyInsertHandler implements InsertHandler<LookupElement> {
|
||||
}
|
||||
|
||||
new MethodParenthesesHandler(method, true).handleInsert(context, item);
|
||||
AutoPopupController.getInstance(context.getProject()).autoPopupParameterInfo(editor, method);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,324 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.application.options.CodeStyleHtmlPanel">
|
||||
<grid id="97358" binding="myPanel" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="97358" binding="myPanel" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="4" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="4" y="8" width="645" height="684"/>
|
||||
<xy x="4" y="8" width="828" height="588"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="4e91d" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="ca5bb" layout-manager="GridLayoutManager" row-count="7" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="121a0" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="1" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.or.if.tag.size.more.than"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="547a0" class="javax.swing.JTextField" binding="myDoNotAlignChildrenMinSize">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="1" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="50" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="a3eda" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="4" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.lines"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="fe20d" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.insert.new.line.before"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="160eb" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.remove.new.line.before"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="93fdf" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.do.not.indent.children.of"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="d6b64" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myInsertNewLineTagNames">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="100" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value=""/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="47f60" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myRemoveNewLineTagNames">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="100" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value=""/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="655c2" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myDoNotAlignChildrenTagNames">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="100" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value=""/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="c0d93" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myInlineElementsTagNames">
|
||||
<constraints>
|
||||
<grid row="4" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="100" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value=""/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="9646b" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="inline.elements"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="1ade9" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.keep.white.spaces.inside"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="a2288" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="don.t.break.if.inline.content"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="77303" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myKeepWhiteSpacesTagNames">
|
||||
<constraints>
|
||||
<grid row="5" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="100" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value=""/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="c854c" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myDontBreakIfInlineContent">
|
||||
<constraints>
|
||||
<grid row="6" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="100" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value=""/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<vspacer id="fa5b1">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<grid id="b8acc" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="c0323" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="8a13c" class="javax.swing.JCheckBox" binding="myAlignAttributes">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.align.attributes"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="165dc" class="javax.swing.JCheckBox" binding="myAlignText">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.align.text"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="959da" class="javax.swing.JCheckBox" binding="myKeepWhiteSpaces">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.white.spaces"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="bfd7f" class="javax.swing.JCheckBox" binding="myWrapText">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.wrap.text"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="6063" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
|
||||
</clientProperties>
|
||||
<border type="etched" title-resource-bundle="messages/ApplicationBundle" title-key="title.spaces"/>
|
||||
<children>
|
||||
<component id="f4575" class="javax.swing.JCheckBox" binding="mySpacesAroundEquality">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.around.equals.in.attribute"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="8f9a9" class="javax.swing.JCheckBox" binding="mySpacesAroundTagName">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.around.tag.name"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="2830e" class="javax.swing.JCheckBox" binding="mySpaceInEmptyTag">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.in.empty.tag"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="6dece" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="c888a" class="javax.swing.JCheckBox" binding="myShouldKeepBlankLines">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.line.breaks"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="d4efa" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.wrap.attributes"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="e4b98" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="editbox.keep.blank.lines"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="18182" class="javax.swing.JTextField" binding="myKeepBlankLines">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="50" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<columns value="3"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="8bb88" class="javax.swing.JComboBox" binding="myWrapAttributes">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<enabled value="true"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="f6beb" class="javax.swing.JCheckBox" binding="myShouldKeepLineBreaksInText">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.line.breaks.in.text"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
<xy id="3dbb2" binding="myPreviewPanel" layout-manager="XYLayout" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
@@ -328,6 +17,332 @@
|
||||
<border type="none"/>
|
||||
<children/>
|
||||
</xy>
|
||||
<grid id="1b801" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<scrollpane id="3e3f1" class="com.intellij.ui.components.JBScrollPane" binding="myJBScrollPane" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="0" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<haveBorder value="false"/>
|
||||
<horizontalScrollBarPolicy value="31"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="b4cfb" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints/>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="ca5bb" layout-manager="GridLayoutManager" row-count="7" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="121a0" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="1" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.or.if.tag.size.more.than"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="547a0" class="javax.swing.JTextField" binding="myDoNotAlignChildrenMinSize">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="1" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="50" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="a3eda" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="4" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.lines"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="fe20d" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.insert.new.line.before"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="160eb" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.remove.new.line.before"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="93fdf" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.do.not.indent.children.of"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="d6b64" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myInsertNewLineTagNames">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="100" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value=""/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="47f60" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myRemoveNewLineTagNames">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="100" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value=""/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="655c2" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myDoNotAlignChildrenTagNames">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="100" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value=""/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="c0d93" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myInlineElementsTagNames">
|
||||
<constraints>
|
||||
<grid row="4" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="100" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value=""/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="9646b" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="inline.elements"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="1ade9" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.keep.white.spaces.inside"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="a2288" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="don.t.break.if.inline.content"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="77303" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myKeepWhiteSpacesTagNames">
|
||||
<constraints>
|
||||
<grid row="5" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="100" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value=""/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="c854c" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myDontBreakIfInlineContent">
|
||||
<constraints>
|
||||
<grid row="6" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="1" anchor="8" fill="3" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="100" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value=""/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="b8acc" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="c0323" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="8a13c" class="javax.swing.JCheckBox" binding="myAlignAttributes">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.align.attributes"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="165dc" class="javax.swing.JCheckBox" binding="myAlignText">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.align.text"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="959da" class="javax.swing.JCheckBox" binding="myKeepWhiteSpaces">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.white.spaces"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="bfd7f" class="javax.swing.JCheckBox" binding="myWrapText">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.wrap.text"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="6063" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
|
||||
</clientProperties>
|
||||
<border type="etched" title-resource-bundle="messages/ApplicationBundle" title-key="title.spaces"/>
|
||||
<children>
|
||||
<component id="f4575" class="javax.swing.JCheckBox" binding="mySpacesAroundEquality">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.around.equals.in.attribute"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="8f9a9" class="javax.swing.JCheckBox" binding="mySpacesAroundTagName">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.around.tag.name"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="2830e" class="javax.swing.JCheckBox" binding="mySpaceInEmptyTag">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.in.empty.tag"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="6dece" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="c888a" class="javax.swing.JCheckBox" binding="myShouldKeepBlankLines">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.line.breaks"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="d4efa" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.wrap.attributes"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="e4b98" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="editbox.keep.blank.lines"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="18182" class="javax.swing.JTextField" binding="myKeepBlankLines">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="50" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<columns value="3"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="8bb88" class="javax.swing.JComboBox" binding="myWrapAttributes">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<enabled value="true"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="f6beb" class="javax.swing.JCheckBox" binding="myShouldKeepLineBreaksInText">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.line.breaks.in.text"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</scrollpane>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
|
||||
@@ -26,11 +26,13 @@ import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.ui.components.JBScrollPane;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.ArrayList;
|
||||
@@ -60,6 +62,7 @@ public class CodeStyleHtmlPanel extends CodeStyleAbstractPanel {
|
||||
private JCheckBox myWrapText;
|
||||
private JCheckBox myShouldKeepLineBreaksInText;
|
||||
private TextFieldWithBrowseButton myDontBreakIfInlineContent;
|
||||
private JBScrollPane myJBScrollPane;
|
||||
|
||||
public CodeStyleHtmlPanel(CodeStyleSettings settings) {
|
||||
super(settings);
|
||||
@@ -89,6 +92,16 @@ public class CodeStyleHtmlPanel extends CodeStyleAbstractPanel {
|
||||
return XmlHighlighterFactory.createXMLHighlighter(scheme);
|
||||
}
|
||||
|
||||
private void createUIComponents() {
|
||||
myJBScrollPane = new JBScrollPane() {
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
Dimension prefSize = super.getPreferredSize();
|
||||
return new Dimension(prefSize.width + 15, prefSize.height);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static void customizeField(final String title, final TextFieldWithBrowseButton uiField) {
|
||||
uiField.getTextField().setEditable(false);
|
||||
uiField.setButtonIcon(PlatformIcons.OPEN_EDIT_DIALOG_ICON);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.application.options.CodeStyleXmlPanel">
|
||||
<grid id="634cb" binding="myPanel" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="634cb" binding="myPanel" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="4" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="12" y="7" width="679" height="672"/>
|
||||
@@ -8,23 +8,111 @@
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="265f" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<scrollpane id="a9b52" class="com.intellij.ui.components.JBScrollPane" binding="myJBScrollPane" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="0" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<properties>
|
||||
<haveBorder value="false"/>
|
||||
<horizontalScrollBarPolicy value="31"/>
|
||||
</properties>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="417cd" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="265f" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<constraints/>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="367a8" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="417cd" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="367a8" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="8a13c" class="javax.swing.JCheckBox" binding="myAlignAttributes">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.align.attributes"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="959da" class="javax.swing.JCheckBox" binding="myKeepWhiteSpaces">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.white.spaces"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="c5160" class="javax.swing.JCheckBox" binding="myWrapText">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="2" left="0" bottom="2" right="3"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.wrap.text"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="6063" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
|
||||
<html.disable class="java.lang.Boolean" value="true"/>
|
||||
</clientProperties>
|
||||
<border type="etched" title-resource-bundle="messages/ApplicationBundle" title-key="title.spaces"/>
|
||||
<children>
|
||||
<component id="f4575" class="javax.swing.JCheckBox" binding="mySpacesAroundEquality">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.around.equals.in.attribute"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="8f9a9" class="javax.swing.JCheckBox" binding="mySpacesAfterTagName">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.around.tag.name"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="e8439" class="javax.swing.JCheckBox" binding="myInEmptyTag">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.in.empty.tag"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="e7045" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
@@ -32,189 +120,106 @@
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="8a13c" class="javax.swing.JCheckBox" binding="myAlignAttributes">
|
||||
<component id="d4efa" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.wrap.attributes"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="8bb88" class="javax.swing.JComboBox" binding="myWrapAttributes">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<enabled value="true"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="f230c" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="editbox.keep.blank.lines"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="d9f7d" class="javax.swing.JCheckBox" binding="myKeepLineBreaksInText">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.align.attributes"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.line.breaks.in.text"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="959da" class="javax.swing.JCheckBox" binding="myKeepWhiteSpaces">
|
||||
<component id="18182" class="javax.swing.JTextField" binding="myKeepBlankLines">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="50" height="28"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<columns value="3"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="3cead" class="javax.swing.JCheckBox" binding="myKeepLineBreaks">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.white.spaces"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="c5160" class="javax.swing.JCheckBox" binding="myWrapText">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="2" left="0" bottom="2" right="3"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.wrap.text"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.line.breaks"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="6063" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="bcc6c" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
|
||||
<html.disable class="java.lang.Boolean" value="true"/>
|
||||
</clientProperties>
|
||||
<border type="etched" title-resource-bundle="messages/ApplicationBundle" title-key="title.spaces"/>
|
||||
<border type="etched" title="CDATA"/>
|
||||
<children>
|
||||
<component id="f4575" class="javax.swing.JCheckBox" binding="mySpacesAroundEquality">
|
||||
<component id="a3e4f" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.around.equals.in.attribute"/>
|
||||
<labelFor value="ecfb8"/>
|
||||
<text value="Whitespace around:"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="8f9a9" class="javax.swing.JCheckBox" binding="mySpacesAfterTagName">
|
||||
<component id="9ab20" class="javax.swing.JCheckBox" binding="myKeepWhitespaceInsideCDATACheckBox">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.around.tag.name"/>
|
||||
<text value="Keep whitespace inside"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="e8439" class="javax.swing.JCheckBox" binding="myInEmptyTag">
|
||||
<component id="ecfb8" class="javax.swing.JComboBox" binding="myWhiteSpaceAroundCDATA">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.spaces.in.empty.tag"/>
|
||||
<model>
|
||||
<item value="Preserve"/>
|
||||
<item value="Remove (keep with tags)"/>
|
||||
<item value="Add new lines"/>
|
||||
</model>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="e7045" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="d4efa" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="label.wrap.attributes"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="8bb88" class="javax.swing.JComboBox" binding="myWrapAttributes">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<enabled value="true"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="f230c" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="editbox.keep.blank.lines"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="d9f7d" class="javax.swing.JCheckBox" binding="myKeepLineBreaksInText">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.line.breaks.in.text"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="18182" class="javax.swing.JTextField" binding="myKeepBlankLines">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="50" height="28"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<columns value="3"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="3cead" class="javax.swing.JCheckBox" binding="myKeepLineBreaks">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<text resource-bundle="messages/ApplicationBundle" key="checkbox.keep.line.breaks"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<grid id="bcc6c" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/>
|
||||
</clientProperties>
|
||||
<border type="etched" title="CDATA"/>
|
||||
<children>
|
||||
<component id="a3e4f" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<labelFor value="ecfb8"/>
|
||||
<text value="Whitespace around:"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="9ab20" class="javax.swing.JCheckBox" binding="myKeepWhitespaceInsideCDATACheckBox">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Keep whitespace inside"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="ecfb8" class="javax.swing.JComboBox" binding="myWhiteSpaceAroundCDATA">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<model>
|
||||
<item value="Preserve"/>
|
||||
<item value="Remove (keep with tags)"/>
|
||||
<item value="Add new lines"/>
|
||||
</model>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<vspacer id="3253b">
|
||||
<constraints>
|
||||
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
</children>
|
||||
</grid>
|
||||
</scrollpane>
|
||||
<xy id="3dbb2" binding="myPreviewPanel" layout-manager="XYLayout" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
|
||||
@@ -23,9 +23,11 @@ import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.psi.formatter.xml.XmlCodeStyleSettings;
|
||||
import com.intellij.ui.components.JBScrollPane;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class CodeStyleXmlPanel extends CodeStyleAbstractPanel{
|
||||
private JTextField myKeepBlankLines;
|
||||
@@ -44,6 +46,7 @@ public class CodeStyleXmlPanel extends CodeStyleAbstractPanel{
|
||||
private JCheckBox myKeepLineBreaksInText;
|
||||
private JComboBox myWhiteSpaceAroundCDATA;
|
||||
private JCheckBox myKeepWhitespaceInsideCDATACheckBox;
|
||||
private JBScrollPane myJBScrollPane;
|
||||
|
||||
public CodeStyleXmlPanel(CodeStyleSettings settings) {
|
||||
super(settings);
|
||||
@@ -171,4 +174,14 @@ public class CodeStyleXmlPanel extends CodeStyleAbstractPanel{
|
||||
protected void prepareForReformat(final PsiFile psiFile) {
|
||||
//psiFile.putUserData(PsiUtil.FILE_LANGUAGE_LEVEL_KEY, LanguageLevel.HIGHEST);
|
||||
}
|
||||
|
||||
private void createUIComponents() {
|
||||
myJBScrollPane = new JBScrollPane() {
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
Dimension prefSize = super.getPreferredSize();
|
||||
return new Dimension(prefSize.width + 15, prefSize.height);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+8
-1
@@ -31,6 +31,7 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.psi.xml.XmlFile;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
@@ -81,6 +82,12 @@ public class GenerateInstanceDocumentFromSchemaAction extends AnAction {
|
||||
|
||||
final String url = dialog.getUrl().getText();
|
||||
final VirtualFile relativeFile = VfsUtil.findRelativeFile(ExternalResourceManager.getInstance().getResourceLocation(url), null);
|
||||
final PsiFile file = PsiManager.getInstance(project).findFile(relativeFile);
|
||||
if (! (file instanceof XmlFile)) {
|
||||
Messages.showErrorDialog(project, "This is not XmlFile" + file == null ? "" : " (" + file.getFileType().getName() + ")", XmlBundle.message("error"));
|
||||
return;
|
||||
}
|
||||
|
||||
VirtualFile relativeFileDir;
|
||||
if (relativeFile == null) {
|
||||
Messages.showErrorDialog(project, XmlBundle.message("file.doesnt.exist", url), XmlBundle.message("error"));
|
||||
@@ -110,7 +117,7 @@ public class GenerateInstanceDocumentFromSchemaAction extends AnAction {
|
||||
tempDir.mkdir();
|
||||
|
||||
pathToUse = tempDir.getPath() + File.separatorChar + Xsd2InstanceUtils.processAndSaveAllSchemas(
|
||||
(XmlFile) PsiManager.getInstance(project).findFile(relativeFile),
|
||||
(XmlFile) file,
|
||||
new THashMap<String, String>(),
|
||||
new Xsd2InstanceUtils.SchemaReferenceProcessor() {
|
||||
public void processSchema(String schemaFileName, byte[] schemaContent) {
|
||||
|
||||
Reference in New Issue
Block a user