Author: rob.stryker(a)jboss.com
Date: 2008-09-24 19:11:44 -0400 (Wed, 24 Sep 2008)
New Revision: 10466
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/.settings/org.eclipse.jdt.core.prefs
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesSharedImages.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIBuildListener.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ExtensionManager.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/NodeContribution.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/PackagesUIPlugin.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/PrefsInitializer.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/BuildAction.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/INodeActionDelegate.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/NewArchiveAction.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/NewJARAction.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootContentProvider.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveFilesetDestinationComposite.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveNodeDestinationDialog.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveSourceDestinationComposite.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesCommonView.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/NewJARWizard.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/WizardPageWithNotification.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/WizardWithNotification.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/DefaultJARConfigWizardPage.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java
Log:
Archives UI NLS and headers
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/.settings/org.eclipse.jdt.core.prefs 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/.settings/org.eclipse.jdt.core.prefs 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,4 +1,4 @@
-#Wed Apr 18 14:55:21 EDT 2007
+#Wed Sep 24 18:31:23 EDT 2008
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
@@ -7,6 +7,64 @@
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.5
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesSharedImages.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesSharedImages.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesSharedImages.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -7,24 +17,24 @@
public class ArchivesSharedImages {
// 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 final String IMG_PACKAGE = "icons/jar_obj.gif"; //$NON-NLS-1$
+ public static final String IMG_PACKAGE_EXPLODED =
"icons/jar_exploded_obj.gif";//$NON-NLS-1$
+ public static final String IMG_EXTERNAL_FILE =
"icons/ext_file_obj.gif";//$NON-NLS-1$
+ public static final String IMG_EXTERNAL_FOLDER =
"icons/ext_folder_obj.gif";//$NON-NLS-1$
+ public static final String IMG_INCLUDES = "icons/includes.gif";//$NON-NLS-1$
+ public static final String IMG_EXCLUDES = "icons/excludes.gif";//$NON-NLS-1$
+ public static final String IMG_NEW_PACKAGE =
"icons/new_package.gif";//$NON-NLS-1$
+ public static final String IMG_NEW_JAR_WIZARD =
"icons/new_jar_wiz.png";//$NON-NLS-1$
+ public static final String IMG_SINGLE_FILE =
"icons/single_file.gif";//$NON-NLS-1$
+ public static final String IMG_MULTIPLE_FILES =
"icons/multiple_files.gif";//$NON-NLS-1$
+ public static final String IMG_COLLAPSE_ALL =
"icons/collapseall.gif";//$NON-NLS-1$
+ public static final String IMG_PACKAGE_EDIT =
"icons/jar_src_obj.gif";//$NON-NLS-1$
+ public static final String IMG_WAR = "icons/war.gif";//$NON-NLS-1$
+ public static final String IMG_EAR = "icons/ear.gif";//$NON-NLS-1$
+ public static final String IMG_EJB_JAR = "icons/EJBJar.gif";//$NON-NLS-1$
+ public static final String
IMG_NEW_WAR_WIZARD="icons/new_war_wiz.png";//$NON-NLS-1$
+ public static final String
IMG_NEW_EAR_WIZARD="icons/ear-wiz-banner.gif";//$NON-NLS-1$
+ public static final String IMG_BUILD_PACKAGES =
"icons/build_packages.gif";//$NON-NLS-1$
public static void register(ImageRegistry registry) {
registerImages(registry, new String[] {
@@ -36,7 +46,7 @@
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]));
@@ -46,7 +56,7 @@
public static Image getImage (String id) {
return PackagesUIPlugin.getDefault().getImageRegistry().get(id);
}
-
+
public static ImageDescriptor getImageDescriptor (String id) {
return PackagesUIPlugin.getDefault().getImageRegistry().getDescriptor(id);
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIBuildListener.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIBuildListener.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIBuildListener.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui;
import org.eclipse.core.runtime.IStatus;
@@ -23,17 +33,22 @@
import org.jboss.ide.eclipse.archives.core.model.AbstractBuildListener;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class ArchivesUIBuildListener extends AbstractBuildListener {
public void error(IArchiveNode node, final IStatus[] multi) {
- final MultiStatus ms = new MultiStatus(ArchivesCore.PLUGIN_ID, 0, "Error during
build", null);
+ final MultiStatus ms = new MultiStatus(ArchivesCore.PLUGIN_ID, 0,
ArchivesUIMessages.BuildError, null);
for( int i = 0; i < multi.length; i++ ) {
ms.add(multi[i]);
}
if( PrefsInitializer.getBoolean(PrefsInitializer.PREF_SHOW_BUILD_ERROR_DIALOG)) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
- ErrorDialog ed = new ErrorDialogWithPreference(new Shell(), "Error building
project archives", "Error building project archives", ms, IStatus.ERROR );
+ ErrorDialog ed = new ErrorDialogWithPreference(new Shell(),
ArchivesUIMessages.BuildError, ArchivesUIMessages.BuildError, ms, IStatus.ERROR );
ed.open();
}
} );
@@ -84,7 +99,7 @@
}
checkbox = new Button(composite, SWT.CHECK);
- checkbox.setText("Do not show this message again");
+ checkbox.setText(ArchivesUIMessages.DoNotShowThisAgain);
FormData fd = new FormData();
fd.top = new FormAttachment(messageLabel,5);
fd.left = new FormAttachment(0,5);
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui;
import org.eclipse.osgi.util.NLS;
@@ -3,9 +13,33 @@
public class ArchivesUIMessages extends NLS {
- public static final String BUNDLE_NAME =
"org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages";
+ public static String BuildError;
+ public static String DoNotShowThisAgain;
+ public static String BuildArchivesNode;
+ public static String SelectAProject;
+ public static String ProjectArchives;
+ public static String Loading;
+ public static String SelectionNotValid;
+ public static String Filesystem;
+ public static String Workspace;
+ public static String Variables;
+ public static String WorkspaceRelative;
+ public static String FilesystemRelative;
+ public static String PathDoesNotExistInFilesystem;
+ public static String ErrorConvertingPaths;
+ public static String ErrorStringSubstitution;
+ public static String ErrorCompletingWizard;
+ public static String FilesetWizard;
+ public static String DefaultJarConfiguration;
+ public static String Preview;
+ public static String UseDefaultJARConfiguration;
+ public static String Flatten;
+ public static String Yes;
+ public static String No;
+
+
public static String NewJARWizard_windowTitle;
public static String NewJARWizard_windowTitle_editJAR;
-
+
public static String PackageInfoWizardPage_compressedButton_label;
public static String PackageInfoWizardPage_destination_label;
@@ -25,7 +59,7 @@
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;
@@ -62,7 +96,7 @@
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;
@@ -86,12 +120,13 @@
public static String FilesetInfoWizardPage_rootDirWorkspaceBrowser_message;
public static String FilesetInfoWizardPage_fileWorkspaceBrowser_title;
public static String FilesetInfoWizardPage_fileWorkspaceBrowser_message;
-
+
/* Preference Page */
public static String PreferencePageTitle;
public static String ProjectSpecificSettings;
public static String CorePreferences;
public static String EnableIncrementalBuilder;
+ public static String ShowBuildErrorDialog;
public static String ProjectPackagesView;
public static String ShowFullOutputPath;
@@ -107,8 +142,8 @@
public static String Disable;
public static String MoveUp;
public static String MoveDown;
-
+
static {
- NLS.initializeMessages(BUNDLE_NAME, ArchivesUIMessages.class);
+ NLS.initializeMessages("org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages",
ArchivesUIMessages.class); //$NON-NLS-1$
}
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,29 @@
+BuildError=Error building project archives
+DoNotShowThisAgain=Do not show this message again.
+BuildArchivesNode=Build Archive Node
+SelectAProject=Please select a project
+ProjectArchives=Project Archives
+Loading=Loading...
+SelectionNotValid=Selection not valid.
+Filesystem=Filesystem...
+Workspace=Workspace...
+Variables=Variables...
+WorkspaceRelative=Workspace Relative
+FilesystemRelative=Filesystem Relative
+PathDoesNotExistInFilesystem={0} does not exist in the filesystem
+ErrorConvertingPaths=Unable to convert workspace path into global path: {0}
+ErrorStringSubstitution=Error during string substitution: {0}
+ErrorCompletingWizard=Error Completing Wizard
+FilesetWizard=Fileset Wizard
+DefaultJarConfiguration=Default JAR Configuration
+Preview=Preview
+UseDefaultJARConfiguration=Use default JAR configuration
+Flatten=Flatten?
+Yes=Yes
+No=No
+
+
+
ProjectPackagesView_noProjectSelectedMessage=Please select an opened project or
resource.
ProjectPackagesView_noPackagesDefinedMessage=No archives have been defined for the
project "{0}".
ProjectPackagesView_createPackagesMessage=Project has no defined archives. Create an
Archive:
@@ -65,16 +91,16 @@
NewJARWizard_windowTitle=New JAR
NewJARWizard_windowTitle_editJAR=Edit Archive
-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_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 :
+PackagesLabelProvider_filesetProperty_dir=Dir :
-PackageNodeDestinationDialog_messagePrefix=Please select a destination for this
+PackageNodeDestinationDialog_messagePrefix=Please select a destination for this
PackageNodeDestinationDialog_packageLabel=archive
PackageNodeDestinationDialog_filesetLabel=fileset
PackageNodeDestinationDialog_folderLabel=folder
@@ -84,6 +110,7 @@
ProjectSpecificSettings=Enable Project Specific Settings
CorePreferences=Core Preferences
EnableIncrementalBuilder=Enable incremental builder
+ShowBuildErrorDialog=Show build error dialog
ProjectPackagesView=Project Packages View
ShowFullOutputPath=Show full output path next to packages.
ShowFullRootDirectory=Show the full root directory of filesets.
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ExtensionManager.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ExtensionManager.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ExtensionManager.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui;
import java.util.ArrayList;
@@ -9,9 +19,14 @@
import org.eclipse.core.runtime.Platform;
import org.jboss.ide.eclipse.archives.ui.actions.NewArchiveAction;
+/**
+ * The extension manager
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class ExtensionManager {
- public static final String NODE_POPUP_MENUS_EXTENSION_ID =
"org.jboss.ide.eclipse.archives.ui.nodePopupMenus";
- public static final String NEW_PACKAGE_ACTIONS_EXTENSION_ID =
"org.jboss.ide.eclipse.archives.ui.newArchiveActions";
+ public static final String NODE_POPUP_MENUS_EXTENSION_ID =
"org.jboss.ide.eclipse.archives.ui.nodePopupMenus"; //$NON-NLS-1$
+ public static final String NEW_PACKAGE_ACTIONS_EXTENSION_ID =
"org.jboss.ide.eclipse.archives.ui.newArchiveActions"; //$NON-NLS-1$
private NewArchiveAction[] newArchiveActions;
private NodeContribution[] nodeContributions;
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/NodeContribution.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/NodeContribution.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/NodeContribution.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui;
import java.net.URL;
@@ -11,23 +21,34 @@
import org.jboss.ide.eclipse.archives.ui.actions.INodeActionDelegate;
import org.osgi.framework.Bundle;
+/**
+ * This represents a menu element to be shown in the archives view
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class NodeContribution implements Comparable {
+ private static final String ID = "id"; //$NON-NLS-1$
+ private static final String LABEL = "label"; //$NON-NLS-1$
+ private static final String ICON = "icon"; //$NON-NLS-1$
+ private static final String WEIGHT = "weight"; //$NON-NLS-1$
+ private static final String CLASS = "class"; //$NON-NLS-1$
+
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");
-
+ id = element.getAttribute(ID);
+ label = element.getAttribute(LABEL);
+
try {
- actionDelegate = (INodeActionDelegate)
element.createExecutableExtension("class");
+ actionDelegate = (INodeActionDelegate) element.createExecutableExtension(CLASS);
} catch (CoreException e) {
//TODO Trace.trace(getClass(), e);
}
-
- String iconPath = element.getAttribute("icon");
+
+ String iconPath = element.getAttribute(ICON);
String pluginId = element.getDeclaringExtension().getNamespaceIdentifier();
Bundle bundle = Platform.getBundle(pluginId);
URL iconURL = iconPath == null ? null : FileLocator.find(bundle, new Path(iconPath),
null);
@@ -35,10 +56,10 @@
iconURL = bundle.getEntry(iconPath);
icon = ImageDescriptor.createFromURL(iconURL);
}
- String weightString = element.getAttribute("weight");
- weight = Integer.parseInt(weightString == null ? "100" : weightString);
+ String weightString = element.getAttribute(WEIGHT);
+ weight = Integer.parseInt(weightString == null ? new Integer(100).toString() :
weightString);
}
-
+
public int compareTo(Object o) {
if (o instanceof NodeContribution) {
NodeContribution other = (NodeContribution) o;
@@ -51,7 +72,7 @@
return -1;
}
-
+
public INodeActionDelegate getActionDelegate() {
return actionDelegate;
}
@@ -67,7 +88,7 @@
public String getLabel() {
return label;
}
-
+
public int getWeight() {
return weight;
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/PackagesUIPlugin.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/PackagesUIPlugin.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/PackagesUIPlugin.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui;
import org.eclipse.jface.resource.ImageRegistry;
@@ -10,53 +20,31 @@
*/
public class PackagesUIPlugin extends AbstractUIPlugin {
- // The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.ide.eclipse.archives.ui";
-
-
-
- // The shared instance
+ public static final String PLUGIN_ID = "org.jboss.ide.eclipse.archives.ui";
//$NON-NLS-1$
private static PackagesUIPlugin plugin;
- /**
- * The constructor
- */
+ private ArchivesUIBuildListener buildListener;
public PackagesUIPlugin() {
plugin = this;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- private ArchivesUIBuildListener buildListener;
public void start(BundleContext context) throws Exception {
super.start(context);
buildListener = new ArchivesUIBuildListener();
ArchivesModel.instance().addBuildListener(buildListener);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
public void stop(BundleContext context) throws Exception {
ArchivesModel.instance().removeBuildListener(buildListener);
plugin = null;
super.stop(context);
}
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
+
public static PackagesUIPlugin getDefault() {
return plugin;
}
-
-
protected void initializeImageRegistry(ImageRegistry registry) {
ArchivesSharedImages.register(registry);
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/PrefsInitializer.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/PrefsInitializer.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/PrefsInitializer.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui;
import java.util.ArrayList;
@@ -17,11 +27,11 @@
// 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 static final String PREF_SHOW_BUILD_ERROR_DIALOG =
"showBuildErrorDialog";
+ public static final String PREF_SHOW_PACKAGE_OUTPUT_PATH =
"showPackageOutputPath"; //$NON-NLS-1$
+ public static final String PREF_SHOW_FULL_FILESET_ROOT_DIR =
"showFullFilesetRootDir";//$NON-NLS-1$
+ public static final String PREF_SHOW_PROJECT_ROOT =
"showProjectRoot";//$NON-NLS-1$
+ public static final String PREF_SHOW_ALL_PROJECTS =
"showAllProjects";//$NON-NLS-1$
+ public static final String PREF_SHOW_BUILD_ERROR_DIALOG =
"showBuildErrorDialog";//$NON-NLS-1$
public static final ArrayList<IArchivesPreferenceListener> listeners = new
ArrayList<IArchivesPreferenceListener>();
public static interface IArchivesPreferenceListener {
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/BuildAction.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/BuildAction.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/BuildAction.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.actions;
import org.eclipse.core.resources.IProject;
@@ -15,7 +25,13 @@
import org.jboss.ide.eclipse.archives.core.build.ArchiveBuildDelegate;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
+/**
+ * Fire off a build of the archives or project / resource selected
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class BuildAction implements IWorkbenchWindowActionDelegate {
private IProject selectedProject;
public void dispose() {
@@ -48,7 +64,7 @@
}
private void buildSelectedNode(final Object selected) {
- new Job("Build Archive Node") {
+ new Job(ArchivesUIMessages.BuildArchivesNode) {
// TODO actually get the status object
protected IStatus run(IProgressMonitor monitor) {
if( selected == null ) return Status.OK_STATUS;
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/INodeActionDelegate.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/INodeActionDelegate.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/INodeActionDelegate.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.actions;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
@@ -15,7 +25,7 @@
* @return Whether or not this action delegate will be enabled (viewable) for a specific
package node.
*/
public boolean isEnabledFor (IArchiveNode node);
-
+
/**
* Run this action delegate on the passed-in node
* @param node A package node
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/NewArchiveAction.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/NewArchiveAction.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/NewArchiveAction.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.actions;
import java.net.URL;
@@ -16,23 +26,27 @@
* This is an action wrapper. It wraps the extension point
*/
public class NewArchiveAction {
+ private static final String ID = "id"; //$NON-NLS-1$
+ private static final String LABEL = "label"; //$NON-NLS-1$
+ private static final String ICON = "icon"; //$NON-NLS-1$
+ private static final String CLASS = "class"; //$NON-NLS-1$
private String id, label;
private ImageDescriptor icon;
private Image iconImage;
private IActionDelegate action;
-
+
public NewArchiveAction(IConfigurationElement element) {
- id = element.getAttribute("id");
- label = element.getAttribute("label");
-
+ id = element.getAttribute(ID);
+ label = element.getAttribute(LABEL);
+
try {
- action = (IActionDelegate) element.createExecutableExtension("class");
+ action = (IActionDelegate) element.createExecutableExtension(CLASS);
} catch (CoreException e) {
- //TODO
+ //TODO
}
-
- String iconPath = element.getAttribute("icon");
+
+ String iconPath = element.getAttribute(ICON);
String pluginId = element.getDeclaringExtension().getNamespaceIdentifier();
Bundle bundle = Platform.getBundle(pluginId);
URL iconURL = FileLocator.find(bundle, new Path(iconPath), null);
@@ -50,7 +64,7 @@
public ImageDescriptor getIconDescriptor() {
return icon;
}
-
+
public Image getIcon() {
return iconImage;
}
@@ -62,7 +76,7 @@
public String getLabel() {
return label;
}
-
+
protected void finalize() throws Throwable {
iconImage.dispose();
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/NewJARAction.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/NewJARAction.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/NewJARAction.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.actions;
import org.eclipse.jface.action.IAction;
@@ -8,6 +18,11 @@
import org.eclipse.ui.PlatformUI;
import org.jboss.ide.eclipse.archives.ui.wizards.NewJARWizard;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class NewJARAction implements IActionDelegate {
public void run() {
try {
@@ -19,7 +34,7 @@
// TODO
}
}
-
+
private IStructuredSelection selection;
public void run(IAction action) {
run();
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.preferences;
import org.eclipse.core.resources.IResource;
@@ -22,6 +32,11 @@
import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
import org.jboss.ide.eclipse.archives.ui.PrefsInitializer;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class MainPreferencePage extends PropertyPage implements
IWorkbenchPreferencePage {
@@ -119,7 +134,7 @@
automaticBuilder = new Button(corePrefGroup, SWT.CHECK);
automaticBuilder.setText(ArchivesUIMessages.EnableIncrementalBuilder);
showErrorDialog = new Button(corePrefGroup, SWT.CHECK);
- showErrorDialog.setText("Externalize me");
+ showErrorDialog.setText(ArchivesUIMessages.ShowBuildErrorDialog);
}
protected void createViewPrefs(Composite main) {
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.providers;
import java.util.Arrays;
@@ -39,9 +49,9 @@
import org.jboss.ide.eclipse.archives.ui.wizards.NewJARWizard;
public class ArchivesActionProvider extends CommonActionProvider {
- public static final String NEW_PACKAGE_MENU_ID =
"org.jboss.ide.eclipse.archives.ui.newPackageMenu";
- public static final String NODE_CONTEXT_MENU_ID =
"org.jboss.ide.eclipse.archives.ui.nodeContextMenu";
- public static final String NEW_PACKAGE_ADDITIONS = "newPackageAdditions";
+ public static final String NEW_PACKAGE_MENU_ID =
"org.jboss.ide.eclipse.archives.ui.newPackageMenu"; //$NON-NLS-1$
+ public static final String NODE_CONTEXT_MENU_ID =
"org.jboss.ide.eclipse.archives.ui.nodeContextMenu"; //$NON-NLS-1$
+ public static final String NEW_PACKAGE_ADDITIONS = "newPackageAdditions";
//$NON-NLS-1$
private MenuManager newPackageManager;
private NodeContribution[] nodePopupMenuContributions;
@@ -52,7 +62,7 @@
public ArchivesActionProvider() {
}
-
+
public void init(ICommonActionExtensionSite aSite) {
newPackageActions = ExtensionManager.findNewArchiveActions();
nodePopupMenuContributions = ExtensionManager.findNodePopupMenuContributions();
@@ -62,25 +72,25 @@
newPackageManager = new
MenuManager(ArchivesUIMessages.ProjectPackagesView_newPackageMenu_label,
NEW_PACKAGE_MENU_ID);
newPackageManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
-
+
public void fillContextMenu(IMenuManager manager) {
menuAboutToShow2(manager);
}
-
+
public void menuAboutToShow2(IMenuManager manager) {
addNewPackageActions(newPackageManager);
IStructuredSelection selection = getSelection();
if (selection != null && !selection.isEmpty()) {
Object element = selection.getFirstElement();
-
+
if (element instanceof IProject || element instanceof WrappedProject ) {
manager.add(newPackageManager);
manager.add(buildAction);
buildAction.setText(ArchivesUIMessages.ProjectPackagesView_buildProjectAction_label);
} else if( element instanceof IArchiveNode ){
IArchiveNode node = (IArchiveNode)element;
-
+
if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE
|| node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER) {
manager.add(newPackageManager);
@@ -88,7 +98,7 @@
manager.add(newFilesetAction);
manager.add(new Separator());
}
-
+
if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
editAction.setText(ArchivesUIMessages.ProjectPackagesView_editPackageAction_label);
deleteAction.setText(ArchivesUIMessages.ProjectPackagesView_deletePackageAction_label);
@@ -96,11 +106,11 @@
buildAction.setText(ArchivesUIMessages.ProjectPackagesView_buildArchiveAction_label);
manager.add(buildAction);
} else if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER) {
- editAction.setText(ArchivesUIMessages.ProjectPackagesView_editFolderAction_label);
+ editAction.setText(ArchivesUIMessages.ProjectPackagesView_editFolderAction_label);
deleteAction.setText(ArchivesUIMessages.ProjectPackagesView_deleteFolderAction_label);
editAction.setImageDescriptor(platformDescriptor(ISharedImages.IMG_OBJ_FOLDER));
} else if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FILESET) {
- editAction.setText(ArchivesUIMessages.ProjectPackagesView_editFilesetAction_label);
+ editAction.setText(ArchivesUIMessages.ProjectPackagesView_editFilesetAction_label);
deleteAction.setText(ArchivesUIMessages.ProjectPackagesView_deleteFilesetAction_label);
editAction.setImageDescriptor(ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_MULTIPLE_FILES));
}
@@ -112,42 +122,42 @@
manager.add(newPackageManager);
}
}
-
+
protected void createActions() {
- newFolderAction = new
Action(ArchivesUIMessages.ProjectPackagesView_newFolderAction_label,
platformDescriptor(ISharedImages.IMG_OBJ_FOLDER)) { //$NON-NLS-1$
+ newFolderAction = new
Action(ArchivesUIMessages.ProjectPackagesView_newFolderAction_label,
platformDescriptor(ISharedImages.IMG_OBJ_FOLDER)) {
public void run () {
createFolder();
}
};
-
- newFilesetAction = new
Action(ArchivesUIMessages.ProjectPackagesView_newFilesetAction_label,
ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_MULTIPLE_FILES)) {
//$NON-NLS-1$
+
+ newFilesetAction = new
Action(ArchivesUIMessages.ProjectPackagesView_newFilesetAction_label,
ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_MULTIPLE_FILES)) {
public void run () {
createFileset();
}
};
-
- deleteAction = new Action
(ArchivesUIMessages.ProjectPackagesView_deletePackageAction_label,
platformDescriptor(ISharedImages.IMG_TOOL_DELETE)) { //$NON-NLS-1$
+
+ deleteAction = new Action
(ArchivesUIMessages.ProjectPackagesView_deletePackageAction_label,
platformDescriptor(ISharedImages.IMG_TOOL_DELETE)) {
public void run () {
deleteSelectedNode();
- }
+ }
};
-
- editAction = new Action
(ArchivesUIMessages.ProjectPackagesView_editPackageAction_label,
ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_PACKAGE_EDIT)) {
//$NON-NLS-1$
+
+ editAction = new Action
(ArchivesUIMessages.ProjectPackagesView_editPackageAction_label,
ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_PACKAGE_EDIT)) {
public void run () {
editSelectedNode();
}
};
-
- buildAction = new Action("",
ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_BUILD_PACKAGES)) {
+
+ buildAction = new Action(ArchivesUIMessages.BuildArchivesNode,
ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_BUILD_PACKAGES)) {
public void run() {
new BuildAction().run(getSelectedObject());
}
};
}
-
-
+
+
private void addContextMenuContributions (final IArchiveNode context, IMenuManager mgr)
{
for( int i = 0; i < nodePopupMenuContributions.length; i++ ) {
@@ -157,15 +167,15 @@
public String getId() {
return contribution.getId();
}
-
+
public ImageDescriptor getImageDescriptor() {
return contribution.getIcon();
}
-
+
public String getText() {
return contribution.getLabel();
}
-
+
public void run() {
contribution.getActionDelegate().run(context);
}
@@ -174,8 +184,8 @@
}
}
}
-
-
+
+
/**
* Adds the new package type actions (which come from an extension point)
* to the menu.
@@ -198,35 +208,35 @@
public String getId() {
return action.getId();
}
-
+
public ImageDescriptor getImageDescriptor() {
return action.getIconDescriptor();
}
-
+
public String getText() {
return action.getLabel();
}
-
+
public void run() {
action.getAction().run(null);
}
-
+
public void selectionChanged(IStructuredSelection sel) {
action.getAction().selectionChanged(this, sel);
}
}
-
-
+
+
/*
- * Methods below are called from the standard actions,
+ * Methods below are called from the standard actions,
* the implementations of the action, where the action does its work etc
*/
-
+
private void createFolder () {
IInputValidator validator = new IInputValidator () {
public String isValid(String newText) {
IArchiveNode selected = getSelectedNode();
-
+
boolean folderExists = false;
IArchiveNode[] folders = selected.getChildren(IArchiveNode.TYPE_ARCHIVE_FOLDER);
for (int i = 0; i < folders.length; i++) {
@@ -235,49 +245,49 @@
folderExists = true; break;
}
}
-
+
if (folderExists) {
return ArchivesUIMessages.bind(
ArchivesUIMessages.ProjectPackagesView_createFolderDialog_warnFolderExists,
newText);
-
+
}
return null;
}
};
-
+
InputDialog dialog = new InputDialog(getShell(),
ArchivesUIMessages.ProjectPackagesView_createFolderDialog_title,
- ArchivesUIMessages.ProjectPackagesView_createFolderDialog_message, "",
validator);
-
+ ArchivesUIMessages.ProjectPackagesView_createFolderDialog_message, "",
validator); //$NON-NLS-1$
+
int response = dialog.open();
if (response == Dialog.OK) {
- String[] folderPaths = dialog.getValue().split("[\\\\/]");
+ String[] folderPaths = dialog.getValue().split("[\\\\/]"); //$NON-NLS-1$
IArchiveNode selected = getSelectedNode();
IArchiveFolder current = null;
IArchiveFolder temp = null;
-
+
for(int i = folderPaths.length-1; i >= 0 ; i-- ) {
temp = ArchiveNodeFactory.createFolder();
temp.setName(folderPaths[i]);
- if( current == null )
+ if( current == null )
current = temp;
else {
temp.addChild(current);
current = temp;
}
}
-
+
selected.addChild(current);
new SaveArchivesJob(selected.getProjectPath()).schedule();
}
}
-
+
private void createFileset () {
IArchiveNode selected = getSelectedNode();
WizardDialog dialog = new WizardDialog(getShell(), new FilesetWizard(null, selected));
dialog.open();
}
-
+
private void editSelectedNode () {
IArchiveNode node = getSelectedNode();
if (node != null) {
@@ -290,21 +300,21 @@
WizardDialog dialog = new WizardDialog(getShell(), new NewJARWizard(pkg));
dialog.open();
} else if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER) {
- // folder can do the model save here.
+ // folder can do the model save here.
IArchiveFolder folder = (IArchiveFolder) node;
InputDialog dialog = new InputDialog(getShell(),
ArchivesUIMessages.ProjectPackagesView_createFolderDialog_title,
ArchivesUIMessages.ProjectPackagesView_createFolderDialog_message,
folder.getName(), null);
-
+
int response = dialog.open();
if (response == Dialog.OK) {
folder.setName(dialog.getValue());
new SaveArchivesJob(folder.getProjectPath()).schedule();
}
- }
+ }
}
}
-
+
private void deleteSelectedNode () {
IArchiveNode node = getSelectedNode();
if (node != null) {
@@ -314,11 +324,11 @@
job.schedule();
}
}
-
-
+
+
private IArchiveNode getSelectedNode () {
Object selected = getSelectedObject();
- if( selected instanceof IArchiveNode )
+ if( selected instanceof IArchiveNode )
return ((IArchiveNode)selected);
return null;
}
@@ -331,7 +341,7 @@
private IStructuredSelection getSelection() {
return (IStructuredSelection) site.getSelectionProvider().getSelection();
}
-
+
private ImageDescriptor platformDescriptor(String desc) {
return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(desc);
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.providers;
import java.util.ArrayList;
@@ -20,8 +30,13 @@
import org.jboss.ide.eclipse.archives.ui.PrefsInitializer;
import org.jboss.ide.eclipse.archives.ui.views.ProjectArchivesCommonView;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class ArchivesContentProviderDelegate implements ITreeContentProvider,
IArchiveModelListener {
-
+
public static class WrappedProject {
public static final int NAME = 1;
public static final int CATEGORY = 2;
@@ -48,14 +63,14 @@
this.project = wProject.element;
}
public boolean equals(Object otherObject) {
- return otherObject instanceof DelayProxy &&
+ return otherObject instanceof DelayProxy &&
wProject.equals(((DelayProxy)otherObject).wProject);
}
public int hashCode() {
return wProject.hashCode() + 15;
}
}
-
+
private int type;
public ArchivesContentProviderDelegate(int type) {
this.type = type;
@@ -66,7 +81,7 @@
if( addListener)
ArchivesModel.instance().addModelListener(this);
}
-
+
protected Viewer viewerInUse;
protected ArrayList<IProject> loadingProjects = new ArrayList<IProject>();
@@ -78,7 +93,7 @@
// if currently loading, always send a delay
if( loadingProjects.contains(p))
return new Object[]{new DelayProxy(wp)};
-
+
if( ArchivesModel.instance().isProjectRegistered(p.getLocation()))
return ArchivesModel.instance().getRoot(p.getLocation()).getAllChildren();
if( ArchivesModel.instance().canReregister(p.getLocation())) {
@@ -88,16 +103,16 @@
return new Object[]{dp};
}
}
- if( parentElement instanceof IArchiveNode )
+ if( parentElement instanceof IArchiveNode )
return ((IArchiveNode)parentElement).getAllChildren();
return new Object[0];
}
-
+
protected void launchRegistrationThread(final DelayProxy dp) {
- Runnable callback = new Runnable() {
+ Runnable callback = new Runnable() {
public void run() {
- Display.getDefault().asyncExec(new Runnable() {
+ Display.getDefault().asyncExec(new Runnable() {
public void run() {
loadingProjects.remove(dp.project);
refreshViewer(dp.wProject);
@@ -108,14 +123,14 @@
RegisterArchivesJob job = new RegisterArchivesJob(new IProject[]{dp.project},
callback);
job.schedule();
}
-
+
protected boolean shouldRefreshProject() {
- if( viewerInUse == ProjectArchivesCommonView.getInstance().getCommonViewer() &&
+ if( viewerInUse == ProjectArchivesCommonView.getInstance().getCommonViewer()
&&
!PrefsInitializer.getBoolean(PrefsInitializer.PREF_SHOW_PROJECT_ROOT))
return true;
return false;
}
-
+
public Object getParent(Object element) {
return null;
}
@@ -123,7 +138,7 @@
public boolean hasChildren(Object element) {
if( element instanceof IArchiveNode )
return getChildren(element).length > 0;
- if( element instanceof IResource )
+ if( element instanceof IResource )
return ArchivesModel.instance().canReregister(((IResource)element).getLocation());
if( element == ArchivesRootContentProvider.NO_PROJECT)
return false;
@@ -144,15 +159,15 @@
viewerInUse = viewer;
}
public void modelChanged(IArchiveNodeDelta delta) {
-
+
final IArchiveNode[] topChanges;
- if( delta.getKind() == IArchiveNodeDelta.DESCENDENT_CHANGED)
+ if( delta.getKind() == IArchiveNodeDelta.DESCENDENT_CHANGED)
topChanges = getChanges(delta);
else if( delta.getKind() == IArchiveNodeDelta.NO_CHANGE)
return;
else
topChanges = new IArchiveNode[]{delta.getPostNode()};
-
+
// now go through and refresh them
Display.getDefault().asyncExec(new Runnable () {
public void run () {
@@ -165,25 +180,25 @@
/*
* The inputs to ProjectArchivesCommonView are either an IProject, if no root projects
are shown,
- * or an IWorkspaceRoot, if they are. A parent, though can be a WrappedProject
+ * or an IWorkspaceRoot, if they are. A parent, though can be a WrappedProject
*/
-
+
protected void refreshViewer(Object o) {
if( o instanceof IArchiveModelRootNode) {
String projName = ((IArchiveModelRootNode)o).getProjectName();
IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(projName);
- if( p != null )
+ if( p != null )
o = new WrappedProject(p, type);
}
if( o instanceof WrappedProject && shouldRefreshProject())
o = ((WrappedProject)o).element;
-
+
if( viewerInUse instanceof StructuredViewer ) {
((StructuredViewer)viewerInUse).refresh(o);
if( viewerInUse instanceof TreeViewer ) {
((TreeViewer)viewerInUse).expandToLevel(o, 1);
}
- } else
+ } else
viewerInUse.refresh();
}
@@ -191,7 +206,7 @@
IArchiveNodeDelta[] children = delta.getAllAffectedChildren();
ArrayList<IArchiveNode> list = new ArrayList<IArchiveNode>();
for( int i = 0; i < children.length; i++ ) {
- if( children[i].getKind() == IArchiveNodeDelta.DESCENDENT_CHANGED)
+ if( children[i].getKind() == IArchiveNodeDelta.DESCENDENT_CHANGED)
list.addAll(Arrays.asList(getChanges(children[i])));
else
list.add(children[i].getPostNode());
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.providers;
import org.eclipse.jface.viewers.BaseLabelProvider;
@@ -12,42 +22,48 @@
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
import org.jboss.ide.eclipse.archives.core.util.PathUtils;
import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
+import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
import org.jboss.ide.eclipse.archives.ui.PrefsInitializer;
import
org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.DelayProxy;
import
org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.WrappedProject;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class ArchivesLabelProvider extends BaseLabelProvider implements ILabelProvider {
-
-
+
+
/*
* Important snippets to save
* image = PlatformUI.getWorkbench().getDecoratorManager().decorateImage(image,
element);
* text = PlatformUI.getWorkbench().getDecoratorManager().decorateText(text, element);
*/
-
+
public Image getImage(Object element) {
Image image = internalGetImage(element);
-
+
if (image != null) {
image = PlatformUI.getWorkbench().getDecoratorManager().decorateImage(image,
element);
}
-
+
return image;
}
-
+
public String getText(Object element) {
String text = internalGetText(element);
-
+
if (text != null) {
text = PlatformUI.getWorkbench().getDecoratorManager().decorateText(text, element);
}
return text;
}
-
+
private Image internalGetImage(Object element) {
if( element instanceof WrappedProject ) {
switch(((WrappedProject)element).getType()) {
- case WrappedProject.NAME:
+ case WrappedProject.NAME:
return
PlatformUI.getWorkbench().getSharedImages().getImage(org.eclipse.ui.ide.IDE.SharedImages.IMG_OBJ_PROJECT);
case WrappedProject.CATEGORY:
return ArchivesSharedImages.getImage(ArchivesSharedImages.IMG_PACKAGE);
@@ -78,17 +94,17 @@
private String internalGetText(Object element) {
if( element == ArchivesRootContentProvider.NO_PROJECT)
- return "Please select a project";
+ return ArchivesUIMessages.SelectAProject;
if( element instanceof WrappedProject ) {
switch(((WrappedProject)element).getType()) {
- case WrappedProject.NAME:
+ case WrappedProject.NAME:
return (((WrappedProject)element).getElement().getName());
case WrappedProject.CATEGORY:
- return "Project Archives";
+ return ArchivesUIMessages.ProjectArchives;
}
}
- if( element instanceof DelayProxy )
- return "Loading...";
+ if( element instanceof DelayProxy )
+ return ArchivesUIMessages.Loading;
if( element instanceof IArchiveNode ) {
switch (((IArchiveNode)element).getNodeType()) {
case IArchiveNode.TYPE_ARCHIVE: return getPackageText((IArchive)element);
@@ -100,15 +116,15 @@
}
return element.toString();
}
-
-
+
+
private String getPackageFolderText (IArchiveFolder folder) {
return folder.getName();
}
private String getPackageText (IArchive pkg) {
String text = pkg.getName();
if (PrefsInitializer.getBoolean( PrefsInitializer.PREF_SHOW_PACKAGE_OUTPUT_PATH)) {
- text += " [" + PathUtils.getGlobalLocation(pkg) + "]";
+ text += " [" + PathUtils.getGlobalLocation(pkg) + "]";
//$NON-NLS-1$ //$NON-NLS-2$
}
return text;
}
@@ -121,13 +137,13 @@
boolean showFullPath = PrefsInitializer.getBoolean(
PrefsInitializer.PREF_SHOW_FULL_FILESET_ROOT_DIR);
boolean inWorkspace = fileset.isInWorkspace();
-
- String text = "";
+
+ String text = ""; //$NON-NLS-1$
// +[includes] [excludes] : /path/to/root
- text += "+[" + fileset.getIncludesPattern() + "] ";
-
+ text += "+[" + fileset.getIncludesPattern() + "] "; //$NON-NLS-1$
//$NON-NLS-2$
+
if (fileset.getExcludesPattern() != null) {
- text += "-[" + fileset.getExcludesPattern() + "] : ";
+ text += "-[" + fileset.getExcludesPattern() + "] : ";
//$NON-NLS-1$ //$NON-NLS-2$
}
if (showFullPath) {
@@ -137,7 +153,7 @@
} else {
text += PathUtils.getGlobalLocation(fileset).lastSegment();
}
-
+
return text;
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.providers;
import org.eclipse.core.resources.IProject;
@@ -8,23 +18,23 @@
import
org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.WrappedProject;
/**
- * This class is the contribution to the Project Explorer.
+ * This class is the contribution to the Project Explorer.
* It returns a wrapped project suitable for adding archives to.
* It delegates all further content to the common provider.
- *
+ *
* @author rob.stryker(a)redhat.com
*
*/
-public class ArchivesRootBridgeContentProvider
+public class ArchivesRootBridgeContentProvider
implements ITreeContentProvider, IArchivesPreferenceListener {
private ArchivesContentProviderDelegate delegate;
public ArchivesRootBridgeContentProvider() {
delegate = new ArchivesContentProviderDelegate(WrappedProject.CATEGORY);
PrefsInitializer.addListener(this);
}
-
+
public Object[] getChildren(Object parentElement) {
- if( parentElement instanceof IProject )
+ if( parentElement instanceof IProject )
return new Object[] { new WrappedProject((IProject)parentElement,
WrappedProject.CATEGORY) };
return delegate.getChildren(parentElement);
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootContentProvider.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootContentProvider.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootContentProvider.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.providers;
import java.util.ArrayList;
@@ -10,14 +20,19 @@
import
org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.WrappedProject;
import org.jboss.ide.eclipse.archives.ui.views.ProjectArchivesCommonView;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class ArchivesRootContentProvider implements ITreeContentProvider {
public static final Object NO_PROJECT = new Object();
-
+
private ArchivesContentProviderDelegate delegate;
public ArchivesRootContentProvider() {
delegate = new ArchivesContentProviderDelegate(WrappedProject.NAME);
}
-
+
public Object[] getChildren(Object parentElement) {
return delegate.getChildren(parentElement);
}
@@ -56,7 +71,7 @@
projs[i] = new WrappedProject(objs[i], WrappedProject.NAME);
return projs;
}
-
+
public void dispose() {
delegate.dispose();
}
@@ -64,7 +79,7 @@
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
delegate.inputChanged(viewer, oldInput, newInput);
}
-
+
private boolean showProjectRoot () {
return PrefsInitializer.getBoolean(PrefsInitializer.PREF_SHOW_PROJECT_ROOT);
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveFilesetDestinationComposite.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveFilesetDestinationComposite.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveFilesetDestinationComposite.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.util.composites;
import org.eclipse.core.resources.IFolder;
@@ -3,4 +13,5 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.Dialog;
@@ -30,69 +41,74 @@
import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class ArchiveFilesetDestinationComposite extends Composite {
protected Composite parent;
protected Label destinationImage;
protected Text destinationText;
protected Object nodeDestination;
-
+
public ArchiveFilesetDestinationComposite(Composite parent, int style, Object
destination) {
super(parent, style);
this.parent = parent;
this.nodeDestination = destination;
-
+
createComposite();
}
-
+
protected void createComposite() {
setLayout(new FormLayout());
-
+
// create widgets
destinationImage = new Label(this, SWT.NONE);
destinationText = new Text(this, SWT.BORDER);
Composite browseComposite = new Composite(this, SWT.NONE);
-
+
// set up their layout positioning
destinationImage.setLayoutData(createFormData(0,5,null, 0, 0, 0, null, 0));
destinationText.setLayoutData(createFormData(0, 5, null, 0, destinationImage, 5,
destinationImage, 205));
-
-
+
+
// set text, add listeners, etc
destinationText.setEditable(false);
browseComposite.setLayout(new FillLayout());
- browseComposite.setLayoutData(createFormData(0,0,null,0,destinationText,5,100,-5));
+ browseComposite.setLayoutData(createFormData(0,0,null,0,destinationText,5,100,-5));
fillBrowseComposite(browseComposite);
-
+
// call other functions required for startup
updateDestinationViewer();
}
-
- private FormData createFormData(Object topStart, int topOffset, Object bottomStart, int
bottomOffset,
+
+ private FormData createFormData(Object topStart, int topOffset, Object bottomStart, int
bottomOffset,
Object leftStart, int leftOffset, Object rightStart, int rightOffset) {
FormData data = new FormData();
if( topStart != null ) {
- data.top = topStart instanceof Control ? new FormAttachment((Control)topStart,
topOffset) :
+ data.top = topStart instanceof Control ? new FormAttachment((Control)topStart,
topOffset) :
new FormAttachment(((Integer)topStart).intValue(), topOffset);
}
if( bottomStart != null ) {
- data.bottom = bottomStart instanceof Control ? new
FormAttachment((Control)bottomStart, bottomOffset) :
+ data.bottom = bottomStart instanceof Control ? new
FormAttachment((Control)bottomStart, bottomOffset) :
new FormAttachment(((Integer)bottomStart).intValue(), bottomOffset);
}
-
+
if( leftStart != null ) {
- data.left = leftStart instanceof Control ? new FormAttachment((Control)leftStart,
leftOffset) :
+ data.left = leftStart instanceof Control ? new FormAttachment((Control)leftStart,
leftOffset) :
new FormAttachment(((Integer)leftStart).intValue(), leftOffset);
}
-
+
if( rightStart != null ) {
- data.right = rightStart instanceof Control ? new FormAttachment((Control)rightStart,
rightOffset) :
+ data.right = rightStart instanceof Control ? new FormAttachment((Control)rightStart,
rightOffset) :
new FormAttachment(((Integer)rightStart).intValue(), rightOffset);
}
-
+
return data;
}
@@ -101,11 +117,11 @@
updateDestinationViewer();
//fireDestinationChanged();
}
-
+
protected void updateDestinationViewer () {
if (nodeDestination == null) return;
- destinationText.setText("");
-
+ destinationText.setText(""); //$NON-NLS-1$
+
if (nodeDestination instanceof IArchive) {
IArchive pkg = (IArchive) nodeDestination;
String txt = pkg.isTopLevel() ? pkg.getName() :
pkg.getRootArchiveRelativePath().toOSString();
@@ -123,11 +139,11 @@
destinationImage.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(IDE.SharedImages.IMG_OBJ_PROJECT));
} else if (nodeDestination instanceof IFolder) {
IFolder folder = (IFolder) nodeDestination;
- destinationText.setText("/" + folder.getProject().getName() + "/"
+ folder.getProjectRelativePath().toString());
+ destinationText.setText(Path.SEPARATOR + folder.getProject().getName() +
Path.SEPARATOR + folder.getProjectRelativePath().toString());
destinationImage.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER));
}
}
-
+
public Object getPackageNodeDestination () {
return nodeDestination;
}
@@ -135,7 +151,7 @@
protected void fillBrowseComposite(Composite parent) {
Composite browseComposite = new Composite(parent, SWT.NONE);
browseComposite.setLayout(new GridLayout(2, false));
-
+
Button filesystemBrowseButton = new Button(browseComposite, SWT.PUSH);
filesystemBrowseButton.setText(ArchivesUIMessages.PackageDestinationComposite_workspaceBrowseButton_label);
filesystemBrowseButton.addSelectionListener(new SelectionAdapter () {
@@ -144,7 +160,7 @@
}
});
}
-
+
protected void openDestinationDialog() {
ArchiveNodeDestinationDialog dialog = new ArchiveNodeDestinationDialog(getShell(),
false, true);
dialog.setValidator(new ISelectionStatusValidator() {
@@ -153,13 +169,13 @@
if( selection[0] instanceof IArchiveNode && !(selection[0] instanceof
IArchiveFileSet) )
return Status.OK_STATUS;
}
- return new Status(IStatus.ERROR, ArchivesCorePlugin.PLUGIN_ID, "Selection not
valid");
+ return new Status(IStatus.ERROR, ArchivesCorePlugin.PLUGIN_ID,
ArchivesUIMessages.SelectionNotValid);
}
});
if (nodeDestination != null)
dialog.setInitialSelection(nodeDestination);
-
- if (dialog.open() == Dialog.OK)
+
+ if (dialog.open() == Dialog.OK)
setPackageNodeDestination(dialog.getResult()[0]);
}
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveNodeDestinationDialog.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveNodeDestinationDialog.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveNodeDestinationDialog.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.util.composites;
import java.util.ArrayList;
@@ -28,6 +38,11 @@
import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
import org.jboss.ide.eclipse.archives.ui.providers.ArchivesLabelProvider;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class ArchiveNodeDestinationDialog extends ElementTreeSelectionDialog {
public ArchiveNodeDestinationDialog(Shell parent,
@@ -154,7 +169,7 @@
} else if (element instanceof IContainer) {
return ((IContainer) element).getName();
}
- return "";
+ return ""; //$NON-NLS-1$
}
public void addListener(ILabelProviderListener listener) {
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveSourceDestinationComposite.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveSourceDestinationComposite.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/util/composites/ArchiveSourceDestinationComposite.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.util.composites;
import java.util.ArrayList;
@@ -13,6 +23,7 @@
import org.eclipse.debug.ui.StringVariableSelectionDialog;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
@@ -39,14 +50,20 @@
import org.jboss.ide.eclipse.archives.core.model.INamedContainerArchiveNode;
import org.jboss.ide.eclipse.archives.core.util.PathUtils;
import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
+import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
import org.jboss.ide.eclipse.archives.ui.PackagesUIPlugin;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class ArchiveSourceDestinationComposite extends Composite {
private Text text;
private Label pathImage, translatedPath, translatedPathImage;
private Button workspaceButton, filesystemButton, variablesButton,
wsRadioButton, fsRadioButton;
-
+
private String projectName;
private boolean workspaceRelative = false;
private IArchiveNode destinationNode;
@@ -66,7 +83,7 @@
setWidgetData();
addListeners();
}
-
+
protected void createWidgets() {
text = new Text(this, SWT.SINGLE | SWT.BORDER);
pathImage = new Label(this, SWT.NONE);
@@ -78,7 +95,7 @@
wsRadioButton = new Button(this, SWT.RADIO);
fsRadioButton = new Button(this, SWT.RADIO);
}
-
+
protected void layoutWidgets() {
pathImage.setLayoutData(createFormData(0,0,null,0,0,0,null,0));
text.setLayoutData(createFormData(0,0,null,0,pathImage,5,100,0));
@@ -90,13 +107,13 @@
translatedPathImage.setLayoutData(createFormData(filesystemButton,5,null,0,0,0,0,20));
translatedPath.setLayoutData(createFormData(filesystemButton,5,null,0,translatedPathImage,5,100,-5));
}
-
+
protected void setWidgetData() {
- filesystemButton.setText("Filesystem...");
- workspaceButton.setText("Workspace...");
- variablesButton.setText("Variables...");
- wsRadioButton.setText("Workspace Relative");
- fsRadioButton.setText("Filesystem Relative");
+ filesystemButton.setText(ArchivesUIMessages.Filesystem);
+ workspaceButton.setText(ArchivesUIMessages.Workspace);
+ variablesButton.setText(ArchivesUIMessages.Variables);
+ wsRadioButton.setText(ArchivesUIMessages.WorkspaceRelative);
+ fsRadioButton.setText(ArchivesUIMessages.FilesystemRelative);
pathImage.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER));
FontData[] translatedPathData = translatedPath.getFont().getFontData();
for( int i = 0; i < translatedPathData.length; i++ )
@@ -105,7 +122,7 @@
translatedPath.setFont(newFont);
translatedPathImage.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK));
}
-
+
protected void addListeners() {
text.addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) {}
@@ -113,7 +130,7 @@
destinationNode = null;
path = text.getText();
textModified(); } });
-
+
// selection listeners
filesystemButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {}
@@ -135,7 +152,7 @@
public void widgetDefaultSelected(SelectionEvent e) {}
public void widgetSelected(SelectionEvent e) {
wsRadioButtonPressed();} });
-
+
}
protected void textModified() {validateAndUpdateWidgets();}
protected void filesystemButtonPressed() {browseFilesystem();}
@@ -143,19 +160,19 @@
protected void variablesButtonPressed() {variablesPressed();}
protected void fsRadioButtonPressed() {radioPressed(fsRadioButton);}
protected void wsRadioButtonPressed() {radioPressed(wsRadioButton);}
-
+
protected void variablesPressed() {
StringVariableSelectionDialog d = new
StringVariableSelectionDialog(Display.getDefault().getActiveShell());
if(d.open() == Window.OK) {
Object o = d.getFirstResult();
if( o != null && o instanceof IStringVariable) {
destinationNode = null;
- path = path + "${" + ((IStringVariable)o).getName() + "}";
+ path = path + "${" + ((IStringVariable)o).getName() + "}";
//$NON-NLS-1$ //$NON-NLS-2$
validateAndUpdateWidgets();;
}
}
}
-
+
protected void openDestinationDialog() {
ArchiveNodeDestinationDialog dialog = new ArchiveNodeDestinationDialog(getShell(),
true, true);
if( dialog.open() == Dialog.OK ) {
@@ -167,7 +184,7 @@
} else if( result instanceof IContainer ) {
destinationNode = null;
IPath tmpPath = ((IContainer)result).getFullPath();
- if( tmpPath.segment(0).equals(projectName) &&
+ if( tmpPath.segment(0).equals(projectName) &&
getDescriptorVersion() >= IArchiveModelRootNode.DESCRIPTOR_VERSION_1_2)
path = tmpPath.removeFirstSegments(1).makeRelative().toString();
else
@@ -177,10 +194,10 @@
validateAndUpdateWidgets();
}
}
-
+
protected void browseFilesystem () {
DirectoryDialog dialog = new DirectoryDialog(getShell());
- String currentPath = null;
+ String currentPath = null;
try {
currentPath = getTranslatedGlobalPath();
} catch(CoreException ce){/* ignore */}
@@ -188,7 +205,7 @@
if (currentPath != null && currentPath.length() > 0 ) {
dialog.setFilterPath(currentPath);
}
-
+
String path = dialog.open();
if( path != null ) {
destinationNode = null;
@@ -197,50 +214,50 @@
validateAndUpdateWidgets();
}
}
-
+
protected void radioPressed(Button button) {
workspaceRelative = button == wsRadioButton;
validateAndUpdateWidgets();
}
-
+
protected void validateAndUpdateWidgets() {
// clear old status
error = false;
errorString = null;
-
-
+
+
wsRadioButton.setEnabled(destinationNode == null);
fsRadioButton.setEnabled(destinationNode == null);
wsRadioButton.setSelection(destinationNode == null && workspaceRelative);
fsRadioButton.setSelection(destinationNode == null && !workspaceRelative);
- Image image = (destinationNode == null ?
- PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER) :
+ Image image = (destinationNode == null ?
+ PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER) :
ArchivesSharedImages.getImage(ArchivesSharedImages.IMG_PACKAGE));
pathImage.setImage(image);
-
- String destText = destinationNode == null ?
- (path == null ? "" : path) :
((INamedContainerArchiveNode)destinationNode).getName();
+
+ String destText = destinationNode == null ?
+ (path == null ? "" : path) :
((INamedContainerArchiveNode)destinationNode).getName(); //$NON-NLS-1$
if(!text.getText().equals(destText)) {
- text.setText(destText);
+ text.setText(destText);
}
-
+
String translated;
Image img=null;
- try {
+ try {
if( destinationNode != null ) {
- translated=""; img=null;
+ translated=""; img=null; //$NON-NLS-1$
} else {
translated = getTranslatedGlobalPath();
if( translated == null || !new Path(translated).toFile().exists()) {
- translated=translated + " does not exist in the filesystem.";
+ translated= NLS.bind(translated, ArchivesUIMessages.PathDoesNotExistInFilesystem);
img =
PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
} else {
img = null;
}
}
- } catch( CoreException ce ) {
+ } catch( CoreException ce ) {
translated = ce.getMessage();
if( ce.getStatus().getSeverity() == IStatus.ERROR) {
img =
PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
@@ -258,32 +275,33 @@
try {
String postSub = ArchivesCore.getInstance().getVFS().
performStringSubstitution(path, projectName, true);
- if( workspaceRelative ) {
+ if( workspaceRelative ) {
IPath p = ArchivesCore.getInstance().getVFS().workspacePathToAbsolutePath(new
Path(postSub));
if( p != null ) return p.toString();
- return "Unable to convert workspace path into global path: " + postSub;
+ return NLS.bind(postSub, ArchivesUIMessages.ErrorConvertingPaths);
}
return postSub;
- } catch( CoreException e ) {
- return "Error during string substitution: " + e.getMessage();
+ } catch( CoreException e ) {
+ return NLS.bind(e.getMessage(), ArchivesUIMessages.ErrorStringSubstitution);
}
-
+
}
protected String getTranslatedGlobalPath() throws CoreException {
try {
IPath p = PathUtils.getGlobalLocation(path, projectName, workspaceRelative,
getDescriptorVersion());
if( p != null ) return p.toString();
- String ERROR ="Unable to convert workspace path into global path: " +
p.toOSString();
+ String ERROR = NLS.bind(p.toOSString(), ArchivesUIMessages.ErrorConvertingPaths);
+
Status s = new Status(IStatus.WARNING, PackagesUIPlugin.PLUGIN_ID, ERROR);
throw new CoreException(s);
} catch( CoreException e ) {
- String ERROR = "Error during string substitution: " + e.getMessage();
+ String ERROR = NLS.bind(e.getMessage(), ArchivesUIMessages.ErrorStringSubstitution);
Status s = new Status(IStatus.ERROR, PackagesUIPlugin.PLUGIN_ID, ERROR, e);
throw new CoreException(s);
}
}
-
+
private FormData createFormData(Object topStart, int topOffset,
Object bottomStart, int bottomOffset, Object leftStart,
int leftOffset, Object rightStart, int rightOffset) {
@@ -316,8 +334,8 @@
return data;
}
-
-
+
+
// APIs
public void init(IArchiveNode dest) {
destinationNode = dest;
@@ -325,22 +343,22 @@
workspaceRelative = true;
validateAndUpdateWidgets();
}
-
+
public void init(String path, boolean workspaceRelative) {
this.path = path;
this.workspaceRelative = workspaceRelative;
this.destinationNode = null;
validateAndUpdateWidgets();
}
-
+
public boolean isValid() {
return !error;
}
-
+
public String getErrorMessage() {
return errorString;
}
-
+
public boolean isWorkspaceRelative() {
return workspaceRelative;
}
@@ -352,25 +370,25 @@
public String getPath() {
return path;
}
-
+
public void setDescriptorVersion(double version) {
this.version = version;
}
public double getDescriptorVersion() {
return version;
}
-
+
public static interface ChangeListener {
public void compositeChanged();
}
public void addChangeListener (ChangeListener listener) {
listeners.add(listener);
}
-
+
public void removeChangeListener (ChangeListener listener) {
listeners.remove(listener);
}
-
+
private void fireChange() {
for (Iterator<ChangeListener> iter = listeners.iterator(); iter.hasNext(); ) {
((ChangeListener) iter.next()).compositeChanged();
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesCommonView.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesCommonView.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ProjectArchivesCommonView.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.views;
import org.eclipse.core.resources.IProject;
@@ -20,11 +30,17 @@
import org.eclipse.ui.views.properties.PropertySheetPage;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
+import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
import org.jboss.ide.eclipse.archives.ui.PrefsInitializer;
import org.jboss.ide.eclipse.archives.ui.PrefsInitializer.IArchivesPreferenceListener;
import org.jboss.ide.eclipse.archives.ui.actions.BuildAction;
import
org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.WrappedProject;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class ProjectArchivesCommonView extends CommonNavigator implements
IArchivesPreferenceListener {
protected static ProjectArchivesCommonView instance;
protected ISelectionListener selectionListener;
@@ -118,7 +134,7 @@
}
public void addBuildActionToSite() {
- Action buildAction = new Action("",
ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_BUILD_PACKAGES)) {
+ Action buildAction = new Action(ArchivesUIMessages.BuildArchivesNode,
ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_BUILD_PACKAGES)) {
public void run() {
buildSelection(getSelectedObject());
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.wizards;
import java.lang.reflect.InvocationTargetException;
@@ -19,11 +29,17 @@
import org.jboss.ide.eclipse.archives.core.model.ArchivesModelException;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
import org.jboss.ide.eclipse.archives.ui.PackagesUIPlugin;
import
org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.WrappedProject;
import org.jboss.ide.eclipse.archives.ui.views.ProjectArchivesCommonView;
import org.jboss.ide.eclipse.archives.ui.wizards.pages.ArchiveInfoWizardPage;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public abstract class AbstractArchiveWizard extends WizardWithNotification implements
INewWizard {
private ArchiveInfoWizardPage firstPage;
private WizardPage pages[];
@@ -32,15 +48,15 @@
protected String initialDestinationPath;
protected boolean isPathWorkspaceRelative;
protected IArchiveNode initialDestinationNode;
-
- public AbstractArchiveWizard () {
+
+ public AbstractArchiveWizard () {
}
-
+
public AbstractArchiveWizard (IArchive existingPackage) {
this.existingPackage = existingPackage;
this.project =
ResourcesPlugin.getWorkspace().getRoot().getProject(existingPackage.getProjectName());
}
-
+
public void addPages() {
firstPage = new ArchiveInfoWizardPage(this, existingPackage);
addPage(firstPage);
@@ -49,7 +65,7 @@
addPage(pages[i]);
}
}
-
+
public boolean canFinish() {
if (firstPage.isPageComplete()) {
for (int i = 0; i < pages.length; i++) {
@@ -59,18 +75,18 @@
}
return false;
}
-
+
public boolean performFinish() {
IWizardPage currentPage = getContainer().getCurrentPage();
if (currentPage instanceof WizardPageWithNotification) {
((WizardPageWithNotification)currentPage).pageExited(WizardWithNotification.FINISH);
}
-
+
final boolean create = (this.existingPackage == null);
final IArchive pkg = firstPage.getArchive();
-
+
boolean performed = performFinish(pkg);
-
+
if (performed) {
try {
getContainer().run(true, false, new IRunnableWithProgress () {
@@ -83,21 +99,21 @@
if (pkg.getParent() != null) {
pkg.getParent().removeChild(pkg);
}
- }
+ }
parent = (IArchiveNode)destNode;
} else {
// parent is a String / path, so this is a top level node
parent = ArchivesModel.instance().getRoot(project.getLocation());
- if( parent == null )
+ if( parent == null )
parent = ArchivesModel.instance().registerProject(project.getLocation(), null);
}
-
+
try {
- if( create )
+ if( create )
parent.addChild(pkg);
ArchivesModel.instance().save(project.getLocation(), monitor);
} catch( ArchivesModelException ame ) {
- IStatus status = new Status(IStatus.ERROR, PackagesUIPlugin.PLUGIN_ID, "Error
Completing Wizard", ame);
+ IStatus status = new Status(IStatus.ERROR, PackagesUIPlugin.PLUGIN_ID,
ArchivesUIMessages.ErrorCompletingWizard, ame);
PackagesUIPlugin.getDefault().getLog().log(status);
}
}
@@ -114,7 +130,7 @@
project = null;
Object selected = (selection.isEmpty() ? project : selection.getFirstElement());
-
+
if (selected instanceof IArchiveNode) {
IArchiveNode node = (IArchiveNode) selected;
if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE || node.getNodeType() ==
IArchiveNode.TYPE_ARCHIVE_FOLDER) {
@@ -135,27 +151,27 @@
initialDestinationPath = project.getFullPath().toString();
isPathWorkspaceRelative = true;
}
- }
-
- setNeedsProgressMonitor(true);
+ }
+
+ setNeedsProgressMonitor(true);
}
-
+
public IArchiveNode getInitialNode() {
return initialDestinationNode;
}
-
+
public String getInitialPath() {
return initialDestinationPath;
}
-
+
public boolean isInitialPathWorkspaceRelative() {
return isPathWorkspaceRelative;
}
-
+
public IProject getProject() {
return project;
}
-
+
/**
* Returns the package created by this wizard.
* Note: This should only be called after the first page has been completed
@@ -164,7 +180,7 @@
public IArchive getArchive () {
return firstPage.getArchive();
}
-
+
public abstract boolean performFinish(IArchive pkg);
public abstract WizardPage[] createWizardPages();
public abstract ImageDescriptor getImageDescriptor();
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.wizards;
import java.lang.reflect.InvocationTargetException;
@@ -12,47 +22,53 @@
import org.jboss.ide.eclipse.archives.core.model.ArchivesModelException;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
import org.jboss.ide.eclipse.archives.ui.PackagesUIPlugin;
import org.jboss.ide.eclipse.archives.ui.wizards.pages.FilesetInfoWizardPage;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class FilesetWizard extends Wizard {
private FilesetInfoWizardPage page1;
private IArchiveFileSet fileset;
private IArchiveNode parentNode;
-
+
public FilesetWizard(IArchiveFileSet fileset, IArchiveNode parentNode)
{
this.fileset = fileset;
this.parentNode = parentNode;
- setWindowTitle("Fileset Wizard");
+ setWindowTitle(ArchivesUIMessages.FilesetWizard);
}
-
+
public boolean performFinish() {
final boolean createFileset = this.fileset == null;
-
+
if (createFileset)
this.fileset = ArchiveNodeFactory.createFileset();
fillFilesetFromPage(fileset);
try {
getContainer().run(true, false, new IRunnableWithProgress () {
public void run(IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException {
- if (createFileset)
+ if (createFileset)
parentNode.addChild(fileset);
try {
ArchivesModel.instance().save(fileset.getProjectPath(), monitor);
} catch( ArchivesModelException ame ) {
- IStatus status = new Status(IStatus.ERROR, PackagesUIPlugin.PLUGIN_ID, "Error
Completing Wizard", ame);
+ IStatus status = new Status(IStatus.ERROR, PackagesUIPlugin.PLUGIN_ID,
ArchivesUIMessages.ErrorCompletingWizard, ame);
PackagesUIPlugin.getDefault().getLog().log(status);
}
}
});
} catch (InvocationTargetException e) {
} catch (InterruptedException e) {
- } catch(Exception e) {e.printStackTrace();}
+ } catch(Exception e) {}
return true;
}
-
+
private void fillFilesetFromPage (IArchiveFileSet fileset) {
fileset.setExcludesPattern(page1.getExcludes());
fileset.setIncludesPattern(page1.getIncludes());
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/NewJARWizard.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/NewJARWizard.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/NewJARWizard.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.wizards;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -7,6 +17,11 @@
import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class NewJARWizard extends AbstractArchiveWizard {
public WizardPage[] createWizardPages() {
return new WizardPage[0];
@@ -16,22 +31,22 @@
super();
setWindowTitle(ArchivesUIMessages.NewJARWizard_windowTitle);
}
-
+
public NewJARWizard (IArchive existingPackage) {
super(existingPackage);
setWindowTitle(ArchivesUIMessages.NewJARWizard_windowTitle_editJAR);
}
-
+
public boolean performFinish(IArchive pkg) {
- pkg.setArchiveType(ArchivesCore.getInstance().getExtensionManager().getArchiveType("jar"));
+ pkg.setArchiveType(ArchivesCore.getInstance().getExtensionManager().getArchiveType("jar"));
//$NON-NLS-1$
return true;
}
-
+
public ImageDescriptor getImageDescriptor() {
return
ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_NEW_JAR_WIZARD);
}
-
+
public String getArchiveExtension() {
- return "jar";
+ return "jar"; //$NON-NLS-1$
}
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/WizardPageWithNotification.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/WizardPageWithNotification.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/WizardPageWithNotification.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,24 +1,14 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
+/*******************************************************************************
+ * Copyright (c) 2007 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
*
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.ide.eclipse.archives.ui.wizards;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -36,13 +26,13 @@
protected WizardPageWithNotification(String pageName) {
super(pageName);
}
-
+
protected WizardPageWithNotification(String pageName, String title,
ImageDescriptor titleImage) {
super(pageName, title, titleImage);
}
-
+
public void pageEntered(int button) {}
public void pageExited(int button) {}
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/WizardWithNotification.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/WizardWithNotification.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/WizardWithNotification.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,24 +1,14 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
+/*******************************************************************************
+ * Copyright (c) 2007 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
*
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.ide.eclipse.archives.ui.wizards;
import org.eclipse.jface.dialogs.IPageChangedListener;
@@ -37,8 +27,8 @@
public static final int PREVIOUS = 2;
public static final int FINISH = 3;
public static final int UNKNOWN = 4;
-
-
+
+
private IWizardPage currentPage;
public WizardWithNotification() {
super();
@@ -47,12 +37,12 @@
public void setContainer(IWizardContainer wizardContainer) {
IWizardContainer previous = getContainer();
super.setContainer(wizardContainer);
-
+
// listeners
if( previous instanceof WizardDialog ) {
((WizardDialog)previous).removePageChangedListener(this);
}
-
+
if( wizardContainer instanceof WizardDialog ) {
((WizardDialog)wizardContainer).addPageChangedListener(this);
}
@@ -65,20 +55,20 @@
}
return;
}
-
+
Object selectedPage = event.getSelectedPage();
IWizardPage previous = currentPage.getPreviousPage();
IWizardPage next = currentPage.getNextPage();
-
+
if( previous != null && previous.equals(selectedPage)) {
- if( currentPage instanceof WizardPageWithNotification )
+ if( currentPage instanceof WizardPageWithNotification )
((WizardPageWithNotification)currentPage).pageExited(PREVIOUS);
- if( selectedPage instanceof WizardPageWithNotification )
+ if( selectedPage instanceof WizardPageWithNotification )
((WizardPageWithNotification)selectedPage).pageEntered(PREVIOUS);
} else if( next != null && next.equals(selectedPage)) {
- if( currentPage instanceof WizardPageWithNotification )
+ if( currentPage instanceof WizardPageWithNotification )
((WizardPageWithNotification)currentPage).pageExited(NEXT);
- if( selectedPage instanceof WizardPageWithNotification )
+ if( selectedPage instanceof WizardPageWithNotification )
((WizardPageWithNotification)selectedPage).pageEntered(NEXT);
} else {
if( currentPage instanceof WizardPageWithNotification ) {
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.wizards.pages;
import java.util.ArrayList;
@@ -36,6 +46,11 @@
import org.jboss.ide.eclipse.archives.ui.wizards.WizardPageWithNotification;
import org.jboss.ide.eclipse.archives.ui.wizards.WizardWithNotification;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class ArchiveInfoWizardPage extends WizardPageWithNotification {
private AbstractArchiveWizard wizard;
@@ -46,24 +61,24 @@
private boolean packageExploded;
private ArchiveSourceDestinationComposite destinationComposite;
private IArchive archive;
-
+
public ArchiveInfoWizardPage (AbstractArchiveWizard wizard, IArchive existingPackage) {
super (ArchivesUIMessages.PackageInfoWizardPage_title,
ArchivesUIMessages.PackageInfoWizardPage_title, wizard.getImageDescriptor());
setWizard(wizard);
this.archive = existingPackage;
}
-
+
public void createControl(Composite parent) {
setMessage(ArchivesUIMessages.PackageInfoWizardPage_message);
-
+
Composite main = new Composite(parent, SWT.NONE);
main.setLayout(new GridLayout(1, false));
-
+
Group infoGroup = new Group(main, SWT.NONE);
infoGroup.setLayout(new GridLayout(3, false));
infoGroup.setText(ArchivesUIMessages.PackageInfoWizardPage_infoGroup_label);
expand(infoGroup);
-
+
new Label(infoGroup,
SWT.NONE).setText(ArchivesUIMessages.PackageInfoWizardPage_packageName_label);
Composite pkgNameComposite = new Composite(infoGroup, SWT.NONE);
GridLayout pkgNameLayout = new GridLayout(2, false);
@@ -71,19 +86,19 @@
pkgNameLayout.marginWidth = 0;
pkgNameComposite.setLayout(pkgNameLayout);
pkgNameComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
+
new Label(pkgNameComposite,
SWT.NONE).setImage(ArchivesSharedImages.getImage(ArchivesSharedImages.IMG_PACKAGE));
-
+
packageNameText = new Text(pkgNameComposite, SWT.BORDER);
- packageName = wizard.getProject().getName() + "." +
wizard.getArchiveExtension();
+ packageName = wizard.getProject().getName() + "." +
wizard.getArchiveExtension(); //$NON-NLS-1$
packageNameText.setText(packageName);
packageNameText.setSelection(0, wizard.getProject().getName().length());
expand(packageNameText);
-
+
GridData pkgNameData = new GridData(GridData.FILL_HORIZONTAL);
pkgNameData.horizontalSpan = 2;
pkgNameComposite.setLayoutData(pkgNameData);
-
+
packageNameText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (validate()) {
@@ -96,13 +111,13 @@
l.setText(ArchivesUIMessages.PackageInfoWizardPage_destination_label);
GridData lData = new GridData(GridData.BEGINNING, GridData.BEGINNING,false,false);
l.setLayoutData(lData);
-
+
GridData destinationTextData = new GridData(GridData.FILL_BOTH);
destinationTextData.horizontalSpan = 2;
GridData buttonData = new GridData(GridData.FILL_HORIZONTAL);
buttonData.horizontalSpan = 3;
buttonData.horizontalAlignment = SWT.END;
-
+
destinationComposite = new ArchiveSourceDestinationComposite(infoGroup,
wizard.getProject().getName(), getDescriptorVersion());
destinationComposite.addChangeListener(new ChangeListener () {
public void compositeChanged() {
@@ -110,12 +125,12 @@
}
});
destinationComposite.setLayoutData(destinationTextData);
-
+
Group packageTypeGroup = new Group(main, SWT.NONE);
packageTypeGroup.setLayout(new GridLayout(1, false));
packageTypeGroup.setText(ArchivesUIMessages.PackageInfoWizardPage_packageTypeGroup_label);
expand(packageTypeGroup);
-
+
packageExploded = false;
compressedButton = new Button(packageTypeGroup, SWT.RADIO);
compressedButton.setText(ArchivesUIMessages.PackageInfoWizardPage_compressedButton_label);
@@ -133,11 +148,11 @@
});
explodedButton.setText(ArchivesUIMessages.PackageInfoWizardPage_explodedButton_label);
setControl(main);
-
+
fillDefaults();
validate();
}
-
+
private void fillDefaults () {
if (archive != null) {
compressedButton.setSelection(!archive.isExploded());
@@ -164,7 +179,7 @@
String errorMessage = null;
if (packageNameText.getText() == null || packageNameText.getText().length() == 0)
errorMessage = ArchivesUIMessages.PackageInfoWizardPage_error_noPackageName;
- else if( !destinationComposite.isValid() )
+ else if( !destinationComposite.isValid() )
errorMessage = destinationComposite.getErrorMessage();
else if( destinationComposite.getDestinationNode() != null ) {
IArchiveNode parentNode = destinationComposite.getDestinationNode();
@@ -175,22 +190,22 @@
if (subPackage.getName().equals(packageNameText.getText())
&& (!subPackage.equals(this.archive))) {
errorMessage = ArchivesUIMessages.bind(
- ArchivesUIMessages.PackageInfoWizardPage_error_packageAlreadyExists,
+ ArchivesUIMessages.PackageInfoWizardPage_error_packageAlreadyExists,
packageNameText.getText());
}
}
} else if( destinationComposite.getPath() != null ) {
// checking for another archive with the same destination / name
boolean relative = destinationComposite.isWorkspaceRelative();
- IPath destinationLocation =
- PathUtils.getGlobalLocation(destinationComposite.getPath(),
+ IPath destinationLocation =
+ PathUtils.getGlobalLocation(destinationComposite.getPath(),
wizard.getProject().getName(), relative, 1);
ArrayList<IArchive> allArchives = new ArrayList<IArchive>();
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for( int i = 0; i < projects.length; i++ )
+ for( int i = 0; i < projects.length; i++ )
allArchives.addAll(Arrays.asList(ModelUtil.getProjectArchives(projects[i].getLocation())));
-
+
IArchive[] packages = (IArchive[]) allArchives.toArray(new
IArchive[allArchives.size()]);
if (packages != null) {
for( int i = 0; i < packages.length; i++ ) {
@@ -206,24 +221,24 @@
} else {
errorMessage = (ArchivesUIMessages.PackageInfoWizardPage_error_noDestination);
}
-
+
setErrorMessage(errorMessage);
setPageComplete(errorMessage == null);
return errorMessage == null;
}
-
-
+
+
public void pageExited(int button) {
if (button == WizardWithNotification.NEXT || button == WizardWithNotification.FINISH)
{
createPackage();
}
}
-
+
private void createPackage () {
if (archive == null) {
archive = ArchiveNodeFactory.createArchive();
}
-
+
archive.setName(getPackageName());
archive.setExploded(isPackageExploded());
if( destinationComposite.getPath() != null ) {
@@ -231,7 +246,7 @@
archive.setDestinationPath(new Path(destinationComposite.getPath()));
}
}
-
+
private void expand(Control control) {
control.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
@@ -243,22 +258,22 @@
public boolean isPackageExploded() {
return packageExploded;
}
-
+
private void setWizard(AbstractArchiveWizard wizard) {
this.wizard = wizard;
}
-
+
public IArchive getArchive () {
return archive;
}
-
+
protected double getDescriptorVersion() {
IPath loc = wizard.getProject().getLocation();
if( ArchivesModel.instance().isProjectRegistered(loc))
return ArchivesModel.instance().getRoot(loc).getDescriptorVersion();
return IArchiveModelRootNode.DESCRIPTOR_VERSION_LATEST;
}
-
+
// Getters for the wizard to call
public String getDestinationPath() {
return destinationComposite.getPath();
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/DefaultJARConfigWizardPage.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/DefaultJARConfigWizardPage.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/DefaultJARConfigWizardPage.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.wizards.pages;
import org.eclipse.jface.viewers.TreeViewer;
@@ -7,37 +17,44 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
+import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
import org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate;
import org.jboss.ide.eclipse.archives.ui.providers.ArchivesLabelProvider;
import org.jboss.ide.eclipse.archives.ui.wizards.AbstractArchiveWizard;
import org.jboss.ide.eclipse.archives.ui.wizards.WizardPageWithNotification;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class DefaultJARConfigWizardPage extends WizardPageWithNotification {
private AbstractArchiveWizard wizard;
-
+
public DefaultJARConfigWizardPage (AbstractArchiveWizard wizard) {
- super ("Default JAR Configuration", "Default JAR Configuration",
+ super (ArchivesUIMessages.DefaultJarConfiguration,
+ ArchivesUIMessages.DefaultJarConfiguration,
ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_NEW_JAR_WIZARD));
-
+
this.wizard = wizard;
}
-
+
public void createControl(Composite parent) {
Composite main = new Composite(parent, SWT.NONE);
main.setLayout(new GridLayout(1, false));
-
+
Button createDefaultConfig = new Button(main, SWT.CHECK);
- createDefaultConfig.setText("Use default JAR configuration");
-
- new Label(main, SWT.NONE).setText("Preview");
-
+ createDefaultConfig.setText(ArchivesUIMessages.UseDefaultJARConfiguration);
+
+ new Label(main, SWT.NONE).setText(ArchivesUIMessages.Preview);
+
TreeViewer previewTree = new TreeViewer(main);
previewTree.setContentProvider(new ArchivesContentProviderDelegate(false));
previewTree.setLabelProvider(new ArchivesLabelProvider());
previewTree.setInput(wizard.getArchive());
-
+
setControl(main);
}
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java 2008-09-24
22:54:49 UTC (rev 10465)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java 2008-09-24
23:11:44 UTC (rev 10466)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ide.eclipse.archives.ui.wizards.pages;
import java.util.ArrayList;
@@ -34,6 +44,11 @@
import
org.jboss.ide.eclipse.archives.ui.util.composites.ArchiveSourceDestinationComposite;
import org.jboss.ide.eclipse.archives.ui.util.composites.FilesetPreviewComposite;
+/**
+ *
+ * @author "Rob Stryker" <rob.stryker(a)redhat.com>
+ *
+ */
public class FilesetInfoWizardPage extends WizardPage {
private IArchiveNode parentNode;
@@ -41,7 +56,7 @@
private String includes, excludes;
private String projectName;
private boolean flattened;
-
+
/**
* This variable must at all times be global. ALWAYS
*/
@@ -58,7 +73,7 @@
public FilesetInfoWizardPage (Shell parent, IArchiveFileSet fileset, IArchiveNode
parentNode) {
super(ArchivesUIMessages.FilesetInfoWizardPage_new_title,
ArchivesUIMessages.FilesetInfoWizardPage_new_title, null);
-
+
if (fileset == null) {
setTitle(ArchivesUIMessages.FilesetInfoWizardPage_new_title);
setMessage(ArchivesUIMessages.FilesetInfoWizardPage_new_message);
@@ -66,57 +81,57 @@
setTitle(ArchivesUIMessages.FilesetInfoWizardPage_edit_title);
setMessage(ArchivesUIMessages.FilesetInfoWizardPage_edit_message);
}
-
+
this.fileset = fileset;
this.parentNode = parentNode;
projectName = parentNode.getProjectName();
}
-
+
public void createControl (Composite parent) {
mainComposite = new Composite(parent, SWT.NONE);
mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
+
mainComposite.setLayout(new FormLayout());
Group info = createInfoGroup(mainComposite);
createPreviewGroup(mainComposite, info);
-
+
fillDefaults();
addListeners();
changePreview();
-
+
includesText.setFocus();
-
+
setControl(mainComposite);
}
-
- private FormData createFormData(Object topStart, int topOffset, Object bottomStart, int
bottomOffset,
+
+ private FormData createFormData(Object topStart, int topOffset, Object bottomStart, int
bottomOffset,
Object leftStart, int leftOffset, Object rightStart, int rightOffset) {
FormData data = new FormData();
if( topStart != null ) {
- data.top = topStart instanceof Control ? new FormAttachment((Control)topStart,
topOffset) :
+ data.top = topStart instanceof Control ? new FormAttachment((Control)topStart,
topOffset) :
new FormAttachment(((Integer)topStart).intValue(), topOffset);
}
if( bottomStart != null ) {
- data.bottom = bottomStart instanceof Control ? new
FormAttachment((Control)bottomStart, bottomOffset) :
+ data.bottom = bottomStart instanceof Control ? new
FormAttachment((Control)bottomStart, bottomOffset) :
new FormAttachment(((Integer)bottomStart).intValue(), bottomOffset);
}
if( leftStart != null ) {
- data.left = leftStart instanceof Control ? new FormAttachment((Control)leftStart,
leftOffset) :
+ data.left = leftStart instanceof Control ? new FormAttachment((Control)leftStart,
leftOffset) :
new FormAttachment(((Integer)leftStart).intValue(), leftOffset);
}
if( rightStart != null ) {
- data.right = rightStart instanceof Control ? new FormAttachment((Control)rightStart,
rightOffset) :
+ data.right = rightStart instanceof Control ? new FormAttachment((Control)rightStart,
rightOffset) :
new FormAttachment(((Integer)rightStart).intValue(), rightOffset);
}
return data;
}
-
+
private Group createPreviewGroup(Composite mainComposite, Group info) {
Group previewGroup = new Group(mainComposite, SWT.NONE);
previewGroup.setLayoutData(createFormData(info,5,100,-5,0,5,100,-5));
@@ -128,7 +143,7 @@
previewGroup.setText(ArchivesUIMessages.FilesetInfoWizardPage_previewGroup_label);
return previewGroup;
}
-
+
private Group createInfoGroup(Composite mainComposite) {
Group infoGroup = new Group(mainComposite, SWT.NONE);
infoGroup.setText(ArchivesUIMessages.FilesetInfoWizardPage_infoGroup_title);
@@ -145,21 +160,21 @@
destinationKey.setLayoutData(createFormData(0,10,null,0,null,5, 0, 100));
destinationComposite.setLayoutData(createFormData(0,5,null,0,destinationKey,5, 100,
-5));
-
+
// root dir
Label rootDirectoryLabel = new Label(infoGroup, SWT.NONE);
srcDestComposite = new ArchiveSourceDestinationComposite(infoGroup, projectName,
getDescriptorVersion());
- Composite rootDirValue = srcDestComposite;
+ Composite rootDirValue = srcDestComposite;
rootDirectoryLabel.setLayoutData(createFormData(destinationComposite,10,null,0,null,5,0,100));
rootDirValue.setLayoutData(createFormData(destinationComposite,5,null,0,rootDirectoryLabel,5,100,-5));
-
+
flattenedLabel = new Label(infoGroup, SWT.NONE);
flattenedYes = new Button(infoGroup, SWT.RADIO);
flattenedNo = new Button(infoGroup, SWT.RADIO);
flattenedLabel.setLayoutData(createFormData(rootDirValue,5,null,0,null,0,rootDirValue,-5));
flattenedYes.setLayoutData(createFormData(rootDirValue, 5,
null,0,flattenedLabel,5,null,0));
flattenedNo.setLayoutData(createFormData(rootDirValue, 5,
null,0,flattenedYes,5,null,0));
-
+
// includes composite and it's internals
Composite includesKey = new Composite(infoGroup, SWT.NONE);
includesKey.setLayout(new FormLayout());
@@ -168,11 +183,11 @@
includesText = new Text(infoGroup, SWT.BORDER);
includesImage.setLayoutData(createFormData(0,0,null,0,0,0,null,0));
includesTextLabel.setLayoutData(createFormData(0,0,null,0,includesImage,5,null,0));
-
+
includesKey.setLayoutData(createFormData(flattenedLabel,5,null,0,null,5,0,100));
includesText.setLayoutData(createFormData(flattenedLabel,5,null,0,includesKey,10,100,-5));
-
+
// excludes composite and it's internals
Composite excludesKey = new Composite(infoGroup, SWT.NONE);
excludesKey.setLayout(new FormLayout());
@@ -181,7 +196,7 @@
excludesText = new Text(infoGroup, SWT.BORDER);
excludesImage.setLayoutData(createFormData(0,0,null,0,0,0,null,0));
excludesTextLabel.setLayoutData(createFormData(0,0,null,0,excludesImage,5,null,0));
-
+
excludesKey.setLayoutData(createFormData(includesText,5,null,0,null,5,0,100));
excludesText.setLayoutData(createFormData(includesText,5,100,-5,excludesKey,10,100,-5));
@@ -193,28 +208,28 @@
excludesImage.setImage(ArchivesSharedImages.getImage(ArchivesSharedImages.IMG_EXCLUDES));
excludesTextLabel.setText(ArchivesUIMessages.FilesetInfoWizardPage_excludes_label);
- flattenedLabel.setText("Flatten?");
- flattenedYes.setText("Yes");
- flattenedNo.setText("No");
-
+ flattenedLabel.setText(ArchivesUIMessages.Flatten);
+ flattenedYes.setText(ArchivesUIMessages.Yes);
+ flattenedNo.setText(ArchivesUIMessages.No);
+
return infoGroup;
}
-
+
private void addListeners () {
- includesText.addModifyListener(new ModifyListener () {
+ includesText.addModifyListener(new ModifyListener () {
public void modifyText(ModifyEvent e) {
includes = includesText.getText();
changePreview();
}
});
-
- excludesText.addModifyListener(new ModifyListener () {
+
+ excludesText.addModifyListener(new ModifyListener () {
public void modifyText(ModifyEvent e) {
excludes = excludesText.getText();
changePreview();
}
});
-
+
SelectionAdapter flattenAdapter = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
flattened = flattenedYes.getSelection();
@@ -223,54 +238,54 @@
};
flattenedYes.addSelectionListener(flattenAdapter);
flattenedNo.addSelectionListener(flattenAdapter);
-
+
srcDestComposite.addChangeListener(new
ArchiveSourceDestinationComposite.ChangeListener() {
public void compositeChanged() {
changePreview();
- }
+ }
});
}
-
+
public IArchiveNode getRootNode () {
return (IArchiveNode) destinationComposite.getPackageNodeDestination();
}
-
+
public String getIncludes () {
return includes;
}
-
+
public String getExcludes () {
return excludes;
}
-
+
public boolean isFlattened() {
return flattened;
}
-
+
public boolean isRootDirWorkspaceRelative () {
return srcDestComposite.isWorkspaceRelative();
}
-
+
public String getRawPath() {
return srcDestComposite.getPath();
}
-
+
public String replaceVariables() {
try {
return ArchivesCore.getInstance().getVFS().
- performStringSubstitution(srcDestComposite.getPath(),
+ performStringSubstitution(srcDestComposite.getPath(),
projectName, true);
} catch( CoreException ce ) {
}
return null;
}
-
+
private void fillDefaults () {
if (fileset != null) {
flattened = fileset.isFlattened();
flattenedYes.setSelection(flattened);
flattenedNo.setSelection(!flattened);
-
+
if (fileset.getIncludesPattern() != null) {
includes = fileset.getIncludesPattern();
includesText.setText(includes);
@@ -279,23 +294,23 @@
excludes = fileset.getExcludesPattern();
excludesText.setText(excludes);
}
-
+
if (fileset.getRawSourcePath() != null) {
srcDestComposite.init(fileset.getRawSourcePath(), fileset.isInWorkspace());
}
} else {
- String rawPath = "";
+ String rawPath = ""; //$NON-NLS-1$
srcDestComposite.init(rawPath, true);
flattened = false;
flattenedYes.setSelection(flattened);
flattenedNo.setSelection(!flattened);
- includes = "**";
+ includes = "**"; //$NON-NLS-1$
includesText.setText(includes);
}
}
-
+
private ChangePreviewRunnable changePreviewRunnable;
private void changePreview() {
if( changePreviewRunnable != null )
@@ -303,16 +318,16 @@
changePreviewRunnable = new ChangePreviewRunnable();
Thread t = new Thread(changePreviewRunnable);
t.start();
- }
-
+ }
+
protected class ChangePreviewRunnable implements Runnable {
public boolean stop = false;
public void run() {
- DirectoryScannerExtension ds = null;
+ DirectoryScannerExtension ds = null;
Runnable r;
try {
- ds = DirectoryScannerFactory.createDirectoryScanner(
- replaceVariables(), null, includes, excludes, parentNode.getProjectName(),
+ ds = DirectoryScannerFactory.createDirectoryScanner(
+ replaceVariables(), null, includes, excludes, parentNode.getProjectName(),
srcDestComposite.isWorkspaceRelative(),
parentNode.getModelRootNode().getDescriptorVersion(), true);
String[] fsRelative = ds.getIncludedFiles();
IPath filesetRelative;
@@ -337,13 +352,13 @@
}
};
}
-
+
if( !stop ) {
Display.getDefault().asyncExec(r);
}
}
}
-
+
protected double getDescriptorVersion() {
return parentNode.getModelRootNode().getDescriptorVersion();
}