Author: rob.stryker(a)jboss.com
Date: 2011-10-13 03:54:52 -0400 (Thu, 13 Oct 2011)
New Revision: 35608
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenshiftDeployUI.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
Log:
JBIDE-9793 - trying to synch with andre, keep clobbering each other
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2011-10-13
06:09:42 UTC (rev 35607)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2011-10-13
07:54:52 UTC (rev 35608)
@@ -31,6 +31,13 @@
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";
+ }
+
public static IServer setExpressMode(IServer server, String val) throws CoreException {
IServerWorkingCopy wc = server.createWorkingCopy();
wc.setAttribute(ATTRIBUTE_EXPRESS_MODE, val);
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenshiftDeployUI.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenshiftDeployUI.java 2011-10-13
06:09:42 UTC (rev 35607)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenshiftDeployUI.java 2011-10-13
07:54:52 UTC (rev 35608)
@@ -41,7 +41,7 @@
userText = new Text(composite, SWT.BORDER);
Label passLabel = new Label(composite, SWT.NONE);
passLabel.setText("Openshift Password:");
- passText = new Text(composite, SWT.BORDER);
+ passText = new Text(composite, SWT.BORDER | SWT.PASSWORD);
Label domainLabel = new Label(composite, SWT.NONE);
domainLabel.setText("Domain: " +
ExpressServerUtils.getExpressDomain(callback.getServer()));
@@ -49,14 +49,17 @@
appLabel.setText("App: " +
ExpressServerUtils.getExpressApplication(callback.getServer()));
Label modeLabel = new Label(composite, SWT.NONE);
- modeLabel.setText("Mode:");
+ modeLabel.setText("Mode: " +
ExpressServerUtils.getExpressModeAsString(callback.getServer()));
+ userText.setText(ExpressServerUtils.getExpressUsername(callback.getServer()));
+ passText.setText(ExpressServerUtils.getExpressPassword(callback.getServer()));
+
// Maybe just make this a label ??
- modeCombo = new Combo(composite, SWT.READ_ONLY);
- modeCombo.setItems(new String[]{
- "Source", "Binary"
- });
- modeCombo.select(0);
+// modeCombo = new Combo(composite, SWT.READ_ONLY);
+// modeCombo.setItems(new String[]{
+// "Source", "Binary"
+// });
+// modeCombo.select(0);
nameLabel.setLayoutData(UIUtil.createFormData2(0, 5,null,0,0,5,null,0));
userText.setLayoutData(UIUtil.createFormData2(0,3,null,0,nameLabel,5,100,-5));
@@ -67,7 +70,7 @@
domainLabel.setLayoutData(UIUtil.createFormData2(passText,5,null,0,0,5,null,0));
appLabel.setLayoutData(UIUtil.createFormData2(domainLabel,5,null,0,0,5,null,0));
modeLabel.setLayoutData(UIUtil.createFormData2(appLabel,5,null,0,0,5,null,0));
- modeCombo.setLayoutData(UIUtil.createFormData2(appLabel,3,null,0,modeLabel,5,100,-5));
+// modeCombo.setLayoutData(UIUtil.createFormData2(appLabel,3,null,0,modeLabel,5,100,-5));
}
}
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-10-13
06:09:42 UTC (rev 35607)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-10-13
07:54:52 UTC (rev 35608)
@@ -52,7 +52,6 @@
import org.eclipse.wst.server.core.TaskModel;
import org.eclipse.wst.server.ui.internal.Messages;
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.Trace;
import org.eclipse.wst.server.ui.internal.wizard.TaskWizard;
import org.eclipse.wst.server.ui.internal.wizard.WizardTaskUtil;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
@@ -178,8 +177,15 @@
protected void enableServerWidgets(boolean enabled) {
suitableRuntimes.setEnabled(enabled);
+ runtimeLabel.setEnabled(enabled);
+ addRuntimeLink.setEnabled(enabled);
+ domainLabel.setEnabled(enabled);
+ modeLabel.setEnabled(enabled);
}
+ private Link addRuntimeLink;
+ private Label runtimeLabel;
+
private void fillServerAdapterGroup(Group serverAdapterGroup) {
Composite c = new Composite(serverAdapterGroup, SWT.NONE);
c.setLayout(new FormLayout());
@@ -197,12 +203,12 @@
}
});
- Label l = new Label(c, SWT.BORDER);
- l.setText("Local Runtime: ");
+ runtimeLabel = new Label(c, SWT.BORDER);
+ runtimeLabel.setText("Local Runtime: ");
suitableRuntimes = new Combo(c, SWT.READ_ONLY);
- Link addRuntime = new Link(c, SWT.NONE);
- addRuntime.setText("<a>" + Messages.addRuntime +
"</a>");
+ addRuntimeLink = new Link(c, SWT.NONE);
+ addRuntimeLink.setText("<a>" + Messages.addRuntime +
"</a>");
domainLabel = new Label(c, SWT.NONE);
// appLabel = new Label(c, SWT.NONE);
@@ -216,7 +222,7 @@
public void widgetDefaultSelected(SelectionEvent e) {
}
});
- addRuntime.addSelectionListener(new SelectionAdapter() {
+ addRuntimeLink.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IRuntimeType type = getValidRuntimeType();
showRuntimeWizard(type);
@@ -224,14 +230,14 @@
});
serverAdapterCheckbox.setLayoutData(UIUtil.createFormData2(0, 5, null, 0, 0, 5, null,
0));
- l.setLayoutData(UIUtil.createFormData2(serverAdapterCheckbox, 5, null, 0, 0, 5, null,
0));
- addRuntime.setLayoutData(UIUtil.createFormData2(serverAdapterCheckbox, 5, null, 0,
null, 0, 100, -5));
- suitableRuntimes.setLayoutData(UIUtil.createFormData2(serverAdapterCheckbox, 5, null,
0, l, 5, addRuntime, -5));
+ runtimeLabel.setLayoutData(UIUtil.createFormData2(serverAdapterCheckbox, 5, null, 0, 0,
5, null, 0));
+ addRuntimeLink.setLayoutData(UIUtil.createFormData2(serverAdapterCheckbox, 5, null, 0,
null, 0, 100, -5));
+ suitableRuntimes.setLayoutData(UIUtil.createFormData2(serverAdapterCheckbox, 5, null,
0, runtimeLabel, 5, addRuntimeLink, -5));
domainLabel.setLayoutData(UIUtil.createFormData2(suitableRuntimes, 5, null, 0, 0, 5,
100, 0));
// appLabel.setLayoutData(UIUtil.createFormData2(domainLabel, 5, null,
// 0, 0, 5, 100, 0));
modeLabel.setLayoutData(UIUtil.createFormData2(domainLabel, 5, null, 0, 0, 5, 100,
0));
-
+ serverAdapterCheckbox.setSelection(true);
}
private void updateSelectedRuntimeDelegate() {
@@ -312,9 +318,7 @@
IRuntimeWorkingCopy runtimeWorkingCopy = runtimeType.createRuntime(null, null);
taskModel.putObject(TaskModel.TASK_RUNTIME, runtimeWorkingCopy);
} catch (CoreException ce) {
- if (Trace.SEVERE) {
- Trace.trace(Trace.STRING_SEVERE, "Error creating runtime", ce);
- }
+ OpenshiftUIActivator.getDefault().getLog().log(ce.getStatus());
return Window.CANCEL;
}
fragment = new WizardFragment() {
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-13
06:09:42 UTC (rev 35607)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-13
07:54:52 UTC (rev 35608)
@@ -31,11 +31,15 @@
import org.eclipse.jgit.transport.JschConfigSessionFactory;
import org.eclipse.jgit.transport.URIish;
import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.client.IApplication;
import org.jboss.tools.openshift.express.client.IUser;
import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
import org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator;
import
org.jboss.tools.openshift.express.internal.ui.wizard.projectimport.GeneralProjectImportOperation;
import
org.jboss.tools.openshift.express.internal.ui.wizard.projectimport.MavenProjectImportOperation;
@@ -185,5 +189,23 @@
private void createServerAdapterIfRequired() {
// TODO
+ Boolean b = (Boolean)getProperty(AdapterWizardPageModel.CREATE_SERVER);
+ if( b != null && b.booleanValue() ) {
+ IServerType type = (IServerType)getProperty(AdapterWizardPageModel.SERVER_TYPE);
+ IRuntime rt = (IRuntime)getProperty(AdapterWizardPageModel.RUNTIME_DELEGATE);
+ String mode = (String)getProperty(AdapterWizardPageModel.MODE);
+
+ try {
+ IServer server = ExpressServerUtils.createServer(rt, type, "Openshift
Server1");
+ ExpressServerUtils.fillServerWithOpenshiftDetails(server,
getApplication().getApplicationUrl(),
+ getUser().getRhlogin(), getUser().getPassword(),
+ getUser().getDomain().getRhcDomain(), getApplication().getName(), mode);
+ } catch(CoreException ce) {
+ OpenshiftUIActivator.getDefault().getLog().log(ce.getStatus());
+ } catch( OpenshiftException ose) {
+ IStatus s = new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID, "Cannot
create openshift server adapter", ose);
+ OpenshiftUIActivator.getDefault().getLog().log(s);
+ }
+ }
}
}