Revision 44533 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/jdbc/JDBCConnectionPickerController.java
JDBCConnectionPickerController.java | ||
---|---|---|
4 | 4 |
import java.awt.event.ActionListener; |
5 | 5 |
import java.awt.event.ItemEvent; |
6 | 6 |
import java.awt.event.ItemListener; |
7 |
import java.net.URL; |
|
7 | 8 |
import javax.swing.ComboBoxModel; |
8 | 9 |
import javax.swing.JButton; |
9 | 10 |
import javax.swing.JComboBox; |
... | ... | |
15 | 16 |
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
16 | 17 |
import org.gvsig.fmap.dal.swing.DALSwingLocator; |
17 | 18 |
import org.gvsig.fmap.dal.swing.jdbc.JDBCConnectionDialog; |
19 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
18 | 20 |
import org.gvsig.tools.swing.api.pickercontroller.AbstractPickerController; |
19 | 21 |
import org.gvsig.tools.swing.api.pickercontroller.PickerController; |
22 |
import org.gvsig.tools.swing.icontheme.IconTheme; |
|
20 | 23 |
import org.gvsig.tools.util.LabeledValue; |
21 | 24 |
import org.gvsig.tools.util.LabeledValueImpl; |
22 | 25 |
|
... | ... | |
43 | 46 |
doAddConnection(); |
44 | 47 |
} |
45 | 48 |
}); |
49 |
if( "...".equals(this.btnConnection.getText()) ) { |
|
50 |
this.btnConnection.setText(""); |
|
51 |
} |
|
52 |
IconTheme theme = ToolsSwingLocator.getIconThemeManager().getCurrent(); |
|
53 |
this.btnConnection.setIcon(theme.get("database-connection-add")); |
|
54 |
|
|
46 | 55 |
this.cboConnection.addItemListener(new ItemListener() { |
47 | 56 |
@Override |
48 | 57 |
public void itemStateChanged(ItemEvent e) { |
... | ... | |
127 | 136 |
return this.cboConnection.isEnabled(); |
128 | 137 |
} |
129 | 138 |
|
139 |
public static void selfRegister() { |
|
140 |
String[][] iconNames = new String[][]{ |
|
141 |
new String[]{"dalswing", "database-connection-add"} |
|
142 |
}; |
|
143 |
IconTheme theme = ToolsSwingLocator.getIconThemeManager().getCurrent(); |
|
144 |
for (String[] icon : iconNames) { |
|
145 |
URL url = JDBCConnectionPickerController.class.getResource(icon[1] + ".png"); |
|
146 |
theme.registerDefault("DALSwing", icon[0], icon[1], null, url); |
|
147 |
} |
|
148 |
|
|
149 |
} |
|
150 |
|
|
151 |
|
|
130 | 152 |
} |
Also available in: Unified diff