Author: rob.stryker(a)jboss.com
Date: 2008-10-20 15:09:37 -0400 (Mon, 20 Oct 2008)
New Revision: 11011
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml
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/PrefsInitializer.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/ArchivesRootBridgeContentProvider.java
Log:
JBIDE-2826
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml 2008-10-20
18:35:49 UTC (rev 11010)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml 2008-10-20
19:09:37 UTC (rev 11011)
@@ -54,7 +54,7 @@
<page
class="org.jboss.ide.eclipse.archives.ui.preferences.MainPreferencePage"
id="org.jboss.ide.eclipse.archives.ui.archivesPreferencePage"
- name="Packaging Archives"/>
+ name="Project Archives"/>
</extension>
@@ -63,12 +63,12 @@
<page
class="org.jboss.ide.eclipse.archives.ui.preferences.MainPreferencePage"
id="org.jboss.ide.eclipse.archives.ui.projectProperties"
- name="Packaging Archives"
+ name="Project Archives"
objectClass="org.eclipse.core.resources.IProject"/>
<page
class="org.jboss.ide.eclipse.archives.ui.preferences.MainPreferencePage"
id="org.jboss.ide.eclipse.archives.ui.projectProperties2"
- name="Packaging Archives"
+ name="Project Archives"
objectClass="org.eclipse.jdt.core.IJavaProject"/>
</extension>
<extension
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-10-20
18:35:49 UTC (rev 11010)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2008-10-20
19:09:37 UTC (rev 11011)
@@ -127,9 +127,10 @@
public static String PreferencePageTitle;
public static String ProjectSpecificSettings;
public static String CorePreferences;
+ public static String ProjectExplorerPreferences;
public static String EnableIncrementalBuilder;
public static String ShowBuildErrorDialog;
-
+ public static String EnableNodeAlways;
public static String ProjectPackagesView;
public static String ShowFullOutputPath;
public static String ShowFullRootDirectory;
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-10-20
18:35:49 UTC (rev 11010)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2008-10-20
19:09:37 UTC (rev 11011)
@@ -108,12 +108,14 @@
PackageNodeDestinationDialog_folderLabel=folder
PackageNodeDestinationDialog_title=Select a destination
-PreferencePageTitle=Packaging Archives
+PreferencePageTitle=Project Archives
ProjectSpecificSettings=Enable Project Specific Settings
CorePreferences=Core Preferences
+ProjectExplorerPreferences=Core Preferences
EnableIncrementalBuilder=Enable incremental builder
ShowBuildErrorDialog=Show build error dialog
-ProjectPackagesView=Project Packages View
+EnableNodeAlways=Show node in all projects
+ProjectPackagesView=Project Archives View
ShowFullOutputPath=Show full output path next to packages.
ShowFullRootDirectory=Show the full root directory of filesets.
ShowRootProject=Show project at the root
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-10-20
18:35:49 UTC (rev 11010)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ExtensionManager.java 2008-10-20
19:09:37 UTC (rev 11011)
@@ -50,11 +50,13 @@
public static NodeContribution[] findNodePopupMenuContributions () {
ArrayList<NodeContribution> contributions = new
ArrayList<NodeContribution>();
IExtension[] extensions = findExtension(NODE_POPUP_MENUS_EXTENSION_ID);
-
+ NodeContribution tmp;
for (int i = 0; i < extensions.length; i++) {
IConfigurationElement[] elements = extensions[i].getConfigurationElements();
for (int j = 0; j < elements.length; j++) {
- contributions.add(new NodeContribution(elements[j]));
+ tmp = new NodeContribution(elements[j]);
+ if( tmp.getActionDelegate() != null )
+ contributions.add(tmp);
}
}
@@ -64,11 +66,13 @@
public static NewArchiveAction[] findNewArchiveActions () {
ArrayList<NewArchiveAction> contributions = new
ArrayList<NewArchiveAction>();
IExtension[] extensions = findExtension(NEW_PACKAGE_ACTIONS_EXTENSION_ID);
-
+ NewArchiveAction tmp;
for (int i = 0; i < extensions.length; i++) {
IConfigurationElement[] elements = extensions[i].getConfigurationElements();
for (int j = 0; j < elements.length; j++) {
- contributions.add(new NewArchiveAction(elements[j]));
+ tmp = new NewArchiveAction(elements[j]);
+ if( tmp.getAction() != null)
+ contributions.add(tmp);
}
}
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-10-20
18:35:49 UTC (rev 11010)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/PrefsInitializer.java 2008-10-20
19:09:37 UTC (rev 11011)
@@ -32,6 +32,7 @@
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 String PREF_ALWAYS_SHOW_PROJECT_EXPLORER_NODE =
"alwaysShowProjectExplorerNode";//$NON-NLS-1$
public static final ArrayList<IArchivesPreferenceListener> listeners = new
ArrayList<IArchivesPreferenceListener>();
public static interface IArchivesPreferenceListener {
@@ -45,6 +46,7 @@
prefs.putBoolean(PREF_SHOW_PROJECT_ROOT, true);
prefs.putBoolean(PREF_SHOW_ALL_PROJECTS, false);
prefs.putBoolean(PREF_SHOW_BUILD_ERROR_DIALOG, true);
+ prefs.putBoolean(PREF_ALWAYS_SHOW_PROJECT_EXPLORER_NODE, false);
try {
prefs.flush();
} catch (org.osgi.service.prefs.BackingStoreException e) {
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-10-20
18:35:49 UTC (rev 11010)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java 2008-10-20
19:09:37 UTC (rev 11011)
@@ -43,7 +43,8 @@
private Button showPackageOutputPath, showFullFilesetRootDir;
private Button showProjectRoot, showAllProjects;
private Button automaticBuilder, showErrorDialog, overrideButton;
- private Group corePrefGroup, viewPrefGroup;
+ private Button showNodeOnAllProjects;
+ private Group corePrefGroup, viewPrefGroup, packageExplorerGroup;
private Composite overrideComp;
@@ -60,6 +61,7 @@
createOverridePrefs(main);
createCorePrefs(main);
createViewPrefs(main);
+ createProjectExplorerPrefs(main);
fillValues();
return main;
}
@@ -136,7 +138,17 @@
showErrorDialog = new Button(corePrefGroup, SWT.CHECK);
showErrorDialog.setText(ArchivesUIMessages.ShowBuildErrorDialog);
}
+
+ protected void createProjectExplorerPrefs(Composite main) {
+ packageExplorerGroup = new Group(main, SWT.NONE);
+ packageExplorerGroup.setText(ArchivesUIMessages.ProjectExplorerPreferences);
+ packageExplorerGroup.setLayout(new GridLayout(1, false));
+ packageExplorerGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ showNodeOnAllProjects = new Button(packageExplorerGroup, SWT.CHECK);
+ showNodeOnAllProjects.setText(ArchivesUIMessages.EnableNodeAlways);
+ }
+
protected void createViewPrefs(Composite main) {
viewPrefGroup = new Group(main, SWT.NONE);
@@ -185,6 +197,7 @@
showFullFilesetRootDir.setSelection(true);
showProjectRoot.setSelection(true);
showAllProjects.setSelection(false);
+ showNodeOnAllProjects.setSelection(false);
if( getResourceLocationIfExists() != null ) {
overrideButton.setSelection(false);
setWidgetsEnabled(overrideButton.getSelection());
@@ -203,6 +216,7 @@
PrefsInitializer.setBoolean(PrefsInitializer.PREF_SHOW_FULL_FILESET_ROOT_DIR,
showFullFilesetRootDir.getSelection(), getElement());
PrefsInitializer.setBoolean(PrefsInitializer.PREF_SHOW_PROJECT_ROOT,
showProjectRoot.getSelection(), getElement());
PrefsInitializer.setBoolean(PrefsInitializer.PREF_SHOW_ALL_PROJECTS,
showAllProjects.getSelection(), getElement());
+ PrefsInitializer.setBoolean(PrefsInitializer.PREF_ALWAYS_SHOW_PROJECT_EXPLORER_NODE,
showNodeOnAllProjects.getSelection(), getElement());
return true;
}
}
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-10-20
18:35:49 UTC (rev 11010)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java 2008-10-20
19:09:37 UTC (rev 11011)
@@ -13,6 +13,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
import org.jboss.ide.eclipse.archives.ui.PrefsInitializer;
import org.jboss.ide.eclipse.archives.ui.PrefsInitializer.IArchivesPreferenceListener;
import
org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.WrappedProject;
@@ -36,7 +37,10 @@
public Object[] getChildren(Object parentElement) {
if( parentElement instanceof IProject) {
if( ((IProject)parentElement).isOpen())
- return new Object[] { new WrappedProject((IProject)parentElement,
WrappedProject.CATEGORY) };
+ if(
PrefsInitializer.getBoolean(PrefsInitializer.PREF_ALWAYS_SHOW_PROJECT_EXPLORER_NODE) ||
+ ArchivesModel.instance().canReregister(((IProject)parentElement).getLocation())) {
+ return new Object[] { new WrappedProject((IProject)parentElement,
WrappedProject.CATEGORY) };
+ }
return new Object[]{};
}
return delegate.getChildren(parentElement);