mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge branch 'master' of git.labs.intellij.net:idea/community
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
<scrollpane id="2fb19" class="com.intellij.ui.components.JBScrollPane">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="3" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="600" height="-1"/>
|
||||
<minimum-size width="400" height="-1"/>
|
||||
<preferred-size width="-1" height="200"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
@@ -118,7 +118,7 @@
|
||||
<scrollpane id="2e869" class="com.intellij.ui.components.JBScrollPane">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="3" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||
<minimum-size width="600" height="-1"/>
|
||||
<minimum-size width="400" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
|
||||
@@ -38,6 +38,7 @@ import javax.swing.event.ListDataListener;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
import javax.swing.table.DefaultTableCellRenderer;
|
||||
import javax.swing.table.TableColumn;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
@@ -80,6 +81,7 @@ public class EditLibraryDialog extends DialogWrapper {
|
||||
});
|
||||
|
||||
myFileTableModel = new FileTableModel();
|
||||
myFileTable.setRowHeight(myFileTable.getRowHeight() + 5);
|
||||
myFileTable.setModel(myFileTableModel);
|
||||
|
||||
myRemoveFileButton.setEnabled(false);
|
||||
@@ -140,6 +142,9 @@ public class EditLibraryDialog extends DialogWrapper {
|
||||
typeCol.setMaxWidth(80);
|
||||
MyTableCellEditor cellEditor = new MyTableCellEditor(new JComboBox(new String[] {mySourceTypeName, myCompactTypeName}), myFileTableModel);
|
||||
typeCol.setCellEditor(cellEditor);
|
||||
|
||||
TableColumn fileCol = myFileTable.getColumnModel().getColumn(FILE_LOCATION_COL);
|
||||
fileCol.setCellRenderer(new MyTableCellRenderer());
|
||||
}
|
||||
|
||||
public EditLibraryDialog(String title, LangScriptingContextProvider provider, Project project, ScriptingLibraryTable.LibraryModel lib) {
|
||||
@@ -152,6 +157,20 @@ public class EditLibraryDialog extends DialogWrapper {
|
||||
myRemoveDocUrlButton.setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
private class MyTableCellRenderer extends DefaultTableCellRenderer {
|
||||
@Override
|
||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
|
||||
Component renderer = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
|
||||
if (renderer instanceof JLabel) {
|
||||
VirtualFile file = myFileTableModel.getFileAt(row);
|
||||
if (file != null) {
|
||||
((JLabel)renderer).setToolTipText(file.getPath());
|
||||
}
|
||||
}
|
||||
return renderer;
|
||||
}
|
||||
}
|
||||
|
||||
private class MyTableCellEditor extends DefaultCellEditor {
|
||||
|
||||
@@ -245,7 +264,7 @@ public class EditLibraryDialog extends DialogWrapper {
|
||||
public String getColumnName(int column) {
|
||||
switch(column) {
|
||||
case FILE_LOCATION_COL:
|
||||
return IdeBundle.message("scripting.lib.file.location");
|
||||
return IdeBundle.message("scripting.lib.file.name");
|
||||
case FILE_TYPE_COL:
|
||||
return IdeBundle.message("scripting.lib.file.type");
|
||||
}
|
||||
@@ -307,7 +326,7 @@ public class EditLibraryDialog extends DialogWrapper {
|
||||
VirtualFile file = myFiles.get(rowIndex);
|
||||
switch (columnIndex) {
|
||||
case FILE_LOCATION_COL:
|
||||
return file;
|
||||
return file.getPresentableName();
|
||||
case FILE_TYPE_COL:
|
||||
return myCompactFiles.contains(file) ? myCompactTypeName : mySourceTypeName;
|
||||
}
|
||||
|
||||
@@ -1083,6 +1083,7 @@ label.no.inspections.found=No inspections found
|
||||
#Scripting library management
|
||||
scripting.lib.name=&Name
|
||||
scripting.lib.file.title=Files
|
||||
scripting.lib.file.name=Name
|
||||
scripting.lib.file.location=Location
|
||||
scripting.lib.file.type=Type
|
||||
scripting.lib.select.root=Select library file or directory
|
||||
|
||||
Reference in New Issue
Block a user