[jbosstools-commits] JBoss Tools SVN: r43406 - in trunk/runtime/plugins: org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences and 1 other directory.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Tue Sep 4 23:54:29 EDT 2012
Author: rob.stryker at jboss.com
Date: 2012-09-04 23:54:28 -0400 (Tue, 04 Sep 2012)
New Revision: 43406
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/RuntimeDefinition.java
trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences/RuntimePreferencePage.java
Log:
JBIDE-12540 isolate shared images
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/RuntimeDefinition.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/RuntimeDefinition.java 2012-09-05 03:31:52 UTC (rev 43405)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/RuntimeDefinition.java 2012-09-05 03:54:28 UTC (rev 43406)
@@ -15,6 +15,9 @@
import java.util.List;
/**
+ * A runtime definition represents a specific runtime type and
+ * version, at some location, and what name it has.
+ *
* @author snjeza
*
*/
Modified: trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences/RuntimePreferencePage.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences/RuntimePreferencePage.java 2012-09-05 03:31:52 UTC (rev 43405)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/preferences/RuntimePreferencePage.java 2012-09-05 03:54:28 UTC (rev 43406)
@@ -75,6 +75,7 @@
import org.jboss.tools.runtime.core.model.RuntimePath;
import org.jboss.tools.runtime.ui.IDownloadRuntimes;
import org.jboss.tools.runtime.ui.IRuntimePathChangeListener;
+import org.jboss.tools.runtime.ui.RuntimeSharedImages;
import org.jboss.tools.runtime.ui.RuntimeUIActivator;
import org.jboss.tools.runtime.ui.dialogs.AutoResizeTableLayout;
import org.jboss.tools.runtime.ui.dialogs.EditRuntimePathDialog;
@@ -91,9 +92,6 @@
public static String ID = "org.jboss.tools.runtime.preferences.RuntimePreferencePage";
private Set<RuntimePath> runtimePaths = new HashSet<RuntimePath>();
- private Image checkboxOn;
- private Image checkboxOff;
- private Image errorIcon;
private TableViewer runtimePathViewer;
private RuntimePath runtimePath;
private Set<IRuntimeDetector> runtimeDetectors;
@@ -264,7 +262,7 @@
@Override
public void run() {
- if (runtimePathChangeListener == null || errorIcon == null || errorIcon.isDisposed()) {
+ if (runtimePathChangeListener == null) {
return;
}
runtimePaths = RuntimeUIActivator.getDefault().getRuntimePaths();
@@ -484,9 +482,6 @@
public void init(IWorkbench workbench) {
runtimePaths = RuntimeUIActivator.getDefault().getRuntimePaths();
runtimeDetectors = RuntimeUIActivator.getDefault().getRuntimeDetectors();
- checkboxOn = RuntimeUIActivator.imageDescriptorFromPlugin(RuntimeUIActivator.PLUGIN_ID, "/icons/xpl/complete_tsk.gif").createImage();
- checkboxOff = RuntimeUIActivator.imageDescriptorFromPlugin(RuntimeUIActivator.PLUGIN_ID, "/icons/xpl/incomplete_tsk.gif").createImage();
- errorIcon = RuntimeUIActivator.imageDescriptorFromPlugin(RuntimeUIActivator.PLUGIN_ID, "/icons/xpl/error_tsk.gif").createImage();
}
@Override
@@ -495,15 +490,6 @@
RuntimeUIActivator.getDefault().removeRuntimePathChangeListener(runtimePathChangeListener);
runtimePathChangeListener = null;
}
- if (checkboxOff != null) {
- checkboxOff.dispose();
- }
- if (checkboxOn != null) {
- checkboxOn.dispose();
- }
- if (errorIcon != null) {
- errorIcon.dispose();
- }
super.dispose();
}
@@ -580,12 +566,15 @@
}
RuntimePath runtimePath = (RuntimePath) element;
if (columnIndex == 1) {
- return runtimePath.isScanOnEveryStartup() ? checkboxOn : checkboxOff;
+ if( runtimePath.isScanOnEveryStartup())
+ return RuntimeSharedImages.getImage(RuntimeSharedImages.CHECKBOX_ON_KEY);
+ else
+ return RuntimeSharedImages.getImage(RuntimeSharedImages.CHECKBOX_OFF_KEY);
}
if (columnIndex == 0) {
String path = runtimePath.getPath();
if (path == null || ! (new File(path).isDirectory())) {
- return errorIcon;
+ return RuntimeSharedImages.getImage(RuntimeSharedImages.ERROR_KEY);
}
}
return null;
More information about the jbosstools-commits
mailing list