Author: dazarov
Date: 2012-10-16 19:55:58 -0400 (Tue, 16 Oct 2012)
New Revision: 44545
Added:
trunk/common/plugins/org.jboss.tools.common.ui/icons/JavaServiceProvider.png
trunk/common/plugins/org.jboss.tools.common.ui/icons/wizard/
trunk/common/plugins/org.jboss.tools.common.ui/icons/wizard/JavaServiceProviderWizBan.png
trunk/common/plugins/org.jboss.tools.common.ui/icons/wizard/NewJavaServiceProviderWizBan.png
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/ModelUIImages.java
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/plugin.xml
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/CommonUIMessages.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/wizard/service/NewServiceWizardPage.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/wizard/service/RegisterAsServiceDialog.java
Log:
New icons for New Service Provider Wizard JBIDE-12866
Added: trunk/common/plugins/org.jboss.tools.common.ui/icons/JavaServiceProvider.png
===================================================================
(Binary files differ)
Property changes on:
trunk/common/plugins/org.jboss.tools.common.ui/icons/JavaServiceProvider.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
trunk/common/plugins/org.jboss.tools.common.ui/icons/wizard/JavaServiceProviderWizBan.png
===================================================================
(Binary files differ)
Property changes on:
trunk/common/plugins/org.jboss.tools.common.ui/icons/wizard/JavaServiceProviderWizBan.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
trunk/common/plugins/org.jboss.tools.common.ui/icons/wizard/NewJavaServiceProviderWizBan.png
===================================================================
(Binary files differ)
Property changes on:
trunk/common/plugins/org.jboss.tools.common.ui/icons/wizard/NewJavaServiceProviderWizBan.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/common/plugins/org.jboss.tools.common.ui/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/plugin.xml 2012-10-16 21:41:24 UTC (rev
44544)
+++ trunk/common/plugins/org.jboss.tools.common.ui/plugin.xml 2012-10-16 23:55:58 UTC (rev
44545)
@@ -63,7 +63,7 @@
<wizard
category="org.eclipse.jdt.ui.java"
class="org.jboss.tools.common.ui.wizard.service.NewServiceCreationWizard"
- icon="platform:/plugin/org.jboss.tools.common.ui/icons/service.png"
+
icon="platform:/plugin/org.jboss.tools.common.ui/icons/JavaServiceProvider.png"
id="org.jboss.tools.common.ui.wizard.service.NewServiceCreationWizard"
name="Service Provider"
project="false">
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/CommonUIMessages.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/CommonUIMessages.java 2012-10-16
21:41:24 UTC (rev 44544)
+++
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/CommonUIMessages.java 2012-10-16
23:55:58 UTC (rev 44545)
@@ -101,6 +101,8 @@
public static String REGISTER_AS_SERVICE_TYPE_LABEL;
public static String REGISTER_AS_SERVICE_NON_ABSTRACT_MESSAGE;
public static String REGISTER_AS_SERVICE_ALREADY_REGISTERED_MESSAGE;
+ public static String IMAGESBASE_URL_FOR_IMAGE_REGISTRY_CANNOT_BE_NULL;
+ public static String IMAGESIMAGE_NAME_CANNOT_BE_NULL;
static {
NLS.initializeMessages(BUNDLE_NAME, CommonUIMessages.class);
Added:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/ModelUIImages.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/ModelUIImages.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/ModelUIImages.java 2012-10-16
23:55:58 UTC (rev 44545)
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.ui;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.ui.CommonUIPlugin;
+
+public class ModelUIImages {
+
+ private static ModelUIImages INSTANCE;
+
+ static {
+ try {
+ INSTANCE = new ModelUIImages(new
URL(CommonUIPlugin.getDefault().getBundle().getEntry("/"), "icons/"));
//$NON-NLS-1$ //$NON-NLS-2$
+ } catch (MalformedURLException e) {
+ CommonUIPlugin.getDefault().logError(e);
+ }
+ }
+
+ public static final String JAVA_SERVICE_PROVIDER_IMAGE =
"wizard/JavaServiceProviderWizBan.png"; //$NON-NLS-1$
+ public static final String NEW_JAVA_SERVICE_PROVIDER_IMAGE =
"wizard/NewJavaServiceProviderWizBan.png"; //$NON-NLS-1$
+
+ public static Image getImage(ImageDescriptor descriptor) {
+ return CommonUIPlugin.getImageDescriptorRegistry().get(descriptor);
+ }
+
+ public static Image getImage(String key) {
+ return INSTANCE.createImageDescriptor(key).createImage();
+ }
+
+ public static ImageDescriptor getImageDescriptor(String key) {
+ return INSTANCE.createImageDescriptor(key);
+ }
+
+ public static void setImageDescriptors(IAction action, String iconName) {
+ action.setImageDescriptor(INSTANCE.createImageDescriptor(iconName));
+ }
+
+ public static ModelUIImages getInstance() {
+ return INSTANCE;
+ }
+
+ private URL baseUrl;
+ private ModelUIImages parentRegistry;
+
+ protected ModelUIImages(URL registryUrl, ModelUIImages parent){
+ if(registryUrl == null) throw new
IllegalArgumentException(CommonUIMessages.IMAGESBASE_URL_FOR_IMAGE_REGISTRY_CANNOT_BE_NULL);
+ baseUrl = registryUrl;
+ parentRegistry = parent;
+ }
+
+ protected ModelUIImages(URL url){
+ this(url,null);
+ }
+
+ public Image getImageByFileName(String key) {
+ return createImageDescriptor(key).createImage();
+ }
+
+ public ImageDescriptor createImageDescriptor(String key) {
+ try {
+ return ImageDescriptor.createFromURL(makeIconFileURL(key));
+ } catch (MalformedURLException e) {
+ if(parentRegistry == null) {
+ return ImageDescriptor.getMissingImageDescriptor();
+ } else {
+ return parentRegistry.createImageDescriptor(key);
+ }
+ }
+ }
+
+ private URL makeIconFileURL(String name) throws MalformedURLException {
+ if (name == null) throw new
MalformedURLException(CommonUIMessages.IMAGESIMAGE_NAME_CANNOT_BE_NULL);
+ return new URL(baseUrl, name);
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/ModelUIImages.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties 2012-10-16
21:41:24 UTC (rev 44544)
+++
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties 2012-10-16
23:55:58 UTC (rev 44545)
@@ -59,3 +59,6 @@
REGISTER_AS_SERVICE_TYPE_LABEL=Service Type:
REGISTER_AS_SERVICE_NON_ABSTRACT_MESSAGE=The use of a non-abstract type as a service type
is discouraged.
REGISTER_AS_SERVICE_ALREADY_REGISTERED_MESSAGE=This type is already registered for the
selected service type.
+IMAGESBASE_URL_FOR_IMAGE_REGISTRY_CANNOT_BE_NULL=Base url for image registry cannot be
null.
+IMAGESIMAGE_NAME_CANNOT_BE_NULL=Image name cannot be null.
+
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/wizard/service/NewServiceWizardPage.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/wizard/service/NewServiceWizardPage.java 2012-10-16
21:41:24 UTC (rev 44544)
+++
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/wizard/service/NewServiceWizardPage.java 2012-10-16
23:55:58 UTC (rev 44545)
@@ -47,6 +47,7 @@
import org.jboss.tools.common.ui.CommonUIMessages;
import org.jboss.tools.common.ui.CommonUIPlugin;
import org.jboss.tools.common.ui.IValidator;
+import org.jboss.tools.common.ui.ModelUIImages;
import org.jboss.tools.common.ui.widget.editor.ButtonFieldEditor.ButtonPressedAction;
import org.jboss.tools.common.ui.widget.editor.IFieldEditor;
import org.jboss.tools.common.ui.widget.editor.SwtFieldEditorFactory;
@@ -67,7 +68,7 @@
public NewServiceWizardPage() {
setTitle(CommonUIMessages.NEW_SERVICE_WIZARD_PAGE_NAME);
setDescription(CommonUIMessages.NEW_SERVICE_WIZARD_DESCRIPTION);
-// setImageDescriptor(CDIImages.getImageDescriptor(CDIImages.CDI_CLASS_IMAGE));
+ setImageDescriptor(ModelUIImages.getImageDescriptor(ModelUIImages.NEW_JAVA_SERVICE_PROVIDER_IMAGE));
}
public void init(IStructuredSelection selection) {
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/wizard/service/RegisterAsServiceDialog.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/wizard/service/RegisterAsServiceDialog.java 2012-10-16
21:41:24 UTC (rev 44544)
+++
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/wizard/service/RegisterAsServiceDialog.java 2012-10-16
23:55:58 UTC (rev 44545)
@@ -29,6 +29,7 @@
import org.jboss.tools.common.java.ParametedTypeFactory;
import org.jboss.tools.common.ui.CommonUIMessages;
import org.jboss.tools.common.ui.CommonUIPlugin;
+import org.jboss.tools.common.ui.ModelUIImages;
import org.jboss.tools.common.ui.widget.editor.IFieldEditor;
import org.jboss.tools.common.ui.widget.editor.IFieldEditorFactory;
@@ -71,7 +72,7 @@
protected Control createDialogArea(Composite parent) {
getShell().setText(CommonUIMessages.REGISTER_AS_SERVICE_TITLE);
setTitle(NLS.bind(CommonUIMessages.REGISTER_AS_SERVICE_SUB_TITLE,
type.getFullyQualifiedName()));
-// setTitleImage(ModelUIImages.getImage(ModelUIImages.WIZARD_DEFAULT)); // image is
managed by registry
+ setTitleImage(ModelUIImages.getImage(ModelUIImages.JAVA_SERVICE_PROVIDER_IMAGE)); //
image is managed by registry
setMessage(CommonUIMessages.REGISTER_AS_SERVICE_MESSAGE);
if(types.isEmpty()) {
setErrorMessage(CommonUIMessages.REGISTER_AS_SERVICE_NO_TYPES_MESSAGE);