Author: max.andersen(a)jboss.com
Date: 2012-04-30 11:54:00 -0400 (Mon, 30 Apr 2012)
New Revision: 40652
Modified:
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsSection.java
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftExpressWizardModel.java
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java
Log:
JBIDE-11487 applied rstrykers/rawblems patch to b3
Modified:
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
===================================================================
---
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-04-30
15:41:30 UTC (rev 40651)
+++
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-04-30
15:54:00 UTC (rev 40652)
@@ -43,7 +43,6 @@
import org.jboss.tools.openshift.express.internal.core.console.UserModel;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
-import
org.jboss.tools.openshift.express.internal.ui.wizard.IOpenShiftExpressWizardModel;
import org.osgi.service.prefs.BackingStoreException;
import com.openshift.client.IApplication;
@@ -59,10 +58,8 @@
@SuppressWarnings("restriction")
public class ExpressServerUtils {
/* Server Settings */
- public static final String ATTRIBUTE_EXPRESS_MODE =
"org.jboss.tools.openshift.express.internal.core.behaviour.ExpressMode";
- public static final String EXPRESS_BINARY_MODE = "publishBinary";
- public static final String EXPRESS_SOURCE_MODE = "publishSource";
public static final String ATTRIBUTE_DEPLOY_PROJECT =
"org.jboss.tools.openshift.binary.deployProject";
+ public static final String ATTRIBUTE_OVERRIDE_PROJECT_SETTINGS =
"org.jboss.tools.openshift.project.override";
/* Legacy Server Settings: Please usage scan before removal */
public static final String ATTRIBUTE_DEPLOY_PROJECT_LEGACY =
"org.jboss.tools.openshift.express.internal.core.behaviour.binary.deployProject";
@@ -97,15 +94,10 @@
public static final String TASK_WIZARD_ATTR_APP_LIST = "appList";
public static final String TASK_WIZARD_ATTR_SELECTED_APP = "application";
- public static String getExpressDeployProject(IServerAttributes attributes ) {
- return attributes.getAttribute(ATTRIBUTE_DEPLOY_PROJECT,
- attributes.getAttribute(ATTRIBUTE_DEPLOY_PROJECT_LEGACY, (String)null));
- }
-
- private static IProject getExpressDeployProject2(IServerAttributes attributes) {
- String name = getExpressDeployProject(attributes);
- return name == null ? null :
ResourcesPlugin.getWorkspace().getRoot().getProject(name);
- }
+ /* For use in finding not just the effective value, but values stored either in project
or server */
+ public static int SETTING_FROM_PROJECT = 1;
+ public static int SETTING_FROM_SERVER = 2;
+ public static int SETTING_EFFECTIVE_VALUE = 3;
public static String getProjectAttribute(IProject project, String attributeName, String
defaultVal) {
if( project == null )
@@ -116,6 +108,7 @@
return node.get(attributeName, defaultVal);
}
+ /* Settings stored only in the project */
public static String getExpressApplicationName(IServerAttributes attributes ) {
return getProjectAttribute(getExpressDeployProject2(attributes),
SETTING_APPLICATION_NAME,
attributes.getAttribute(ATTRIBUTE_APPLICATION_NAME, (String)null));
@@ -131,25 +124,69 @@
attributes.getAttribute(ATTRIBUTE_DOMAIN, (String)null));
}
+ public static String getExpressUsername(IServerAttributes attributes ) {
+ return getProjectAttribute(getExpressDeployProject2(attributes), SETTING_USERNAME,
+ attributes.getAttribute(ATTRIBUTE_USERNAME, (String)null));
+ }
+
+
+ /* Settings stored in the project, maybe over-ridden in the server */
public static String getExpressDeployFolder(IServerAttributes attributes ) {
- return getProjectAttribute(getExpressDeployProject2(attributes),
SETTING_DEPLOY_FOLDER_NAME,
- attributes.getAttribute(ATTRIBUTE_DEPLOY_FOLDER_NAME, (String)null));
+ if( getOverridesProject(attributes))
+ return attributes.getAttribute(ATTRIBUTE_DEPLOY_FOLDER_NAME,
ATTRIBUTE_DEPLOY_FOLDER_DEFAULT);
+ return getProjectAttribute(getExpressDeployProject2(attributes),
SETTING_DEPLOY_FOLDER_NAME,
+ ATTRIBUTE_DEPLOY_FOLDER_DEFAULT);
}
public static String getExpressRemoteName(IServerAttributes attributes ) {
- return getProjectAttribute(getExpressDeployProject2(attributes), SETTING_REMOTE_NAME,
- attributes.getAttribute(ATTRIBUTE_REMOTE_NAME,(String)null));
+ if( getOverridesProject(attributes))
+ return attributes.getAttribute(ATTRIBUTE_REMOTE_NAME, ATTRIBUTE_REMOTE_NAME_DEFAULT);
+ return getProjectAttribute(getExpressDeployProject2(attributes), SETTING_REMOTE_NAME,
+ ATTRIBUTE_REMOTE_NAME_DEFAULT);
}
- public static String getExpressUsername(IServerAttributes attributes ) {
- return getProjectAttribute(getExpressDeployProject2(attributes), SETTING_USERNAME,
- attributes.getAttribute(ATTRIBUTE_USERNAME, (String)null));
+ public static String getExpressDeployFolder(IServerAttributes attributes, int fromWhere
) {
+ String fromServer =
attributes.getAttribute(ATTRIBUTE_DEPLOY_FOLDER_NAME,(String)null);
+ if( fromWhere == SETTING_FROM_SERVER)
+ return fromServer;
+ String fromProject = getProjectAttribute(getExpressDeployProject2(attributes),
SETTING_DEPLOY_FOLDER_NAME, null);
+ if( fromWhere == SETTING_FROM_PROJECT)
+ return fromProject;
+ if( getOverridesProject(attributes))
+ return fromServer == null ? ATTRIBUTE_DEPLOY_FOLDER_DEFAULT : fromServer;
+ return fromProject == null ? ATTRIBUTE_DEPLOY_FOLDER_DEFAULT : fromProject;
}
+
+ public static String getExpressRemoteName(IServerAttributes attributes, int fromWhere )
{
+ String fromServer = attributes.getAttribute(ATTRIBUTE_REMOTE_NAME,(String)null);
+ if( fromWhere == SETTING_FROM_SERVER)
+ return fromServer;
+ String fromProject = getProjectAttribute(getExpressDeployProject2(attributes),
SETTING_REMOTE_NAME, null);
+ if( fromWhere == SETTING_FROM_PROJECT)
+ return fromProject;
+ if( getOverridesProject(attributes))
+ return fromServer == null ? ATTRIBUTE_REMOTE_NAME_DEFAULT : fromServer;
+ return fromProject == null ? ATTRIBUTE_REMOTE_NAME_DEFAULT : fromProject;
+ }
+ /* Settings stored only in the server */
+ public static String getExpressDeployProject(IServerAttributes attributes ) {
+ return attributes.getAttribute(ATTRIBUTE_DEPLOY_PROJECT,
+ attributes.getAttribute(ATTRIBUTE_DEPLOY_PROJECT_LEGACY, (String)null));
+ }
+
+ private static IProject getExpressDeployProject2(IServerAttributes attributes) {
+ String name = getExpressDeployProject(attributes);
+ return name == null ? null :
ResourcesPlugin.getWorkspace().getRoot().getProject(name);
+ }
public static boolean getIgnoresContextRoot(IServerAttributes server) {
return server.getAttribute(PREFERENCE_IGNORE_CONTEXT_ROOT, true);
}
+ public static boolean getOverridesProject(IServerAttributes server) {
+ return server.getAttribute(ATTRIBUTE_OVERRIDE_PROJECT_SETTINGS, false);
+ }
+
public static IServer setIgnoresContextRoot(IServerAttributes server, boolean val)
throws CoreException {
IServerWorkingCopy wc = server.createWorkingCopy();
wc.setAttribute(ATTRIBUTE_REMOTE_NAME, val);
@@ -169,17 +206,16 @@
* @return
* @throws CoreException
*/
- @SuppressWarnings("restriction")
public static IServer fillServerWithOpenShiftDetails(IServer server, String host,
- String deployProject) throws CoreException {
+ String deployProject, String remote) throws CoreException {
ServerWorkingCopy wc = (ServerWorkingCopy)server.createWorkingCopy();
- fillServerWithOpenShiftDetails((IServerWorkingCopy)wc, host, deployProject);
+ fillServerWithOpenShiftDetails((IServerWorkingCopy)wc, host, deployProject,remote);
IServer saved = wc.save(true, new NullProgressMonitor());
return saved;
}
public static void fillServerWithOpenShiftDetails(IServerWorkingCopy wc, String host,
- String deployProject) {
+ String deployProject, String remote) {
if( host != null ) {
if( host.indexOf("://") != -1)
@@ -196,7 +232,7 @@
// wc.setAttribute(ATTRIBUTE_APPLICATION_ID, appId);
// wc.setAttribute(ATTRIBUTE_DEPLOY_FOLDER_NAME, projectRelativeFolder);
// wc.setAttribute(ATTRIBUTE_EXPRESS_MODE, mode);
-// wc.setAttribute(ATTRIBUTE_REMOTE_NAME, remoteName);
+ wc.setAttribute(ATTRIBUTE_REMOTE_NAME, remote);
((ServerWorkingCopy)wc).setAutoPublishSetting(Server.AUTO_PUBLISH_DISABLE);
wc.setAttribute(IJBossToolingConstants.IGNORE_LAUNCH_COMMANDS, "true");
wc.setAttribute(IJBossToolingConstants.WEB_PORT, 80);
@@ -266,6 +302,13 @@
return null;
}
+ /**
+ * This method will search available projects for one that has a
+ * git remote URI that matches that of this IApplication
+ *
+ * @param application
+ * @return
+ */
public static IProject[] findProjectsForApplication(final IApplication application) {
final ArrayList<IProject> results = new ArrayList<IProject>();
if( application ==null )
@@ -289,6 +332,30 @@
return results.toArray(new IProject[results.size()]);
}
+ /**
+ * This method will search for all projects connected to git
+ * and having the proper settings file containing
+ * domain, application id, app name, and username
+ *
+ * @return
+ */
+ public static IProject[] findAllSuitableOpenshiftProjects() {
+ final ArrayList<IProject> results = new ArrayList<IProject>();
+ final IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for( int i = 0; i < projects.length; i++ ) {
+ if( EGitUtils.getRepository(projects[i]) != null ) {
+ String appName = getProjectAttribute(projects[i], SETTING_APPLICATION_NAME, null);
+ String appId = getProjectAttribute(projects[i], SETTING_APPLICATION_ID, null);
+ String domain = getProjectAttribute(projects[i], SETTING_DOMAIN, null);
+ String username = getProjectAttribute(projects[i], SETTING_USERNAME, null);
+ if( appName != null && appId != null && domain != null &&
username != null ) {
+ results.add(projects[i]);
+ }
+ }
+ }
+ return results.toArray(new IProject[results.size()]);
+ }
+
public static IProject findProjectForApplication(IApplication application) {
IProject[] p = findProjectsForApplication(application);
return p == null ? null : p.length == 0 ? null : p[0];
@@ -318,8 +385,8 @@
}
}
- public static void updateOpenshiftProjectSettings(IProject project, IApplication app,
UserDelegate user,
- String remoteName, String deployFolder) {
+ public static void updateOpenshiftProjectSettings(IProject project, IApplication app,
+ UserDelegate user, String remoteName, String deployFolder) {
String qualifier = OpenShiftUIActivator.getDefault().getBundle().getSymbolicName();
IScopeContext context = new ProjectScope(project);
IEclipsePreferences node = context.getNode(qualifier);
@@ -336,48 +403,37 @@
}
}
-
- /* Deprecated */
- public static IServer setExpressMode(IServer server, String val) throws CoreException {
+ public static IServer setExpressDeployProject(IServer server, String val) throws
CoreException {
IServerWorkingCopy wc = server.createWorkingCopy();
- wc.setAttribute(ATTRIBUTE_EXPRESS_MODE, val);
+ wc.setAttribute(ATTRIBUTE_DEPLOY_PROJECT, val);
return wc.save(false, new NullProgressMonitor());
}
- public static IServer setExpressApplication(IServer server, String val) throws
CoreException {
+ public static IServer setExpressRemoteName(IServer server, String val) throws
CoreException {
IServerWorkingCopy wc = server.createWorkingCopy();
- wc.setAttribute(ATTRIBUTE_APPLICATION_NAME, val);
+ wc.setAttribute(ATTRIBUTE_REMOTE_NAME, val);
return wc.save(false, new NullProgressMonitor());
}
- public static IServer setExpressDeployProject(IServer server, String val) throws
CoreException {
+
+
+ /* Deprecated: These details cannot be changed and are no longer stored in the server
+ * Delete when certain no problems will be caused.
+ */
+ @Deprecated
+ public static IServer setExpressApplication(IServer server, String val) throws
CoreException {
IServerWorkingCopy wc = server.createWorkingCopy();
- wc.setAttribute(ATTRIBUTE_DEPLOY_PROJECT, val);
+ wc.setAttribute(ATTRIBUTE_APPLICATION_NAME, val);
return wc.save(false, new NullProgressMonitor());
}
+ @Deprecated
public static IServer setExpressDomain(IServer server, String val) throws CoreException
{
IServerWorkingCopy wc = server.createWorkingCopy();
wc.setAttribute(ATTRIBUTE_DOMAIN, val);
return wc.save(false, new NullProgressMonitor());
}
+ @Deprecated
public static IServer setExpressUsername(IServer server, String val) throws
CoreException {
IServerWorkingCopy wc = server.createWorkingCopy();
wc.setAttribute(ATTRIBUTE_USERNAME, val);
return wc.save(false, new NullProgressMonitor());
}
-
- public static IServer setExpressRemoteName(IServer server, String val) throws
CoreException {
- IServerWorkingCopy wc = server.createWorkingCopy();
- wc.setAttribute(ATTRIBUTE_REMOTE_NAME, val);
- return wc.save(false, new NullProgressMonitor());
- }
- public static String getExpressMode(IServerAttributes attributes ) {
- return attributes.getAttribute(ATTRIBUTE_EXPRESS_MODE, EXPRESS_SOURCE_MODE);
- }
-
- public static String getExpressModeAsString(IServerAttributes attributes) {
- String mode = getExpressMode(attributes);
- if( mode.equals(EXPRESS_SOURCE_MODE))
- return "Source";
- return "Binary";
- }
-
}
Modified:
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
===================================================================
---
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-04-30
15:41:30 UTC (rev 40651)
+++
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-04-30
15:54:00 UTC (rev 40652)
@@ -104,14 +104,12 @@
private List<IApplication> appList;
private String[] appListNames;
private IServerWorkingCopy server;
- private String mode;
private HashMap<IApplication, IProject[]> projectsPerApp = new
HashMap<IApplication, IProject[]>();
private boolean credentialsFailed = false;
- public ExpressDetailsComposite(Composite fill, IServerModeUICallback callback, String
mode, boolean showVerify) {
+ public ExpressDetailsComposite(Composite fill, IServerModeUICallback callback, boolean
showVerify) {
this.callback = callback;
this.server = callback.getServer();
- this.mode = mode;
this.composite = fill;
this.showVerify = showVerify;
this.showImportLink = showVerify;
@@ -277,6 +275,10 @@
importLink.setLayoutData(gd);
}
+ Label remoteLabel = new Label(composite, SWT.NONE);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(remoteLabel);
+ remoteText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
false).applyTo(remoteText);
Group projectSettings = new Group(composite, SWT.NONE);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
false).span(2,1).applyTo(projectSettings);
@@ -293,13 +295,6 @@
browseDestButton.setLayoutData(UIUtil.createFormData2(0,5,100,-5,null,0,100,0));
deployFolderText = new Text(zipDestComposite, SWT.SINGLE | SWT.BORDER);
deployFolderText.setLayoutData(UIUtil.createFormData2(0,5,100,-5,0,0,browseDestButton,-5));
-
-
-
- Label remoteLabel = new Label(projectSettings, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(remoteLabel);
- remoteText = new Text(projectSettings, SWT.SINGLE | SWT.BORDER);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
false).applyTo(remoteText);
// Text
projectSettings.setText("Project Settings");
@@ -416,27 +411,17 @@
}
private void deployProjectChanged() {
- System.out.println("HEEEEEEEEEEY!");
int i = deployProjectCombo.getSelectionIndex();
if( i != -1 ) {
IProject depProj =
ResourcesPlugin.getWorkspace().getRoot().getProject(deployProject);
if( depProj != null && depProj.isAccessible() ) {
- String remote = ExpressServerUtils.getProjectAttribute(depProj,
- ExpressServerUtils.SETTING_REMOTE_NAME, null);
- //ExpressServerUtils.ATTRIBUTE_REMOTE_NAME_DEFAULT);
String depFolder = ExpressServerUtils.getProjectAttribute(depProj,
ExpressServerUtils.SETTING_DEPLOY_FOLDER_NAME, null);
//ExpressServerUtils.ATTRIBUTE_DEPLOY_FOLDER_DEFAULT);
- if( remote == null ) {
- remoteText.setText(ExpressServerUtils.ATTRIBUTE_REMOTE_NAME_DEFAULT);
- }
if( depFolder == null )
deployFolderText.setText(ExpressServerUtils.ATTRIBUTE_DEPLOY_FOLDER_DEFAULT);
-
- boolean enabled = remote == null && depFolder == null;
- remoteText.setEnabled(enabled);
- deployFolderText.setEnabled(enabled);
- browseDestButton.setEnabled(enabled);
+ deployFolderText.setEnabled(depFolder == null);
+ browseDestButton.setEnabled(depFolder == null);
}
}
}
@@ -626,7 +611,7 @@
// update the values
IServerWorkingCopy wc = callback.getServer();
String host = fapplication == null ? null : fapplication.getApplicationUrl();
- ExpressServerUtils.fillServerWithOpenShiftDetails(wc, host, deployProject);
+ ExpressServerUtils.fillServerWithOpenShiftDetails(wc, host, deployProject,remote);
}
private void updateProjectSettings() {
Modified:
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsSection.java
===================================================================
---
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsSection.java 2012-04-30
15:41:30 UTC (rev 40651)
+++
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsSection.java 2012-04-30
15:54:00 UTC (rev 40652)
@@ -10,30 +10,62 @@
*******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.behaviour;
+import java.util.Arrays;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.internal.ide.dialogs.ResourceComparator;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.ui.editor.ServerEditorSection;
+import org.eclipse.wst.server.ui.internal.editor.ServerEditorPartInput;
import org.jboss.ide.eclipse.as.ui.UIUtil;
+import org.jboss.ide.eclipse.as.ui.editor.ServerWorkingCopyPropertyButtonCommand;
+import org.jboss.ide.eclipse.as.ui.editor.ServerWorkingCopyPropertyComboCommand;
+import org.jboss.ide.eclipse.as.ui.editor.ServerWorkingCopyPropertyCommand;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
public class ExpressDetailsSection extends ServerEditorSection {
private IEditorInput input;
protected Text userText, remoteText;
protected Text deployFolderText;
- protected Text appNameText, deployProjectText;
- protected Button verifyButton; // browseDestButton;
+ protected Text appNameText;
+ protected Combo deployProjectCombo;
+ protected Button verifyButton, browseDestButton, overrideProjectSettings;
+ protected Group projectSettingGroup;
public void init(IEditorSite site, IEditorInput input) {
super.init(site, input);
@@ -55,29 +87,49 @@
section.setClient(c);
initWidgets();
-// addListeners();
+ addListeners();
}
protected void initWidgets() {
// Set the widgets
String user = ExpressServerUtils.getExpressUsername(server);
String appName = ExpressServerUtils.getExpressApplicationName(server);
- String depProj = ExpressServerUtils.getExpressDeployProject(server);
+ deployProjectCombo.setEnabled(true);
userText.setText(user == null ? "" : user);
appNameText.setText(appName == null ? "" : appName);
- deployProjectText.setText(depProj == null ? "" : depProj);
userText.setEnabled(false);
appNameText.setEnabled(false);
- deployProjectText.setEnabled(false);
String outDir = ExpressServerUtils.getExpressDeployFolder(server);
String remote = ExpressServerUtils.getExpressRemoteName(server);
deployFolderText.setText(outDir == null ? "" : outDir);
remoteText.setText(remote == null ? "" : remote);
- remoteText.setEnabled(false);
- deployFolderText.setEnabled(false);
+
+ deployProjectCombo.setItems(getSuitableProjects());
+ java.util.List<String> l = Arrays.asList(deployProjectCombo.getItems());
+ String depProj = ExpressServerUtils.getExpressDeployProject(server);
+ if( depProj != null ) {
+ int ind = l.indexOf(depProj);
+ if( ind != -1 )
+ deployProjectCombo.select(ind);
+ }
+
+ boolean overrides = ExpressServerUtils.getOverridesProject(server);
+ overrideProjectSettings.setSelection(overrides);
+ remoteText.setEnabled(overrides);
+ deployFolderText.setEnabled(overrides);
+ browseDestButton.setEnabled(overrides);
}
+ private String[] getSuitableProjects() {
+ IProject[] all = ExpressServerUtils.findAllSuitableOpenshiftProjects();
+ String[] s = new String[all.length];
+ for( int i = 0; i < all.length; i++ ) {
+ s[i] = all[i].getName();
+ }
+ return s;
+ }
+
protected Composite createComposite(Section section) {
createWidgets(section);
return section;
@@ -87,35 +139,42 @@
composite.setLayout(new GridLayout(2, false));
Label deployLocationLabel = new Label(composite, SWT.NONE);
- deployProjectText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
false).applyTo(deployProjectText);
+ deployProjectCombo = new Combo(composite, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
false).applyTo(deployProjectCombo);
- Label userLabel = new Label(composite, SWT.NONE);
+ projectSettingGroup = new Group(composite, SWT.NONE);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).span(2,
1).applyTo(projectSettingGroup);
+ projectSettingGroup.setLayout(new GridLayout(2, false));
+
+ overrideProjectSettings = new Button(projectSettingGroup, SWT.CHECK);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).span(2,
1).applyTo(overrideProjectSettings);
+
+ Label userLabel = new Label(projectSettingGroup, SWT.NONE);
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(userLabel);
- userText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ userText = new Text(projectSettingGroup, SWT.SINGLE | SWT.BORDER);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
false).applyTo(userText);
- Label appNameLabel = new Label(composite, SWT.NONE);
+ Label appNameLabel = new Label(projectSettingGroup, SWT.NONE);
GridDataFactory.fillDefaults()
.align(SWT.LEFT, SWT.CENTER).applyTo(appNameLabel);
- appNameText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ appNameText = new Text(projectSettingGroup, SWT.SINGLE | SWT.BORDER);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
false).applyTo(appNameText);
+
+ Label zipDestLabel = new Label(projectSettingGroup, SWT.NONE);
+ Composite zipDestComposite = new Composite(projectSettingGroup, SWT.NONE);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
false).applyTo(zipDestComposite);
+ zipDestComposite.setLayout(new FormLayout());
+ browseDestButton = new Button(zipDestComposite, SWT.PUSH);
+ browseDestButton.setLayoutData(UIUtil.createFormData2(0,5,100,-5,null,0,100,0));
+ deployFolderText = new Text(zipDestComposite, SWT.SINGLE | SWT.BORDER);
+ deployFolderText.setLayoutData(UIUtil.createFormData2(0,5,100,-5,0,0,browseDestButton,-5));
- Label zipDestLabel = new Label(composite, SWT.NONE);
+ Label remoteLabel = new Label(projectSettingGroup, SWT.NONE);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(remoteLabel);
+ remoteText = new Text(projectSettingGroup, SWT.SINGLE | SWT.BORDER);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
false).applyTo(remoteText);
-// Composite zipDestComposite = new Composite(composite, SWT.NONE);
-// GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
false).applyTo(zipDestComposite);
-// zipDestComposite.setLayout(new FormLayout());
-// browseDestButton = new Button(zipDestComposite, SWT.PUSH);
-// browseDestButton.setLayoutData(UIUtil.createFormData2(0,5,100,-5,null,0,100,0));
- deployFolderText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- //deployFolderText.setLayoutData(UIUtil.createFormData2(0,5,100,-5,0,0,100,0));
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
false).applyTo(deployFolderText);
- Label remoteLabel = new Label(composite, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(remoteLabel);
- remoteText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
false).applyTo(remoteText);
// Text
appNameLabel.setText("Application Name: ");
@@ -123,76 +182,138 @@
zipDestLabel.setText("Output Directory: ");
userLabel.setText("Username: ");
remoteLabel.setText("Remote: ");
-// browseDestButton.setText("Browse...");
+ browseDestButton.setText("Browse...");
+ projectSettingGroup.setText("Project Settings:");
+ overrideProjectSettings.setText("Override Project Settings");
}
-// ModifyListener remoteModifyListener, deployDestinationModifyListener;
-// protected void addListeners() {
-// remoteModifyListener = new ModifyListener() {
-// public void modifyText(ModifyEvent e) {
-// ((ServerEditorPartInput) input).getServerCommandManager().execute(new
SetRemoteCommand(server));
-// }
-// };
-// remoteText.addModifyListener(remoteModifyListener);
-// deployDestinationModifyListener = new ModifyListener() {
-// public void modifyText(ModifyEvent e) {
-// ((ServerEditorPartInput) input).getServerCommandManager().execute(new
SetDeployFolderCommand(server));
-// }
-// };
-// deployFolderText.addModifyListener(deployDestinationModifyListener);
-//
-// browseDestButton.addSelectionListener(new SelectionAdapter() {
-// public void widgetSelected(SelectionEvent e) {
-// browsePressed();
-// }
-// });
+ ModifyListener remoteModifyListener, deployDestinationModifyListener,
deployProjectListener;
+ SelectionListener overrideListener;
+ protected void addListeners() {
+ deployProjectListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ int ind = deployProjectCombo.getSelectionIndex();
+ String newVal = ind == -1 ? null : deployProjectCombo.getItem(ind);
+ ((ServerEditorPartInput) input).getServerCommandManager().execute(
+ new SetProjectCommand(server, newVal));
+ }};
+ deployProjectCombo.addModifyListener(deployProjectListener);
+ overrideListener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ ((ServerEditorPartInput) input).getServerCommandManager().execute(new
SetOverrideCommand(server));
+ }
+ };
+ overrideProjectSettings.addSelectionListener(overrideListener);
-// }
-//
-// private void browsePressed() {
-// IFolder f = chooseFolder();
-// if( f != null ) {
-// deployFolderText.setText(f.getFullPath().removeFirstSegments(1).makeRelative().toOSString());
-// }
-// }
+
+ remoteModifyListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ ((ServerEditorPartInput) input).getServerCommandManager().execute(new
SetRemoteCommand(server));
+ }
+ };
+ remoteText.addModifyListener(remoteModifyListener);
+ deployDestinationModifyListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ ((ServerEditorPartInput) input).getServerCommandManager().execute(new
SetDeployFolderCommand(server));
+ }
+ };
+ deployFolderText.addModifyListener(deployDestinationModifyListener);
+
+ browseDestButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ browsePressed();
+ }
+ });
+
+ }
-// private IFolder chooseFolder() {
-// String depProject = ExpressServerUtils.getExpressDeployProject(server);
-// String depFolder = ExpressServerUtils.getExpressDeployFolder(server);
-//
-// IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(depProject);
-//
-// ILabelProvider lp= new WorkbenchLabelProvider();
-// ITreeContentProvider cp= new WorkbenchContentProvider();
-//
-// ElementTreeSelectionDialog dialog= new
ElementTreeSelectionDialog(Display.getDefault().getActiveShell(), lp, cp);
-// dialog.setTitle("Deploy Location");
-// dialog.setMessage("Please choose a location to put zipped projects");
-// dialog.setInput(p);
-// dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
-//
-// IResource res= p.findMember(new Path(depFolder));
-// if (res != null)
-// dialog.setInitialSelection(res);
-//
-// if (dialog.open() == Window.OK)
-// return (IFolder) dialog.getFirstResult();
-// return null;
-// }
-//
-// public class SetRemoteCommand extends ServerWorkingCopyPropertyCommand {
-// public SetRemoteCommand(IServerWorkingCopy server) {
-// super(server, "Change Remote Name", remoteText, remoteText.getText(),
-// ExpressServerUtils.ATTRIBUTE_REMOTE_NAME, remoteModifyListener,
-// ExpressServerUtils.ATTRIBUTE_REMOTE_NAME_DEFAULT);
-// }
-// }
-//
-// public class SetDeployFolderCommand extends ServerWorkingCopyPropertyCommand {
-// public SetDeployFolderCommand(IServerWorkingCopy server) {
-// super(server, "Change Deployment Folder", deployFolderText,
deployFolderText.getText(),
-// ExpressServerUtils.ATTRIBUTE_DEPLOY_FOLDER_NAME, deployDestinationModifyListener,
-// ExpressServerUtils.ATTRIBUTE_DEPLOY_FOLDER_DEFAULT);
-// }
-// }
+ private void browsePressed() {
+ IFolder f = chooseFolder();
+ if( f != null ) {
+ deployFolderText.setText(f.getFullPath().removeFirstSegments(1).makeRelative().toOSString());
+ }
+ }
+
+ private IFolder chooseFolder() {
+ String depProject = ExpressServerUtils.getExpressDeployProject(server);
+ String depFolder = ExpressServerUtils.getExpressDeployFolder(server);
+
+ IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(depProject);
+
+ ILabelProvider lp= new WorkbenchLabelProvider();
+ ITreeContentProvider cp= new WorkbenchContentProvider();
+
+ ElementTreeSelectionDialog dialog= new
ElementTreeSelectionDialog(Display.getDefault().getActiveShell(), lp, cp);
+ dialog.setTitle("Deploy Location");
+ dialog.setMessage("Please choose a location to put zipped projects");
+ dialog.setInput(p);
+ dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
+
+ IResource res= p.findMember(new Path(depFolder));
+ if (res != null)
+ dialog.setInitialSelection(res);
+
+ if (dialog.open() == Window.OK)
+ return (IFolder) dialog.getFirstResult();
+ return null;
+ }
+
+ public class SetRemoteCommand extends ServerWorkingCopyPropertyCommand {
+ public SetRemoteCommand(IServerWorkingCopy server) {
+ super(server, "Change Remote Name", remoteText, remoteText.getText(),
+ ExpressServerUtils.ATTRIBUTE_REMOTE_NAME, remoteModifyListener,
+ ExpressServerUtils.ATTRIBUTE_REMOTE_NAME_DEFAULT);
+ }
+ }
+
+ public class SetProjectCommand extends ServerWorkingCopyPropertyComboCommand {
+ public SetProjectCommand(IServerWorkingCopy wc, String newVal) {
+ super(wc, "Change Openshift Project", deployProjectCombo, newVal,
ExpressServerUtils.ATTRIBUTE_DEPLOY_PROJECT, deployProjectListener);
+ }
+ @Override
+ protected void postOp(int type) {
+ updateWidgetsFromWorkingCopy();
+ }
+ }
+
+ public class SetDeployFolderCommand extends ServerWorkingCopyPropertyCommand {
+ public SetDeployFolderCommand(IServerWorkingCopy server) {
+ super(server, "Change Deployment Folder", deployFolderText,
deployFolderText.getText(),
+ ExpressServerUtils.ATTRIBUTE_DEPLOY_FOLDER_NAME, deployDestinationModifyListener,
+ ExpressServerUtils.ATTRIBUTE_DEPLOY_FOLDER_DEFAULT);
+ }
+ }
+
+ public class SetOverrideCommand extends ServerWorkingCopyPropertyButtonCommand {
+ public SetOverrideCommand(IServerWorkingCopy wc) {
+ super(wc, "Override Openshift Project Settings Command",
+ overrideProjectSettings, overrideProjectSettings.getSelection(),
+ ExpressServerUtils.ATTRIBUTE_OVERRIDE_PROJECT_SETTINGS, overrideListener);
+ }
+ @Override
+ protected void postOp(int type) {
+ updateWidgetsFromWorkingCopy();
+ }
+ }
+ private void updateWidgetsFromWorkingCopy() {
+ String user = ExpressServerUtils.getExpressUsername(server);
+ String appName = ExpressServerUtils.getExpressApplicationName(server);
+ userText.setText(user == null ? "" : user);
+ appNameText.setText(appName == null ? "" : appName);
+
+ browseDestButton.setEnabled(overrideProjectSettings.getSelection());
+ deployFolderText.setEnabled(overrideProjectSettings.getSelection());
+ remoteText.setEnabled(overrideProjectSettings.getSelection());
+ String remote = ExpressServerUtils.getExpressRemoteName(server,
ExpressServerUtils.SETTING_FROM_PROJECT);
+ String depFolder = ExpressServerUtils.getExpressDeployFolder(server,
ExpressServerUtils.SETTING_FROM_PROJECT);
+ remote = remote == null ? "" : remote;
+ depFolder = depFolder == null ? "" : depFolder;
+
+ remoteText.removeModifyListener(remoteModifyListener);
+ deployFolderText.removeModifyListener(deployDestinationModifyListener);
+ remoteText.setText(remote);
+ deployFolderText.setText(depFolder);
+ remoteText.addModifyListener(remoteModifyListener);
+ deployFolderText.addModifyListener(deployDestinationModifyListener);
+ }
}
Modified:
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java
===================================================================
---
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java 2012-04-30
15:41:30 UTC (rev 40651)
+++
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java 2012-04-30
15:54:00 UTC (rev 40652)
@@ -30,7 +30,6 @@
private NewServerWizardBehaviourCallback callback;
public ExpressWizardFragment() {
- System.out.println("NEW FRAGMENT");
}
public boolean hasComposite() {
@@ -61,7 +60,7 @@
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(2, false));
this.composite = new ExpressDetailsComposite(
- composite, callback,ExpressServerUtils.EXPRESS_SOURCE_MODE, true);
+ composite, callback, true);
return this.composite.getComposite();
}
Modified:
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftExpressWizardModel.java
===================================================================
---
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftExpressWizardModel.java 2012-04-30
15:41:30 UTC (rev 40651)
+++
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftExpressWizardModel.java 2012-04-30
15:54:00 UTC (rev 40652)
@@ -23,7 +23,6 @@
import org.eclipse.wst.server.core.IServerType;
import org.jboss.tools.common.databinding.IObservablePojo;
import org.jboss.tools.openshift.egit.ui.util.EGitUIUtils;
-import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
import com.openshift.client.ApplicationScale;
import com.openshift.client.IApplication;
@@ -52,9 +51,6 @@
public static final String MERGE_URI = "mergeUri";
public static final String RUNTIME_DELEGATE = "runtimeDelegate";
public static final String CREATE_SERVER_ADAPTER = "createServerAdapter";
- public static final String PUBLICATION_MODE = "serverMode";
- public static final String PUBLISH_SOURCE = ExpressServerUtils.EXPRESS_SOURCE_MODE;
- public static final String PUBLISH_BINARY = ExpressServerUtils.EXPRESS_BINARY_MODE;
public static final String SERVER_TYPE = "serverType";
public static final String NEW_PROJECT_REMOTE_NAME_DEFAULT = "origin";
public static final String EXISTING_PROJECT_REMOTE_NAME_DEFAULT =
"openshift";
@@ -183,8 +179,6 @@
public IRuntime getRuntime();
- public String getMode();
-
public boolean isCreateServerAdapter();
public IServerType getServerType();
Modified:
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
===================================================================
---
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-04-30
15:41:30 UTC (rev 40651)
+++
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-04-30
15:54:00 UTC (rev 40652)
@@ -65,7 +65,6 @@
setRepositoryPath(DEFAULT_REPOSITORY_PATH);
setRemoteName(NEW_PROJECT_REMOTE_NAME_DEFAULT);
setServerType(ServerCore.findServerType(ExpressServerUtils.OPENSHIFT_SERVER_TYPE));
- setPublicationMode(PUBLISH_SOURCE);
}
/**
@@ -104,8 +103,7 @@
IProject project = p;
// Add the settings here!
ExpressServerUtils.updateOpenshiftProjectSettings(project, app,
- getUser(), getRemoteName(),
- ExpressServerUtils.ATTRIBUTE_DEPLOY_FOLDER_DEFAULT);
+ getUser(), getRemoteName(), ExpressServerUtils.ATTRIBUTE_DEPLOY_FOLDER_DEFAULT);
return;
}
}
@@ -328,11 +326,6 @@
}
@Override
- public String getMode() {
- return (String) getProperty(PUBLICATION_MODE);
- }
-
- @Override
public boolean isCreateServerAdapter() {
Boolean isCreateServer = (Boolean) getProperty(CREATE_SERVER_ADAPTER);
return isCreateServer != null && isCreateServer.booleanValue();
@@ -348,10 +341,6 @@
return (IServerType) setProperty(SERVER_TYPE, serverType);
}
- private void setPublicationMode(String mode) {
- setProperty(PUBLICATION_MODE, mode);
- }
-
@Override
public boolean isUseExistingApplication() {
return (Boolean) getProperty(USE_EXISTING_APPLICATION);
Modified:
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java
===================================================================
---
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java 2012-04-30
15:41:30 UTC (rev 40651)
+++
branches/jbosstools-3.3.0.Beta3/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java 2012-04-30
15:54:00 UTC (rev 40652)
@@ -51,13 +51,13 @@
}
public void create(IProject project, IOpenShiftExpressWizardModel wizardModel,
IProgressMonitor monitor) throws OpenShiftException {
- createServerAdapter(project, wizardModel.getServerType(), wizardModel.getRuntime(),
wizardModel.getMode(),
+ createServerAdapter(project, wizardModel.getServerType(), wizardModel.getRuntime(),
wizardModel.getApplication(), wizardModel.getUser(), wizardModel.getRemoteName(),
monitor);
}
- public void create(IProject project, IServerType serverType, IRuntime runtime, String
mode,
+ public void create(IProject project, IServerType serverType, IRuntime runtime,
IApplication application, UserDelegate user, IProgressMonitor monitor) throws
OpenShiftException {
- createServerAdapter(project, serverType, runtime, mode, application, user, null,
monitor);
+ createServerAdapter(project, serverType, runtime, application, user, null, monitor);
}
/**
@@ -67,21 +67,21 @@
* the monitor to report progress to.
* @throws OpenShiftException
*/
- protected void createServerAdapter(IProject project, IServerType serverType, IRuntime
runtime, String mode,
+ protected void createServerAdapter(IProject project, IServerType serverType, IRuntime
runtime,
IApplication application, UserDelegate user,
String remoteName, IProgressMonitor monitor) throws OpenShiftException {
String name = project.getName();
monitor.subTask(NLS.bind("Creating server adapter for project {0}", name));
createServerAdapter(Collections.singletonList(project), serverType, runtime,
- mode, application, user, project.getName(), remoteName, monitor);
+ application, user, project.getName(), remoteName, monitor);
}
protected void createServerAdapter(List<IProject> importedProjects, IServerType
serverType,
- IRuntime runtime, String mode, IApplication application, UserDelegate user,
+ IRuntime runtime, IApplication application, UserDelegate user,
String deployProject, String remoteName, IProgressMonitor monitor) {
try {
renameWebContextRoot(importedProjects);
- IServer server = doCreateServerAdapter(serverType, runtime, mode, application, user,
deployProject, remoteName);
+ IServer server = doCreateServerAdapter(serverType, runtime, application, user,
deployProject, remoteName);
addModules(getModules(importedProjects), server, monitor);
} catch (CoreException ce) {
OpenShiftUIActivator.getDefault().getLog().log(ce.getStatus());
@@ -102,11 +102,10 @@
}
}
- private IServer doCreateServerAdapter(IServerType serverType, IRuntime rt, String mode,
+ private IServer doCreateServerAdapter(IServerType serverType, IRuntime rt,
IApplication application, UserDelegate user, String deployProject, String remoteName)
throws CoreException,
OpenShiftException, SocketTimeoutException {
Assert.isLegal(serverType != null);
- Assert.isLegal(mode != null);
Assert.isLegal(application != null);
Assert.isLegal(user != null);
@@ -115,7 +114,7 @@
IServer server = ExpressServerUtils.createServer(rt, serverType, serverName);
ExpressServerUtils.fillServerWithOpenShiftDetails(server,
- application.getApplicationUrl(), deployProject);
+ application.getApplicationUrl(), deployProject, remoteName);
return server;
}