mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 09:03:31 +07:00
Merge remote branch 'origin/master'
This commit is contained in:
@@ -172,7 +172,7 @@ libraryLicense(name: "DTDParser", version: "1.13", license: "LGPL", url: "http:/
|
||||
libraryLicense(name: "Ganymed", version: "bundled with SVNKit", libraryName: "svnkit.jar", license: "BSD", url: "http://www.ganymed.ethz.ch/ssh2/", licenseUrl: "http://www.ganymed.ethz.ch/ssh2/LICENSE.txt")
|
||||
libraryLicense(name: "sqljet", version: "bundled with SVNKit", libraryName: "sqljet.jar", license: "GPLv2", url: "http://sqljet.com", licenseUrl: "http://www.opensource.org/licenses/lgpl-2.1")
|
||||
libraryLicense(name: "svnkit-javahl", version: "bundled with SVNKit", libraryName: "svnkit-javahl.jar", license: "link (commercial license)", url: "http://www.svnkit.com/", licenseUrl: "http://svnkit.com/license.html")
|
||||
libraryLicense(name: "Javahl", version: "1.7.2", libraryName: "Javahl.jar", license: "Apache", url: "http://subversion.apache.org", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0")
|
||||
libraryLicense(name: "javahl", version: "1.7.2", libraryName: "javahl.jar", license: "Apache", url: "http://subversion.apache.org", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0")
|
||||
libraryLicense(name: "Apache Commons HTTPClient", libraryName: "httpclient-4.1.1.jar", version:"4.1.1", license: "Apache 2.0",
|
||||
url: "http://hc.apache.org/httpcomponents-client-ga/index.html", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0")
|
||||
libraryLicense(name: "Apache Commons HTTPCore", libraryName: "httpcore-4.1.jar", version: "4.1", license: "Apache 2.0",
|
||||
|
||||
+29
-30
@@ -33,9 +33,9 @@ import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.templateLanguages.TemplateDataLanguagePatterns;
|
||||
import com.intellij.ui.ListScrollingUtil;
|
||||
import com.intellij.ui.ListUtil;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.components.JBList;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -494,43 +494,42 @@ public class FileTypeConfigurable extends BaseConfigurable implements Searchable
|
||||
|
||||
public static class PatternsPanel extends JPanel {
|
||||
private JBList myPatternsList;
|
||||
private JButton myAddButton;
|
||||
private JButton myRemoveButton;
|
||||
private JComponent myAddButton;
|
||||
private JPanel myWholePanel;
|
||||
private JButton myEditButton;
|
||||
private FileTypeConfigurable myController;
|
||||
|
||||
public PatternsPanel() {
|
||||
super(new BorderLayout());
|
||||
add(myWholePanel, BorderLayout.CENTER);
|
||||
myPatternsList = new JBList(new DefaultListModel());
|
||||
myPatternsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
myPatternsList.setCellRenderer(new ExtensionRenderer());
|
||||
myPatternsList.setModel(new DefaultListModel());
|
||||
myPatternsList.addListSelectionListener(new ListSelectionListener() {
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
myRemoveButton.setEnabled(myPatternsList.getSelectedIndex() != -1 && getListModel().size() > 0);
|
||||
}
|
||||
});
|
||||
|
||||
myPatternsList.getEmptyText().setText(FileTypesBundle.message("filetype.settings.no.patterns"));
|
||||
|
||||
myWholePanel = ToolbarDecorator.createDecorator(myPatternsList)
|
||||
.setAddAction(new AnActionButtonRunnable() {
|
||||
@Override
|
||||
public void run(AnActionButton button) {
|
||||
myController.addPattern();
|
||||
}
|
||||
}).setEditAction(new AnActionButtonRunnable() {
|
||||
@Override
|
||||
public void run(AnActionButton button) {
|
||||
myController.editPattern();
|
||||
}
|
||||
}).setRemoveAction(new AnActionButtonRunnable() {
|
||||
@Override
|
||||
public void run(AnActionButton button) {
|
||||
myController.removePattern();
|
||||
}
|
||||
}).disableUpDownActions().createPanel();
|
||||
UIUtil.addBorder(myWholePanel, IdeBorderFactory.createTitledBorder(FileTypesBundle.message("filetype.registered.patterns.group"), false));
|
||||
myAddButton = ToolbarDecorator.findAddButton(myWholePanel).getContextComponent();
|
||||
|
||||
add(myWholePanel, BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
public void attachActions(final FileTypeConfigurable controller) {
|
||||
myAddButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
controller.addPattern();
|
||||
}
|
||||
});
|
||||
myEditButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
controller.editPattern();
|
||||
}
|
||||
});
|
||||
|
||||
myRemoveButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
controller.removePattern();
|
||||
}
|
||||
});
|
||||
|
||||
myController = controller;
|
||||
}
|
||||
|
||||
public JComponent getComponent() {
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.openapi.fileTypes.impl.FileTypeConfigurable.PatternsPanel">
|
||||
<grid id="2f1ff" binding="myWholePanel" 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>
|
||||
<xy x="255" y="126" width="612" height="152"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<clientProperties>
|
||||
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithoutIndent"/>
|
||||
</clientProperties>
|
||||
<border type="etched" title-resource-bundle="messages/FileTypesBundle" title-key="filetype.registered.patterns.group"/>
|
||||
<children>
|
||||
<scrollpane id="6d594" class="com.intellij.ui.components.JBScrollPane">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="4" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="80" height="80"/>
|
||||
<preferred-size width="200" height="150"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="5f100" class="com.intellij.ui.components.JBList" binding="myPatternsList">
|
||||
<constraints/>
|
||||
<properties>
|
||||
<selectionMode value="0"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</scrollpane>
|
||||
<component id="bf532" class="javax.swing.JButton" binding="myAddButton">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/FileTypesBundle" key="filetype.registered.pattern.add.button"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="6bc56" class="javax.swing.JButton" binding="myRemoveButton">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/FileTypesBundle" key="filetype.registered.pattern.remove.button"/>
|
||||
</properties>
|
||||
</component>
|
||||
<vspacer id="ca6cc">
|
||||
<constraints>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="cbe18" class="javax.swing.JButton" binding="myEditButton">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Ed&it..."/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
@@ -41,8 +41,11 @@ public class PlatformProjectConfigurator implements DirectoryProjectConfigurator
|
||||
String moduleName = baseDir.getName().replace(":", ""); // correct module name when opening root of drive as project (RUBY-5181)
|
||||
String imlName = baseDir.getPath() + "/.idea/" + moduleName + ModuleFileType.DOT_DEFAULT_EXTENSION;
|
||||
final Module module = moduleManager.newModule(imlName, ModuleTypeManager.getInstance().getDefaultModuleType());
|
||||
ModifiableRootModel rootModel = ModuleRootManager.getInstance(module).getModifiableModel();
|
||||
rootModel.addContentEntry(baseDir);
|
||||
ModuleRootManager rootManager = ModuleRootManager.getInstance(module);
|
||||
ModifiableRootModel rootModel = rootManager.getModifiableModel();
|
||||
if (rootModel.getContentRoots().length == 0) {
|
||||
rootModel.addContentEntry(baseDir);
|
||||
}
|
||||
rootModel.inheritSdk();
|
||||
rootModel.commit();
|
||||
moduleRef.set(module);
|
||||
|
||||
+39
-50
@@ -31,8 +31,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
@@ -56,9 +54,8 @@ public class CustomFileTypeEditor extends SettingsEditor<AbstractFileType> {
|
||||
|
||||
private final JTextField myNumPostfixes = new JTextField(5);
|
||||
private final JBList[] myKeywordsLists = new JBList[]{new JBList(), new JBList(), new JBList(), new JBList()};
|
||||
private final DefaultListModel[] myKeywordModels = new DefaultListModel[]{new DefaultListModel(), new DefaultListModel(), new DefaultListModel(), new DefaultListModel()};
|
||||
private final JButton[] myAddKeywordButtons = new JButton[4];
|
||||
private final JButton[] myRemoveKeywordButtons = new JButton[4];
|
||||
private final DefaultListModel[] myKeywordModels =
|
||||
new DefaultListModel[]{new DefaultListModel(), new DefaultListModel(), new DefaultListModel(), new DefaultListModel()};
|
||||
|
||||
public CustomFileTypeEditor() {
|
||||
myLineComment.getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@@ -113,7 +110,8 @@ public class CustomFileTypeEditor extends SettingsEditor<AbstractFileType> {
|
||||
if (myFileTypeName.getText().trim().length() == 0) {
|
||||
throw new ConfigurationException(IdeBundle.message("error.name.cannot.be.empty"),
|
||||
CommonBundle.getErrorTitle());
|
||||
} else if (myFileTypeDescr.getText().trim().length() == 0) {
|
||||
}
|
||||
else if (myFileTypeDescr.getText().trim().length() == 0) {
|
||||
myFileTypeDescr.setText(myFileTypeName.getText());
|
||||
}
|
||||
type.setName(myFileTypeName.getText());
|
||||
@@ -223,43 +221,30 @@ public class CustomFileTypeEditor extends SettingsEditor<AbstractFileType> {
|
||||
}
|
||||
|
||||
private JPanel createKeywordsPanel(final int index) {
|
||||
JPanel keywordsPanel = new JPanel();
|
||||
keywordsPanel.setLayout(new BorderLayout());
|
||||
|
||||
keywordsPanel.add(ScrollPaneFactory.createScrollPane(myKeywordsLists[index]), BorderLayout.CENTER);
|
||||
|
||||
DialogButtonGroup buttonGroup = new DialogButtonGroup();
|
||||
buttonGroup.setBorder(BorderFactory.createEmptyBorder(0, 10, 5, 0));
|
||||
|
||||
myAddKeywordButtons[index] = new JButton(IdeBundle.message("button.add"));
|
||||
myAddKeywordButtons[index].addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
ModifyKeywordDialog dialog = new ModifyKeywordDialog(myAddKeywordButtons[index], "");
|
||||
dialog.show();
|
||||
if (dialog.isOK()) {
|
||||
String keywordName = dialog.getKeywordName();
|
||||
if (!myKeywordModels[index].contains(keywordName)) myKeywordModels[index].addElement(keywordName);
|
||||
JPanel panel = ToolbarDecorator.createDecorator(myKeywordsLists[index])
|
||||
.setAddAction(new AnActionButtonRunnable() {
|
||||
@Override
|
||||
public void run(AnActionButton button) {
|
||||
ModifyKeywordDialog dialog = new ModifyKeywordDialog(myKeywordsLists[index], "");
|
||||
dialog.show();
|
||||
if (dialog.isOK()) {
|
||||
String keywordName = dialog.getKeywordName();
|
||||
if (!myKeywordModels[index].contains(keywordName)) myKeywordModels[index].addElement(keywordName);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
buttonGroup.addButton(myAddKeywordButtons[index]);
|
||||
|
||||
myRemoveKeywordButtons[index] = new JButton(IdeBundle.message("button.remove"));
|
||||
myRemoveKeywordButtons[index].addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
ListUtil.removeSelectedItems(myKeywordsLists[index]);
|
||||
}
|
||||
});
|
||||
|
||||
buttonGroup.addButton(myRemoveKeywordButtons[index]);
|
||||
|
||||
keywordsPanel.add(buttonGroup, BorderLayout.EAST);
|
||||
return keywordsPanel;
|
||||
}).setRemoveAction(new AnActionButtonRunnable() {
|
||||
@Override
|
||||
public void run(AnActionButton button) {
|
||||
ListUtil.removeSelectedItems(myKeywordsLists[index]);
|
||||
}
|
||||
}).disableUpDownActions().createPanel();
|
||||
panel.setBorder(null);
|
||||
return panel;
|
||||
}
|
||||
|
||||
private void edit(int index) {
|
||||
if (myKeywordsLists[index].getSelectedIndex() == -1) return;
|
||||
ModifyKeywordDialog dialog = new ModifyKeywordDialog(myKeywordsLists[index], (String) myKeywordsLists[index].getSelectedValue());
|
||||
ModifyKeywordDialog dialog = new ModifyKeywordDialog(myKeywordsLists[index], (String)myKeywordsLists[index].getSelectedValue());
|
||||
dialog.show();
|
||||
if (dialog.isOK()) {
|
||||
myKeywordModels[index].setElementAt(dialog.getKeywordName(), myKeywordsLists[index].getSelectedIndex());
|
||||
@@ -285,30 +270,34 @@ public class CustomFileTypeEditor extends SettingsEditor<AbstractFileType> {
|
||||
|
||||
for (int i = 0; i < myKeywordModels[0].size(); i++) {
|
||||
if (ignoreCase) {
|
||||
syntaxTable.addKeyword1(((String) myKeywordModels[0].getElementAt(i)).toLowerCase());
|
||||
} else {
|
||||
syntaxTable.addKeyword1((String) myKeywordModels[0].getElementAt(i));
|
||||
syntaxTable.addKeyword1(((String)myKeywordModels[0].getElementAt(i)).toLowerCase());
|
||||
}
|
||||
else {
|
||||
syntaxTable.addKeyword1((String)myKeywordModels[0].getElementAt(i));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < myKeywordModels[1].size(); i++) {
|
||||
if (ignoreCase) {
|
||||
syntaxTable.addKeyword2(((String) myKeywordModels[1].getElementAt(i)).toLowerCase());
|
||||
} else {
|
||||
syntaxTable.addKeyword2((String) myKeywordModels[1].getElementAt(i));
|
||||
syntaxTable.addKeyword2(((String)myKeywordModels[1].getElementAt(i)).toLowerCase());
|
||||
}
|
||||
else {
|
||||
syntaxTable.addKeyword2((String)myKeywordModels[1].getElementAt(i));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < myKeywordModels[2].size(); i++) {
|
||||
if (ignoreCase) {
|
||||
syntaxTable.addKeyword3(((String) myKeywordModels[2].getElementAt(i)).toLowerCase());
|
||||
} else {
|
||||
syntaxTable.addKeyword3((String) myKeywordModels[2].getElementAt(i));
|
||||
syntaxTable.addKeyword3(((String)myKeywordModels[2].getElementAt(i)).toLowerCase());
|
||||
}
|
||||
else {
|
||||
syntaxTable.addKeyword3((String)myKeywordModels[2].getElementAt(i));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < myKeywordModels[3].size(); i++) {
|
||||
if (ignoreCase) {
|
||||
syntaxTable.addKeyword4(((String) myKeywordModels[3].getElementAt(i)).toLowerCase());
|
||||
} else {
|
||||
syntaxTable.addKeyword4((String) myKeywordModels[3].getElementAt(i));
|
||||
syntaxTable.addKeyword4(((String)myKeywordModels[3].getElementAt(i)).toLowerCase());
|
||||
}
|
||||
else {
|
||||
syntaxTable.addKeyword4((String)myKeywordModels[3].getElementAt(i));
|
||||
}
|
||||
}
|
||||
return syntaxTable;
|
||||
|
||||
+4
-2
@@ -33,7 +33,8 @@ public class ModifyKeywordDialog extends DialogWrapper {
|
||||
super(parent, false);
|
||||
if (initialValue == null || "".equals(initialValue)) {
|
||||
setTitle(IdeBundle.message("title.add.new.keyword"));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
setTitle(IdeBundle.message("title.edit.keyword"));
|
||||
}
|
||||
init();
|
||||
@@ -46,7 +47,8 @@ public class ModifyKeywordDialog extends DialogWrapper {
|
||||
gc.gridx = 0;
|
||||
gc.gridy = 0;
|
||||
gc.weightx = 0;
|
||||
gc.insets = new Insets(5, 0, 5, 5);
|
||||
gc.insets = new Insets(5, 0, 5, 10);
|
||||
gc.anchor = GridBagConstraints.BASELINE;
|
||||
panel.add(new JLabel(IdeBundle.message("editbox.keyword")), gc);
|
||||
|
||||
gc = new GridBagConstraints();
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 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.
|
||||
@@ -192,7 +192,7 @@ public class GlassPaneDialogWrapperPeer extends DialogWrapperPeer implements Foc
|
||||
}
|
||||
|
||||
public Window getWindow() {
|
||||
throw new UnsupportedOperationException("Not implemented in " + getClass().getCanonicalName());
|
||||
return null;
|
||||
}
|
||||
|
||||
public JRootPane getRootPane() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 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.
|
||||
@@ -57,7 +57,7 @@ public class NewDirectoryProjectDialog extends DialogWrapper {
|
||||
|
||||
new LocationNameFieldsBinding(project, myLocationField, myProjectNameTextField, getBaseDir());
|
||||
|
||||
final DirectoryProjectGenerator[] generators = Extensions.getExtensions(DirectoryProjectGenerator.EP_NAME);
|
||||
final DirectoryProjectGenerator[] generators = getGenerators();
|
||||
if (generators.length == 0) {
|
||||
myProjectTypePanel.setVisible(false);
|
||||
}
|
||||
@@ -92,6 +92,10 @@ public class NewDirectoryProjectDialog extends DialogWrapper {
|
||||
});
|
||||
}
|
||||
|
||||
protected DirectoryProjectGenerator[] getGenerators() {
|
||||
return Extensions.getExtensions(DirectoryProjectGenerator.EP_NAME);
|
||||
}
|
||||
|
||||
private void checkValid() {
|
||||
String projectName = myProjectNameTextField.getText();
|
||||
if (projectName.trim().isEmpty()) {
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module" module-name="platform-impl" />
|
||||
<orderEntry type="library" name="jna" level="project" />
|
||||
<orderEntry type="module-library" scope="RUNTIME">
|
||||
<library>
|
||||
<CLASSES>
|
||||
@@ -94,7 +93,7 @@
|
||||
<orderEntry type="module-library">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/javahl.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/lib/Javahl.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
|
||||
Reference in New Issue
Block a user