Author: rob.stryker(a)jboss.com
Date: 2011-02-22 17:17:34 -0500 (Tue, 22 Feb 2011)
New Revision: 29276
Modified:
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java
Log:
JBIDE-8304 to branch
Modified:
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java
===================================================================
---
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2011-02-22
21:57:14 UTC (rev 29275)
+++
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2011-02-22
22:17:34 UTC (rev 29276)
@@ -109,6 +109,7 @@
public static String ShowAllProjects;
public static String FilesetPreferences;
public static String EnableDefaultExcludes;
+ public static String ConfigureWorkspacePrefs;
static {
NLS.initializeMessages("org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages",
ArchivesUIMessages.class); //$NON-NLS-1$
Modified:
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties
===================================================================
---
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2011-02-22
21:57:14 UTC (rev 29275)
+++
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2011-02-22
22:17:34 UTC (rev 29276)
@@ -91,4 +91,5 @@
ShowRootProject=Show project at the root
ShowAllProjects=Show all projects that contain packages
FilesetPreferences=Fileset Preferences
-EnableDefaultExcludes=Enable Default Excludes
\ No newline at end of file
+EnableDefaultExcludes=Enable Default Excludes
+ConfigureWorkspacePrefs=Configure Workspace Preferences...
\ No newline at end of file
Modified:
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java
===================================================================
---
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java 2011-02-22
21:57:14 UTC (rev 29275)
+++
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java 2011-02-22
22:17:34 UTC (rev 29276)
@@ -16,7 +16,6 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
@@ -26,9 +25,11 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.dialogs.PropertyPage;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.asf.DirectoryScanner;
@@ -53,8 +54,8 @@
private Text defaultExcludes;
private Group corePrefGroup, viewPrefGroup, packageExplorerGroup, filesetGroup;
private Composite overrideComp;
+ private Link fChangeWorkspaceSettings;
-
public MainPreferencePage() {
super();
setTitle(ArchivesUIMessages.PreferencePageTitle);
@@ -63,8 +64,9 @@
protected Control createContents(Composite parent) {
Composite main = new Composite(parent, SWT.NONE);
- main.setLayout(new GridLayout(1, false));
-
+ GridLayout gl = new GridLayout(1, false);
+ main.setLayout(gl);
+
createOverridePrefs(main);
createCorePrefs(main);
createViewPrefs(main);
@@ -112,7 +114,9 @@
protected void createOverridePrefs(Composite main) {
if( getResourceLocationIfExists() != null ) {
overrideComp = new Composite(main, SWT.NONE);
- overrideComp.setLayout(new FillLayout());
+ overrideComp.setLayout(new FormLayout());
+ overrideComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
overrideButton = new Button(overrideComp, SWT.CHECK);
overrideButton.setText(ArchivesUIMessages.ProjectSpecificSettings);
@@ -124,9 +128,44 @@
setWidgetsEnabled(overrideButton.getSelection());
}
});
+ FormData fd = new FormData();
+ fd.top = new FormAttachment(0,5);
+ fd.left = new FormAttachment(0,5);
+ overrideButton.setLayoutData(fd);
+
+ fd = new FormData();
+ fd.top = new FormAttachment(0,0);
+ fd.left = new FormAttachment(overrideButton,5);
+ fd.right = new FormAttachment(100,-5);
+ fd.right.alignment = SWT.RIGHT;
+ Composite tmp = new Composite(overrideComp, SWT.NONE);
+ tmp.setLayoutData(fd);
+ tmp.setLayout(new GridLayout(1,true));
+ fChangeWorkspaceSettings= createLink(tmp, "Configure Workspace
Settings..."); //$NON-NLS-1$
+ fChangeWorkspaceSettings.setLayoutData(new GridData(SWT.END, SWT.CENTER, true,
false));
}
}
+ private void openGlobalPrefs() {
+ String id= "org.jboss.ide.eclipse.archives.ui.archivesPreferencePage";
//$NON-NLS-1$
+ PreferencesUtil.createPreferenceDialogOn(getShell(), id, new String[] { id },
getElement()).open();
+ }
+
+ private Link createLink(Composite composite, String text) {
+ Link link= new Link(composite, SWT.BORDER);
+ link.setFont(composite.getFont());
+ link.setText("<A>" + text + "</A>");
//$NON-NLS-1$//$NON-NLS-2$
+ link.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ openGlobalPrefs();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ openGlobalPrefs();
+ }
+ });
+ return link;
+ }
+
protected void setWidgetsEnabled(boolean val) {
showPackageOutputPath.setEnabled(val);
showProjectRoot.setEnabled(val);
@@ -137,6 +176,7 @@
showErrorDialog.setEnabled(val);
enableDefaultExcludes.setEnabled(val);
defaultExcludes.setEnabled(val);
+ showNodeOnAllProjects.setEnabled(val);
}
protected void createCorePrefs(Composite main) {