Author: rob.stryker(a)jboss.com
Date: 2012-05-09 23:50:53 -0400 (Wed, 09 May 2012)
New Revision: 40904
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/Fileset.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetDialog.java
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/src/org/jboss/ide/eclipse/as/classpath/ui/containers/custom/CustomClasspathPreferencePage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ExtendedServerPropertiesAdapterFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS7ExtendedProperties.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossExtendedProperties.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/ServerExtendedProperties.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferences/ServerTypePreferencePage.java
Log:
JBIDE-11820 to trunk cr1
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/Fileset.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/Fileset.java 2012-05-10
03:19:53 UTC (rev 40903)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/Fileset.java 2012-05-10
03:50:53 UTC (rev 40904)
@@ -60,7 +60,7 @@
return getFolder(folder, runtime, true);
}
public static String getFolder(String folder, IRuntime runtime, boolean ignoreError) {
- String tmp = new ConfigNameResolver().performSubstitutions(folder, runtime.getName(),
ignoreError);
+ String tmp = new ConfigNameResolver().performSubstitutions(folder, runtime == null ?
null : runtime.getName(), ignoreError);
IPath p = new Path(tmp);
if( !p.isAbsolute() && runtime != null ) {
p = runtime.getLocation().append(p);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetDialog.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetDialog.java 2012-05-10
03:19:53 UTC (rev 40903)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetDialog.java 2012-05-10
03:50:53 UTC (rev 40904)
@@ -44,12 +44,14 @@
private FilesetPreviewComposite preview;
private IServer server;
private boolean showViewer = true;
+
+ private boolean requiresName = true;
protected FilesetDialog(Shell parentShell, String defaultLocation, IServer server) {
super(parentShell);
this.fileset = new Fileset();
this.fileset.setFolder(defaultLocation);
this.fileset.setServer(server);
- this.fileset.setIncludesPattern("**/*.xml"); //$NON-NLS-1$
+ this.fileset.setIncludesPattern(getDefaultIncludesPattern());
this.server = server;
}
protected FilesetDialog(Shell parentShell, Fileset fileset) {
@@ -57,6 +59,15 @@
this.fileset = (Fileset)fileset.clone();
this.server = fileset.getServer();
}
+
+ protected String getDefaultIncludesPattern() {
+ return "**/*.xml"; //$NON-NLS-1$
+ }
+
+ public void setRequiresName(boolean required) {
+ requiresName = required;
+ }
+
public void setShowViewer(boolean val) {
showViewer = val;
}
@@ -83,8 +94,9 @@
main.setLayout(new GridLayout(3, false));
main.setLayoutData(new GridData(GridData.FILL_BOTH));
fillArea(main);
-
- nameText.setText(fileset.getName());
+
+ if( requiresName )
+ nameText.setText(fileset.getName());
folderText.setText(fileset.getRawFolder());
includesText.setText(fileset.getIncludesPattern());
excludesText.setText(fileset.getExcludesPattern());
@@ -101,7 +113,8 @@
textModified();
}
};
- nameText.addModifyListener(mListener);
+ if( requiresName )
+ nameText.addModifyListener(mListener);
folderText.addModifyListener(mListener);
includesText.addModifyListener(mListener);
excludesText.addModifyListener(mListener);
@@ -134,7 +147,8 @@
}
protected void textModified() {
- name = nameText.getText();
+ if( requiresName )
+ name = nameText.getText();
dir = folderText.getText();
includes = includesText.getText();
excludes = excludesText.getText();
@@ -148,7 +162,7 @@
protected void validate() {
String error = null;
- if( name.equals("")) //$NON-NLS-1$
+ if( requiresName && name.equals("")) //$NON-NLS-1$
error = Messages.FilesetsDialogEmptyName;
else if( dir.equals("")) //$NON-NLS-1$
error = Messages.FilesetsDialogEmptyFolder;
@@ -166,12 +180,14 @@
}
protected void fillArea(Composite main) {
- Label nameLabel = new Label(main, SWT.NONE);
- nameLabel.setText(Messages.FilesetsNewName);
-
- nameText = new Text(main, SWT.BORDER);
- nameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
-
+
+ if( requiresName ) {
+ Label nameLabel = new Label(main, SWT.NONE);
+ nameLabel.setText(Messages.FilesetsNewName);
+ nameText = new Text(main, SWT.BORDER);
+ nameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ }
+
Label folderLabel = new Label(main, SWT.NONE);
folderLabel.setText(Messages.FilesetsNewRootDir);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/src/org/jboss/ide/eclipse/as/classpath/ui/containers/custom/CustomClasspathPreferencePage.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/src/org/jboss/ide/eclipse/as/classpath/ui/containers/custom/CustomClasspathPreferencePage.java 2012-05-10
03:19:53 UTC (rev 40903)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/src/org/jboss/ide/eclipse/as/classpath/ui/containers/custom/CustomClasspathPreferencePage.java 2012-05-10
03:50:53 UTC (rev 40904)
@@ -23,6 +23,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
@@ -56,6 +57,8 @@
import
org.jboss.ide.eclipse.as.classpath.core.runtime.CustomRuntimeClasspathModel.IDefaultPathProvider;
import org.jboss.ide.eclipse.as.classpath.ui.ClasspathUIPlugin;
import org.jboss.ide.eclipse.as.classpath.ui.Messages;
+import
org.jboss.ide.eclipse.as.core.server.internal.ExtendedServerPropertiesAdapterFactory;
+import
org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties;
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.preferences.ServerTypePreferencePage;
import org.osgi.service.prefs.BackingStoreException;
@@ -272,15 +275,35 @@
protected EntryFilesetDialog(Shell parentShell,
String defaultLocation, IServer server) {
super(parentShell, defaultLocation, server);
+ setRequiresName(false);
}
public Fileset getFileset() {
return new CustomRuntimeClasspathModel.PathProviderFileset(fileset);
}
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ shell.setText("New Default Classpath Fileset Entry");
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ Control c = super.createDialogArea(parent);
+ setTitle("New Default Classpath Fileset Entry");
+ setMessage("Create a new classpath fileset which can be added to all projects
targeting this runtime-type");
+ return c;
+ }
+ protected String getDefaultIncludesPattern() {
+ return "**/*.jar"; //$NON-NLS-1$
+ }
}
@Override
protected void addPressed() {
- FilesetDialog d = new EntryFilesetDialog(addButton.getShell(), "", null);
//$NON-NLS-1$
+ String id = getCurrentId();
+ IRuntimeType rtt = id == null ? null : ServerCore.findRuntimeType(id);
+ ServerExtendedProperties props = rtt == null ? null :
+ (ServerExtendedProperties)Platform.getAdapterManager().getAdapter(rtt,
ServerExtendedProperties.class);
+ String defaultLocation = props == null ? "" :
props.getNewClasspathFilesetDefaultRootFolder();
+ FilesetDialog d = new EntryFilesetDialog(addButton.getShell(), defaultLocation,
null);
d.setShowViewer(false);
if( d.open() == Window.OK) {
// For now, just add fileset
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ExtendedServerPropertiesAdapterFactory.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ExtendedServerPropertiesAdapterFactory.java 2012-05-10
03:19:53 UTC (rev 40903)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ExtendedServerPropertiesAdapterFactory.java 2012-05-10
03:50:53 UTC (rev 40904)
@@ -14,8 +14,10 @@
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerAttributes;
+import org.eclipse.wst.server.core.IServerType;
import
org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossAS6ExtendedProperties;
import
org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossAS710ExtendedProperties;
import
org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossAS7ExtendedProperties;
@@ -53,6 +55,10 @@
} else if( adaptableObject instanceof IRuntime ) {
typeId = ((IRuntime)adaptableObject).getRuntimeType().getId();
r = (IRuntime)adaptableObject;
+ } else if( adaptableObject instanceof IRuntimeType ) {
+ typeId = ((IRuntimeType)adaptableObject).getId();
+ } else if( adaptableObject instanceof IServerType ) {
+ typeId = ((IServerType)adaptableObject).getId();
}
IAdaptable adaptable = s == null ? r : s;
if( typeId != null ) {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS7ExtendedProperties.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS7ExtendedProperties.java 2012-05-10
03:19:53 UTC (rev 40903)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS7ExtendedProperties.java 2012-05-10
03:50:53 UTC (rev 40904)
@@ -33,6 +33,11 @@
return IJBossRuntimeResourceConstants.AS7_STANDALONE + "/" +
IJBossRuntimeResourceConstants.CONFIGURATION; //$NON-NLS-1$
}
+ public String getNewClasspathFilesetDefaultRootFolder() {
+ return IJBossRuntimeResourceConstants.AS7_MODULES + "/org"; //$NON-NLS-1$
+ }
+
+
public int getJMXProviderType() {
return JMX_DEFAULT_PROVIDER;
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossExtendedProperties.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossExtendedProperties.java 2012-05-10
03:19:53 UTC (rev 40903)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossExtendedProperties.java 2012-05-10
03:50:53 UTC (rev 40904)
@@ -59,7 +59,7 @@
}
protected ServerBeanLoader getServerBeanLoader() {
- return new ServerBeanLoader(runtime.getLocation().toFile());
+ return runtime == null ? null : new ServerBeanLoader(runtime.getLocation().toFile());
}
/**
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/ServerExtendedProperties.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/ServerExtendedProperties.java 2012-05-10
03:19:53 UTC (rev 40903)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/ServerExtendedProperties.java 2012-05-10
03:50:53 UTC (rev 40904)
@@ -31,8 +31,11 @@
}
public String getNewFilesetDefaultRootFolder() {
- return "servers/${jboss_config}"; //$NON-NLS-1$
+ return "${jboss_config_dir}"; //$NON-NLS-1$
}
+ public String getNewClasspathFilesetDefaultRootFolder() {
+ return getNewFilesetDefaultRootFolder();
+ }
public static final int JMX_NULL_PROVIDER = -1;
public static final int JMX_DEFAULT_PROVIDER = 0;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2012-05-10 03:19:53 UTC (rev
40903)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2012-05-10 03:50:53 UTC (rev
40904)
@@ -1195,23 +1195,27 @@
<factory
adaptableType="org.eclipse.wst.server.core.IServer"
class="org.jboss.ide.eclipse.as.core.server.internal.ExtendedServerPropertiesAdapterFactory">
- <adapter
-
type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties">
- </adapter>
- <adapter
-
type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossExtendedProperties">
- </adapter>
+ <adapter
type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties"/>
+ <adapter
type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossExtendedProperties"/>
</factory>
<factory
adaptableType="org.eclipse.wst.server.core.IRuntime"
class="org.jboss.ide.eclipse.as.core.server.internal.ExtendedServerPropertiesAdapterFactory">
- <adapter
-
type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties">
- </adapter>
- <adapter
-
type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossExtendedProperties">
- </adapter>
+ <adapter
type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties"/>
+ <adapter
type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossExtendedProperties"/>
</factory>
+ <factory
+ adaptableType="org.eclipse.wst.server.core.IServerType"
+
class="org.jboss.ide.eclipse.as.core.server.internal.ExtendedServerPropertiesAdapterFactory">
+ <adapter
type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties"/>
+ <adapter
type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossExtendedProperties"/>
+ </factory>
+ <factory
+ adaptableType="org.eclipse.wst.server.core.IRuntimeType"
+
class="org.jboss.ide.eclipse.as.core.server.internal.ExtendedServerPropertiesAdapterFactory">
+ <adapter
type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties"/>
+ <adapter
type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossExtendedProperties"/>
+ </factory>
</extension>
</plugin>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferences/ServerTypePreferencePage.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferences/ServerTypePreferencePage.java 2012-05-10
03:19:53 UTC (rev 40903)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferences/ServerTypePreferencePage.java 2012-05-10
03:50:53 UTC (rev 40904)
@@ -181,7 +181,7 @@
}
public String getDescriptionLabel() {
- return "Desc label";
+ return "";
}
protected void createRightColumnButtons(Composite c) {
insertAddRemove(c);