[jboss-cvs] jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui ...
Robert Stryker
rob.stryker at jboss.com
Mon Apr 16 13:56:53 EDT 2007
User: rawb
Date: 07/04/16 13:56:53
Added: core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui
PackagesUIMessages.java PackagesUIPlugin.java
PackagesUIMessages.properties
PackageNodeFactory.java ExtensionManager.java
PrefsInitializer.java NodeContribution.java
PackagesSharedImages.java
Log:
Complete rewrite of the the two plugins leading to a cleaner, leaner project.
Revision Changes Path
1.9 +0 -0 jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/PackagesUIMessages.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PackagesUIMessages.java
===================================================================
RCS file: PackagesUIMessages.java
diff -N PackagesUIMessages.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ PackagesUIMessages.java 16 Apr 2007 17:56:53 -0000 1.9
@@ -0,0 +1,89 @@
+package org.jboss.ide.eclipse.packages.ui;
+
+import org.eclipse.osgi.util.NLS;
+
+public class PackagesUIMessages extends NLS {
+ public static final String BUNDLE_NAME = "org.jboss.ide.eclipse.packages.ui.PackagesUIMessages";
+
+ public static String NewJARWizard_windowTitle;
+ public static String NewJARWizard_windowTitle_editJAR;
+
+ public static String PackageInfoWizardPage_compressedButton_label;
+ public static String PackageInfoWizardPage_customManifest_label;
+ public static String PackageInfoWizardPage_destination_label;
+ public static String PackageInfoWizardPage_error_noManifest;
+ public static String PackageInfoWizardPage_error_noPackageName;
+ public static String PackageInfoWizardPage_error_packageAlreadyExists;
+ public static String PackageInfoWizardPage_error_noDestination;
+ public static String PackageInfoWizardPage_explodedButton_label;
+ public static String PackageInfoWizardPage_infoGroup_label;
+ public static String PackageInfoWizardPage_manifestBrowseButton_label;
+ public static String PackageInfoWizardPage_message;
+ public static String PackageInfoWizardPage_packageName_label;
+ public static String PackageInfoWizardPage_packageTypeGroup_label;
+ public static String PackageInfoWizardPage_title;
+
+ public static String PackageNodeDestinationComposite_destinationBrowseButton_label;
+
+ public static String PackageDestinationComposite_filesystemBrowseButton_label;
+ public static String PackageDestinationComposite_workspaceBrowseButton_label;
+
+ public static String PackageNodeDestinationDialog_filesetLabel;
+ public static String PackageNodeDestinationDialog_folderLabel;
+ public static String PackageNodeDestinationDialog_messagePrefix;
+ public static String PackageNodeDestinationDialog_packageLabel;
+ public static String PackageNodeDestinationDialog_title;
+
+ public static String PackagesLabelProvider_filesetProperty_destination;
+ public static String PackagesLabelProvider_filesetProperty_dir;
+ public static String PackagesLabelProvider_filesetProperty_excludes;
+ public static String PackagesLabelProvider_filesetProperty_file;
+ public static String PackagesLabelProvider_filesetProperty_includes;
+ public static String PackagesLabelProvider_filesetProperty_project;
+ public static String PackagesLabelProvider_filesetProperty_sourceFolder;
+
+ public static String ProjectPackagesView_noProjectSelectedMessage;
+ public static String ProjectPackagesView_noPackagesDefinedMessage;
+ public static String ProjectPackagesView_createPackagesMessage;
+ public static String ProjectPackagesView_newFolderAction_label;
+ public static String ProjectPackagesView_newFilesetAction_label;
+ public static String ProjectPackagesView_collapseAllAction_label;
+ public static String ProjectPackagesView_deletePackageAction_label;
+ public static String ProjectPackagesView_editPackageAction_label;
+ public static String ProjectPackagesView_newPackageMenu_label;
+ public static String ProjectPackagesView_editFolderAction_label;
+ public static String ProjectPackagesView_deleteFolderAction_label;
+ public static String ProjectPackagesView_editFilesetAction_label;
+ public static String ProjectPackagesView_deleteFilesetAction_label;
+ public static String ProjectPackagesView_createFolderDialog_title;
+ public static String ProjectPackagesView_createFolderDialog_message;
+ public static String ProjectPackagesView_createFolderDialog_warnFolderExists;
+
+ public static String FilesetInfoWizardPage_new_message;
+ public static String FilesetInfoWizardPage_new_title;
+ public static String FilesetInfoWizardPage_edit_message;
+ public static String FilesetInfoWizardPage_edit_title;
+ public static String FilesetInfoWizardPage_infoGroup_title;
+ public static String FilesetInfoWizardPage_destination_label;
+ public static String FilesetInfoWizardPage_multipleFilesButton_label;
+ public static String FilesetInfoWizardPage_singleFileButton_label;
+ public static String FilesetInfoWizardPage_rootProject_label;
+ public static String FilesetInfoWizardPage_rootDirectory_label;
+ public static String FilesetInfoWizardPage_rootDirWorkspaceBrowseButton_label;
+ public static String FilesetInfoWizardPage_rootDirFilesystemBrowseButton_label;
+ public static String FilesetInfoWizardPage_includes_label;
+ public static String FilesetInfoWizardPage_excludes_label;
+ public static String FilesetInfoWizardPage_singleFileProject_label;
+ public static String FilesetInfoWizardPage_singleFile_label;
+ public static String FilesetInfoWizardPage_fileWorkspaceBrowseButton_label;
+ public static String FilesetInfoWizardPage_fileFilesystemBrowseButton_label;
+ public static String FilesetInfoWizardPage_previewGroup_label;
+ public static String FilesetInfoWizardPage_noProjectMessage;
+ public static String FilesetInfoWizardPage_rootDirWorkspaceBrowser_message;
+ public static String FilesetInfoWizardPage_fileWorkspaceBrowser_title;
+ public static String FilesetInfoWizardPage_fileWorkspaceBrowser_message;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, PackagesUIMessages.class);
+ }
+}
1.8 +3 -92 jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/PackagesUIPlugin.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PackagesUIPlugin.java
===================================================================
RCS file: PackagesUIPlugin.java
diff -N PackagesUIPlugin.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ PackagesUIPlugin.java 16 Apr 2007 17:56:53 -0000 1.8
@@ -0,0 +1,56 @@
+package org.jboss.ide.eclipse.packages.ui;
+
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class PackagesUIPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.ide.eclipse.packages.ui";
+
+ // The shared instance
+ private static PackagesUIPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public PackagesUIPlugin() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static PackagesUIPlugin getDefault() {
+ return plugin;
+ }
+
+
+
+ protected void initializeImageRegistry(ImageRegistry registry) {
+ PackagesSharedImages.register(registry);
+ }
+}
1.9 +0 -0 jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/PackagesUIMessages.properties
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PackagesUIMessages.properties
===================================================================
RCS file: PackagesUIMessages.properties
diff -N PackagesUIMessages.properties
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ PackagesUIMessages.properties 16 Apr 2007 17:56:53 -0000 1.9
@@ -0,0 +1,78 @@
+ProjectPackagesView_noProjectSelectedMessage=Please select a project or resource
+ProjectPackagesView_noPackagesDefinedMessage=No packages have been defined for the project "{0}".
+ProjectPackagesView_createPackagesMessage=Create a Package:
+ProjectPackagesView_newPackageMenu_label=New Package
+ProjectPackagesView_newFolderAction_label=New Folder
+ProjectPackagesView_newFilesetAction_label=New Fileset
+ProjectPackagesView_collapseAllAction_label=Collapse All
+ProjectPackagesView_deletePackageAction_label=Delete Package
+ProjectPackagesView_deleteFilesetAction_label=Delete Fileset
+ProjectPackagesView_deleteFolderAction_label=Delete Folder
+ProjectPackagesView_editPackageAction_label=Edit Package
+ProjectPackagesView_editFolderAction_label=Edit Folder
+ProjectPackagesView_editFilesetAction_label=Edit Fileset
+ProjectPackagesView_createFolderDialog_title=Create a folder
+ProjectPackagesView_createFolderDialog_message=Name of the folder to create
+ProjectPackagesView_createFolderDialog_warnFolderExists=The folder "{0}" already exists.
+
+FilesetInfoWizardPage_new_message=Create a new fileset consisting of one or more files
+FilesetInfoWizardPage_new_title=New Fileset
+FilesetInfoWizardPage_edit_message=Edit an existing fileset
+FilesetInfoWizardPage_edit_title=Edit Fileset
+FilesetInfoWizardPage_infoGroup_title=Fileset information
+FilesetInfoWizardPage_destination_label=Destination:
+FilesetInfoWizardPage_multipleFilesButton_label=Create a fileset that has multiple files
+FilesetInfoWizardPage_singleFileButton_label=Create a fileset that has just one file
+FilesetInfoWizardPage_rootProject_label=Root project:
+FilesetInfoWizardPage_rootDirectory_label=Root directory:
+FilesetInfoWizardPage_rootDirWorkspaceBrowseButton_label=Workspace...
+FilesetInfoWizardPage_rootDirFilesystemBrowseButton_label=Filesystem...
+FilesetInfoWizardPage_includes_label=Includes:
+FilesetInfoWizardPage_excludes_label=Excludes:
+FilesetInfoWizardPage_singleFileProject_label=Project:
+FilesetInfoWizardPage_singleFile_label=File:
+FilesetInfoWizardPage_fileWorkspaceBrowseButton_label=Workspace...
+FilesetInfoWizardPage_fileFilesystemBrowseButton_label=Filesystem...
+FilesetInfoWizardPage_previewGroup_label=Preview
+FilesetInfoWizardPage_noProjectMessage=N/A
+FilesetInfoWizardPage_rootDirWorkspaceBrowser_message=Select a root directory for this fileset
+FilesetInfoWizardPage_fileWorkspaceBrowser_title=Select file
+FilesetInfoWizardPage_fileWorkspaceBrowser_message=Select a file for this fileset
+
+PackageInfoWizardPage_title=Create a new package
+PackageInfoWizardPage_message=Create a new package consisting of filesets in the workspace.
+PackageInfoWizardPage_infoGroup_label=Package information
+PackageInfoWizardPage_packageName_label=Package name:
+PackageInfoWizardPage_destination_label=Destination:
+PackageInfoWizardPage_customManifest_label=Custom Manifest:
+PackageInfoWizardPage_manifestBrowseButton_label=Browse...
+PackageInfoWizardPage_packageTypeGroup_label=Package type
+PackageInfoWizardPage_compressedButton_label=Standard package using zip compression
+PackageInfoWizardPage_explodedButton_label=Exploded package resulting in a folder (no compression)
+PackageInfoWizardPage_error_noPackageName=Please enter a package name
+PackageInfoWizardPage_error_noManifest=Please select a Manifest
+PackageInfoWizardPage_error_packageAlreadyExists=The package "{0}" already exists.
+PackageInfoWizardPage_error_noDestination=There is no destination selected for this package.
+
+PackageNodeDestinationComposite_destinationBrowseButton_label=Browse...
+
+PackageDestinationComposite_filesystemBrowseButton_label=Filesystem...
+PackageDestinationComposite_workspaceBrowseButton_label=Workspace...
+
+NewJARWizard_windowTitle=New JAR
+NewJARWizard_windowTitle_editJAR=Edit Package
+
+PackagesLabelProvider_filesetProperty_destination=Destination :
+PackagesLabelProvider_filesetProperty_sourceFolder=Source Folder :
+PackagesLabelProvider_filesetProperty_excludes=Excludes :
+PackagesLabelProvider_filesetProperty_includes=Includes :
+PackagesLabelProvider_filesetProperty_project=Project :
+PackagesLabelProvider_filesetProperty_file=File :
+
+PackagesLabelProvider_filesetProperty_dir=Dir :
+
+PackageNodeDestinationDialog_messagePrefix=Please select a destination for this
+PackageNodeDestinationDialog_packageLabel=package
+PackageNodeDestinationDialog_filesetLabel=fileset
+PackageNodeDestinationDialog_folderLabel=folder
+PackageNodeDestinationDialog_title=Select a destination
\ No newline at end of file
1.1 date: 2007/04/16 17:56:53; author: rawb; state: Exp;jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/PackageNodeFactory.java
Index: PackageNodeFactory.java
===================================================================
package org.jboss.ide.eclipse.packages.ui;
import org.jboss.ide.eclipse.packages.core.model.IPackage;
import org.jboss.ide.eclipse.packages.core.model.IPackageFileSet;
import org.jboss.ide.eclipse.packages.core.model.IPackageFolder;
import org.jboss.ide.eclipse.packages.core.model.internal.PackageFileSetImpl;
import org.jboss.ide.eclipse.packages.core.model.internal.PackageFolderImpl;
import org.jboss.ide.eclipse.packages.core.model.internal.PackageImpl;
public class PackageNodeFactory {
public static IPackage createPackage() {
return new PackageImpl();
}
public static IPackageFileSet createFileset() {
return new PackageFileSetImpl();
}
public static IPackageFolder createFolder() {
return new PackageFolderImpl();
}
}
1.6 +18 -10 jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/ExtensionManager.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ExtensionManager.java
===================================================================
RCS file: ExtensionManager.java
diff -N ExtensionManager.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ExtensionManager.java 16 Apr 2007 17:56:53 -0000 1.6
@@ -0,0 +1,64 @@
+package org.jboss.ide.eclipse.packages.ui;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.ide.eclipse.packages.ui.actions.NewPackageAction;
+
+public class ExtensionManager {
+ public static final String NODE_POPUP_MENUS_EXTENSION_ID = "org.jboss.ide.eclipse.packages.ui.nodePopupMenus";
+ public static final String NEW_PACKAGE_ACTIONS_EXTENSION_ID = "org.jboss.ide.eclipse.packages.ui.newPackageActions";
+
+ private NewPackageAction[] newPackageActions;
+ private NodeContribution[] nodeContributions;
+ public NewPackageAction[] getNewPackageActions() {
+ if( newPackageActions == null )
+ newPackageActions = findNewPackageActions();
+ return newPackageActions;
+ }
+ public NodeContribution[] getNodeContributions() {
+ if( nodeContributions == null )
+ nodeContributions = findNodePopupMenuContributions();
+ return nodeContributions;
+ }
+
+ public static IExtension[] findExtension (String extensionId) {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint extensionPoint = registry.getExtensionPoint(extensionId);
+ return extensionPoint.getExtensions();
+ }
+
+ public static NodeContribution[] findNodePopupMenuContributions () {
+ ArrayList contributions = new ArrayList();
+ IExtension[] extensions = findExtension(NODE_POPUP_MENUS_EXTENSION_ID);
+
+ for (int i = 0; i < extensions.length; i++) {
+ IConfigurationElement[] elements = extensions[i].getConfigurationElements();
+ for (int j = 0; j < elements.length; j++) {
+ contributions.add(new NodeContribution(elements[j]));
+ }
+ }
+
+ return (NodeContribution[]) contributions.toArray(new NodeContribution[contributions.size()]);
+ }
+
+ public static NewPackageAction[] findNewPackageActions () {
+ ArrayList contributions = new ArrayList();
+ IExtension[] extensions = findExtension(NEW_PACKAGE_ACTIONS_EXTENSION_ID);
+
+ for (int i = 0; i < extensions.length; i++)
+ {
+ IConfigurationElement[] elements = extensions[i].getConfigurationElements();
+ for (int j = 0; j < elements.length; j++)
+ {
+ contributions.add(new NewPackageAction(elements[j]));
+ }
+ }
+
+ return (NewPackageAction[]) contributions.toArray(new NewPackageAction[contributions.size()]);
+ }
+}
1.5 +11 -4 jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/PrefsInitializer.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PrefsInitializer.java
===================================================================
RCS file: PrefsInitializer.java
diff -N PrefsInitializer.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ PrefsInitializer.java 16 Apr 2007 17:56:53 -0000 1.5
@@ -0,0 +1,25 @@
+package org.jboss.ide.eclipse.packages.ui;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+
+public class PrefsInitializer extends AbstractPreferenceInitializer {
+
+
+ // preference keys
+ public static final String PREF_SHOW_PACKAGE_OUTPUT_PATH = "showPackageOutputPath";
+ public static final String PREF_SHOW_FULL_FILESET_ROOT_DIR = "showFullFilesetRootDir";
+ public static final String PREF_SHOW_PROJECT_ROOT = "showProjectRoot";
+ public static final String PREF_SHOW_ALL_PROJECTS = "showAllProjects";
+
+ public void initializeDefaultPreferences() {
+ IEclipsePreferences prefs = new DefaultScope().getNode(PackagesUIPlugin.PLUGIN_ID);
+
+ prefs.put(PREF_SHOW_FULL_FILESET_ROOT_DIR, "true");
+ prefs.put(PREF_SHOW_PACKAGE_OUTPUT_PATH, "true");
+ prefs.put(PREF_SHOW_PROJECT_ROOT, "true");
+ prefs.put(PREF_SHOW_ALL_PROJECTS, "false");
+ }
+
+}
1.5 +4 -32 jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/NodeContribution.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NodeContribution.java
===================================================================
RCS file: NodeContribution.java
diff -N NodeContribution.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ NodeContribution.java 16 Apr 2007 17:56:53 -0000 1.5
@@ -0,0 +1,75 @@
+package org.jboss.ide.eclipse.packages.ui;
+
+import java.net.URL;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.jboss.ide.eclipse.packages.core.Trace;
+import org.jboss.ide.eclipse.packages.ui.actions.INodeActionDelegate;
+import org.osgi.framework.Bundle;
+
+public class NodeContribution implements Comparable {
+ private String id, label;
+ private INodeActionDelegate actionDelegate;
+ private ImageDescriptor icon;
+ private int weight;
+
+ public NodeContribution (IConfigurationElement element) {
+ id = element.getAttribute("id");
+ label = element.getAttribute("label");
+
+ try {
+ actionDelegate = (INodeActionDelegate) element.createExecutableExtension("class");
+ } catch (CoreException e) {
+ Trace.trace(getClass(), e);
+ }
+
+ String iconPath = element.getAttribute("icon");
+ String pluginId = element.getDeclaringExtension().getNamespaceIdentifier();
+ Bundle bundle = Platform.getBundle(pluginId);
+ URL iconURL = FileLocator.find(bundle, new Path(iconPath), null);
+ if (iconURL == null) {
+ iconURL = bundle.getEntry(iconPath);
+ }
+ icon = ImageDescriptor.createFromURL(iconURL);
+
+ weight = Integer.parseInt(element.getAttribute("weight"));
+ }
+
+ public int compareTo(Object o) {
+ if (o instanceof NodeContribution) {
+ NodeContribution other = (NodeContribution) o;
+ if (weight < other.getWeight()) return -1;
+ else if (weight > other.getWeight()) return 1;
+ else if (weight == other.getWeight()) {
+ return label.compareTo(other.getLabel());
+ }
+ }
+ return -1;
+ }
+
+
+ public INodeActionDelegate getActionDelegate() {
+ return actionDelegate;
+ }
+
+ public ImageDescriptor getIcon() {
+ return icon;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public int getWeight() {
+ return weight;
+ }
+}
1.1 date: 2007/04/16 17:56:53; author: rawb; state: Exp;jbosside/core/plugins/org.jboss.ide.eclipse.packages.ui/src/main/org/jboss/ide/eclipse/packages/ui/PackagesSharedImages.java
Index: PackagesSharedImages.java
===================================================================
package org.jboss.ide.eclipse.packages.ui;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
public class PackagesSharedImages {
// image ids
public static final String IMG_PACKAGE = "icons/jar_obj.gif";
public static final String IMG_PACKAGE_EXPLODED = "icons/jar_exploded_obj.gif";
public static final String IMG_EXTERNAL_FILE = "icons/ext_file_obj.gif";
public static final String IMG_EXTERNAL_FOLDER = "icons/ext_folder_obj.gif";
public static final String IMG_INCLUDES = "icons/includes.gif";
public static final String IMG_EXCLUDES = "icons/excludes.gif";
public static final String IMG_NEW_PACKAGE = "icons/new_package.gif";
public static final String IMG_NEW_JAR_WIZARD = "icons/new_jar_wiz.png";
public static final String IMG_SINGLE_FILE = "icons/single_file.gif";
public static final String IMG_MULTIPLE_FILES = "icons/multiple_files.gif";
public static final String IMG_COLLAPSE_ALL = "icons/collapseall.gif";
public static final String IMG_PACKAGE_EDIT = "icons/jar_src_obj.gif";
public static final String IMG_WAR = "icons/war.gif";
public static final String IMG_EAR = "icons/ear.gif";
public static final String IMG_EJB_JAR = "icons/EJBJar.gif";
public static final String IMG_NEW_WAR_WIZARD="icons/new_war_wiz.png";
public static final String IMG_NEW_EAR_WIZARD="icons/ear-wiz-banner.gif";
public static final String IMG_BUILD_PACKAGES = "icons/build_packages.gif";
public static void register(ImageRegistry registry) {
registerImages(registry, new String[] {
IMG_PACKAGE, IMG_PACKAGE_EXPLODED, IMG_EXTERNAL_FILE,
IMG_EXTERNAL_FOLDER, IMG_INCLUDES, IMG_EXCLUDES,
IMG_NEW_PACKAGE, IMG_NEW_JAR_WIZARD, IMG_SINGLE_FILE,
IMG_MULTIPLE_FILES, IMG_COLLAPSE_ALL, IMG_PACKAGE_EDIT,
IMG_EAR, IMG_EJB_JAR, IMG_WAR, IMG_NEW_EAR_WIZARD,
IMG_NEW_WAR_WIZARD, IMG_BUILD_PACKAGES
});
}
private static void registerImages (ImageRegistry reg, String ids[]) {
for (int i = 0; i < ids.length; i++)
reg.put(ids[i], AbstractUIPlugin.imageDescriptorFromPlugin(PackagesUIPlugin.PLUGIN_ID, ids[i]));
}
// helper methods
public static Image getImage (String id) {
return PackagesUIPlugin.getDefault().getImageRegistry().get(id);
}
public static ImageDescriptor getImageDescriptor (String id) {
return PackagesUIPlugin.getDefault().getImageRegistry().getDescriptor(id);
}
}
More information about the jboss-cvs-commits
mailing list