Author: adietish
Date: 2012-05-21 08:15:52 -0400 (Mon, 21 May 2012)
New Revision: 41206
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftImages.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftUIActivator.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateApplicationAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateOrEditDomainAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateServerAdapterAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenInWebBrowserAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/RefreshElementAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/OpenShiftExpressConsoleLabelProvider.java
Log:
replaced image creation by image descriptor repo
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftImages.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftImages.java 2012-05-21
12:15:10 UTC (rev 41205)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftImages.java 2012-05-21
12:15:52 UTC (rev 41206)
@@ -14,15 +14,34 @@
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.openshift.express.internal.ui.utils.ImageRepository;
+/**
+ * @author Andre Dietisheim
+ */
public class OpenShiftImages {
private static final String ICONS_FOLDER = "icons/";
- private static final ImageRepository repo =
- new ImageRepository(ICONS_FOLDER, OpenShiftUIActivator.getDefault(),
OpenShiftUIActivator.getDefault().getImageRegistry());
+ private static final ImageRepository repo =
+ new ImageRepository(ICONS_FOLDER, OpenShiftUIActivator.getDefault(),
OpenShiftUIActivator.getDefault()
+ .getImageRegistry());
public static final ImageDescriptor OPENSHIFT_LOGO_DARK =
repo.create("openshift-logo-dark.png"); //$NON-NLS-1$
public static final ImageDescriptor OPENSHIFT_LOGO_WHITE =
repo.create("openshift-logo-white.png"); //$NON-NLS-1$
public static final ImageDescriptor OPENSHIFT_LOGO_WHITE_MEDIUM =
repo.create("openshift-logo-white-medium.png"); //$NON-NLS-1$
public static final Image OPENSHIFT_LOGO_WHITE_MEDIUM_IMG =
repo.getImage("openshift-logo-white-medium.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OPEN_BROWSER =
repo.create("open-browser.gif");
+ public static final ImageDescriptor REFRESH = repo.create("refresh.gif");
+ public static final ImageDescriptor GO_INTO = repo.create("go-into.gif");
+ public static final ImageDescriptor TASK_REPO_NEW =
repo.create("task-repository-new.gif");
+ public static final ImageDescriptor EDIT = repo.create("edit.gif");
+ public static final ImageDescriptor QUERY_NEW = repo.create("query-new.gif");
+ public static final ImageDescriptor REPO_MIDDLE =
repo.create("repository-middle.gif");
+ public static final Image REPO_MIDDLE_IMG =
repo.getImage("repository-middle.gif");
+ public static final ImageDescriptor QUERY = repo.create("query.gif");
+ public static final Image QUERY_IMG = repo.getImage("query.gif");
+ public static final ImageDescriptor TASK_REPO =
repo.create("task-repository.gif");
+ public static final Image TASK_REPO_IMG =
repo.getImage("task-repository.gif");
+ public static final ImageDescriptor SYSTEM_PROCESS =
repo.create("systemprocess.gif");
+ public static final Image SYSTEM_PROCESS_IMG =
repo.getImage("systemprocess.gif");
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftUIActivator.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftUIActivator.java 2012-05-21
12:15:10 UTC (rev 41205)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenShiftUIActivator.java 2012-05-21
12:15:52 UTC (rev 41206)
@@ -92,30 +92,4 @@
public static IStatus createErrorStatus(String message, Throwable throwable, Object...
arguments) {
return createErrorStatus(NLS.bind(message, arguments), throwable);
}
-
-
- /**
- * Creates an image by loading it from a file in the plugin's images
- * directory.
- *
- * @param imagePath path to the image, relative to the /icons directory of the plugin
- * @return The image object loaded from the image file
- */
- public final Image createImage(final String imagePath) {
- return createImageDescriptor(imagePath).createImage();
- }
-
- /**
- * Creates an image descriptor by loading it from a file in the plugin's images
- * directory.
- *
- * @param imagePath path to the image, relative to the /icons directory of the plugin
- * @return The image object loaded from the image file
- */
- public final ImageDescriptor createImageDescriptor(final String imagePath) {
- IPath imageFilePath = new Path("/icons/" + imagePath);
- URL imageFileUrl = FileLocator.find(this.getBundle(), imageFilePath, null);
- return ImageDescriptor.createFromURL(imageFileUrl);
- }
-
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateApplicationAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateApplicationAction.java 2012-05-21
12:15:10 UTC (rev 41205)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateApplicationAction.java 2012-05-21
12:15:52 UTC (rev 41206)
@@ -17,9 +17,8 @@
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.navigator.CommonViewer;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftImages;
import
org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import
org.jboss.tools.openshift.express.internal.ui.wizard.NewOpenShiftExpressApplicationWizard;
@@ -38,7 +37,7 @@
*/
public CreateApplicationAction() {
super(OpenShiftExpressUIMessages.CREATE_APPLICATION_ACTION);
- setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("query-new.gif"));
+ setImageDescriptor(OpenShiftImages.QUERY_NEW);
}
/**
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateOrEditDomainAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateOrEditDomainAction.java 2012-05-21
12:15:10 UTC (rev 41205)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateOrEditDomainAction.java 2012-05-21
12:15:52 UTC (rev 41206)
@@ -17,7 +17,7 @@
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftImages;
import
org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import org.jboss.tools.openshift.express.internal.ui.wizard.EditDomainDialog;
@@ -32,7 +32,7 @@
public CreateOrEditDomainAction() {
super(OpenShiftExpressUIMessages.CREATE_OR_EDIT_DOMAIN_ACTION);
- setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("edit.gif"));
+ setImageDescriptor(OpenShiftImages.EDIT);
}
@Override
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateServerAdapterAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateServerAdapterAction.java 2012-05-21
12:15:10 UTC (rev 41205)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/CreateServerAdapterAction.java 2012-05-21
12:15:52 UTC (rev 41206)
@@ -31,6 +31,7 @@
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
import org.jboss.tools.openshift.express.internal.core.console.UserModel;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftImages;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import
org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
@@ -48,7 +49,7 @@
public CreateServerAdapterAction() {
super(OpenShiftExpressUIMessages.CREATE_SERVER_ADAPTER_ACTION, true);
- setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("edit.gif"));
+ setImageDescriptor(OpenShiftImages.EDIT);
}
@Override
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java 2012-05-21
12:15:10 UTC (rev 41205)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/EditCartridgesAction.java 2012-05-21
12:15:52 UTC (rev 41206)
@@ -16,7 +16,7 @@
import org.jboss.tools.common.ui.WizardUtils;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
import org.jboss.tools.openshift.express.internal.core.console.UserModel;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftImages;
import
org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
import org.jboss.tools.openshift.express.internal.ui.wizard.EmbedCartridgeWizard;
@@ -29,7 +29,7 @@
public EditCartridgesAction() {
super(OpenShiftExpressUIMessages.EDIT_CARTRIDGES_ACTION, true);
- setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("task-repository-new.gif"));
+ setImageDescriptor(OpenShiftImages.TASK_REPO_NEW);
}
@Override
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java 2012-05-21
12:15:10 UTC (rev 41205)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ImportApplicationAction.java 2012-05-21
12:15:52 UTC (rev 41206)
@@ -17,7 +17,7 @@
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftImages;
import
org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
import
org.jboss.tools.openshift.express.internal.ui.wizard.ImportOpenShiftExpressApplicationWizard;
import
org.jboss.tools.openshift.express.internal.ui.wizard.OpenShiftExpressApplicationWizard;
@@ -31,7 +31,7 @@
public ImportApplicationAction() {
super(OpenShiftExpressUIMessages.IMPORT_APPLICATION_ACTION, true);
- setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("go-into.gif"));
+ setImageDescriptor(OpenShiftImages.GO_INTO);
}
@Override
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenInWebBrowserAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenInWebBrowserAction.java 2012-05-21
12:15:10 UTC (rev 41205)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenInWebBrowserAction.java 2012-05-21
12:15:52 UTC (rev 41206)
@@ -12,6 +12,7 @@
import org.eclipse.jface.viewers.ITreeSelection;
import org.jboss.tools.common.ui.BrowserUtil;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftImages;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import
org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
@@ -24,7 +25,7 @@
public OpenInWebBrowserAction() {
super(OpenShiftExpressUIMessages.SHOW_IN_BROWSER_ACTION, true);
- setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("open-browser.gif"));
+ setImageDescriptor(OpenShiftImages.OPEN_BROWSER);
}
/**
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/RefreshElementAction.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/RefreshElementAction.java 2012-05-21
12:15:10 UTC (rev 41205)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/RefreshElementAction.java 2012-05-21
12:15:52 UTC (rev 41206)
@@ -19,7 +19,7 @@
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftImages;
import
org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
@@ -33,7 +33,7 @@
public RefreshElementAction() {
super(OpenShiftExpressUIMessages.REFRESH_USER_ACTION, true);
- setImageDescriptor(OpenShiftUIActivator.getDefault().createImageDescriptor("refresh.gif"));
+ setImageDescriptor(OpenShiftImages.REFRESH);
}
/*
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/OpenShiftExpressConsoleLabelProvider.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/OpenShiftExpressConsoleLabelProvider.java 2012-05-21
12:15:10 UTC (rev 41205)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/OpenShiftExpressConsoleLabelProvider.java 2012-05-21
12:15:52 UTC (rev 41206)
@@ -18,7 +18,7 @@
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftImages;
import
org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
import
org.jboss.tools.openshift.express.internal.ui.viewer.OpenShiftExpressConsoleContentProvider.LoadingStub;
import
org.jboss.tools.openshift.express.internal.ui.viewer.OpenShiftExpressConsoleContentProvider.NotConnectedUserStub;
@@ -59,16 +59,16 @@
@Override
public Image getImage(Object element) {
if (element instanceof UserDelegate) {
- return
OpenShiftUIActivator.getDefault().createImage("repository-middle.gif");
+ return OpenShiftImages.REPO_MIDDLE_IMG;
}
if (element instanceof IApplication) {
- return OpenShiftUIActivator.getDefault().createImage("query.gif");
+ return OpenShiftImages.QUERY_IMG;
}
if (element instanceof IEmbeddedCartridge) {
- return
OpenShiftUIActivator.getDefault().createImage("task-repository.gif");
+ return OpenShiftImages.TASK_REPO_IMG;
}
if (element instanceof LoadingStub) {
- return OpenShiftUIActivator.getDefault().createImage("systemprocess.gif");
+ return OpenShiftImages.SYSTEM_PROCESS_IMG;
}
if (element instanceof OpenShiftException ) {
return
PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);