JBoss Tools SVN: r38195 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-01-26 04:12:18 -0500 (Thu, 26 Jan 2012)
New Revision: 38195
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java
Log:
JBIDE-10716 - impl for the wizrd fragment
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java 2012-01-26 09:05:38 UTC (rev 38194)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java 2012-01-26 09:12:18 UTC (rev 38195)
@@ -39,6 +39,7 @@
import org.eclipse.wst.server.ui.wizard.WizardFragment;
import org.jboss.tools.common.ui.WizardUtils;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
+import org.jboss.tools.openshift.express.internal.ui.wizard.AbstractOpenShiftApplicationWizardModel;
import org.jboss.tools.openshift.express.internal.ui.wizard.CredentialsWizardPageModel;
import com.openshift.express.client.IApplication;
@@ -71,7 +72,7 @@
Composite composite = createWidgets(parent);
addListeners();
setComplete(false);
- handle.update();
+ widgetsUpdated();
return composite;
}
@@ -97,6 +98,7 @@
appNameLabel.setText("Application Name: ");
remoteLabel.setText("Remote: ");
verifyButton.setText("Verify...");
+ remoteText.setText(AbstractOpenShiftApplicationWizardModel.NEW_PROJECT_REMOTE_NAME_DEFAULT);
return composite;
}
12 years, 11 months
JBoss Tools SVN: r38194 - in trunk: openshift/plugins/org.jboss.tools.openshift.express.ui and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-01-26 04:05:38 -0500 (Thu, 26 Jan 2012)
New Revision: 38194
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/WizardUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressMessages.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/expressMessages.properties
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsSection.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftApplicationWizardModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
Log:
JBIDE-10716 - impl for the wizrd fragment
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/WizardUtils.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/WizardUtils.java 2012-01-26 00:56:22 UTC (rev 38193)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/WizardUtils.java 2012-01-26 09:05:38 UTC (rev 38194)
@@ -80,6 +80,16 @@
public static Future<IStatus> runInWizard(final Job job, final DelegatingProgressMonitor delegatingMonitor,
IWizardContainer container) throws InvocationTargetException, InterruptedException {
JobResultFuture future = new JobResultFuture(job);
+ // Currently this impl is wrong and does not return the future immediately. Not sure how to fix
+ runInWizardSynchronous(job, delegatingMonitor, container);
+ return future;
+ }
+
+ /**
+ * @since 3.3
+ */
+ public static void runInWizardSynchronous(final Job job, final DelegatingProgressMonitor delegatingMonitor,
+ IWizardContainer container) throws InvocationTargetException, InterruptedException {
container.run(true, false, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
@@ -100,7 +110,6 @@
}
}
});
- return future;
}
/**
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-01-26 00:56:22 UTC (rev 38193)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-01-26 09:05:38 UTC (rev 38194)
@@ -262,5 +262,13 @@
order="10"
typeIds="org.jboss.tools.openshift.express.openshift.server.type">
</section>
+ </extension>
+ <extension
+ point="org.eclipse.wst.server.ui.wizardFragments">
+ <fragment
+ class="org.jboss.tools.openshift.express.internal.ui.behaviour.ExpressWizardFragment"
+ id="org.jboss.tools.openshift.express.ui.server.fragment"
+ typeIds="org.jboss.tools.openshift.express.openshift.server.type">
+ </fragment>
</extension>
</plugin>
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressMessages.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressMessages.java 2012-01-26 00:56:22 UTC (rev 38193)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressMessages.java 2012-01-26 09:05:38 UTC (rev 38194)
@@ -16,5 +16,6 @@
public static String cannotModifyModules;
public static String shareProjectTitle;
public static String shareProjectMessage;
+ public static String additionNotRequiredModule;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java 2012-01-26 00:56:22 UTC (rev 38193)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java 2012-01-26 09:05:38 UTC (rev 38194)
@@ -16,9 +16,10 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.model.IURLProvider;
import org.eclipse.wst.server.core.model.ServerDelegate;
-import org.eclipse.wst.server.core.model.IURLProvider;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
@@ -40,10 +41,20 @@
if( mods.length == 1 && add.length == 1 && add[0].equals(mods[0]))
return Status.OK_STATUS;
+
boolean canModify = mods.length == 0 && add.length == 1;
canModify &= remove.length == 0;
- return canModify ? Status.OK_STATUS : new Status(IStatus.ERROR,
- OpenShiftUIActivator.PLUGIN_ID, ExpressMessages.cannotModifyModules);
+
+ if(!canModify )
+ return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID, ExpressMessages.cannotModifyModules);
+
+ // Make sure if there's a requried mod, the one being added matches it
+ String requiredMod = getAttribute(ExpressServerUtils.ATTRIBUTE_APPLICATION_NAME, (String)null);
+ if( requiredMod != null && !requiredMod.equals(add[0].getName())) {
+ return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
+ NLS.bind(ExpressMessages.additionNotRequiredModule, requiredMod));
+ }
+ return Status.OK_STATUS;
}
public IModule[] getRootModules(IModule module) throws CoreException {
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-01-26 00:56:22 UTC (rev 38193)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-01-26 09:05:38 UTC (rev 38194)
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.jboss.tools.openshift.express.internal.core.behaviour;
-import static org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants.SERVER_PASSWORD;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.wst.server.core.IRuntime;
@@ -27,6 +25,10 @@
import org.jboss.ide.eclipse.as.core.util.ServerCreationUtils;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.IUser;
+import com.openshift.express.client.OpenShiftException;
+
/**
* This class holds the attribute names whose values will be
* stored inside a server object, as well as the utility methods
@@ -36,8 +38,8 @@
*/
public class ExpressServerUtils {
public static final String ATTRIBUTE_EXPRESS_MODE = "org.jboss.tools.openshift.express.internal.core.behaviour.ExpressMode";
- public static final String EXPRESS_BINARY_MODE = "org.jboss.tools.openshift.express.internal.core.behaviour.ExpressBinaryMode";
- public static final String EXPRESS_SOURCE_MODE = "org.jboss.tools.openshift.express.internal.core.behaviour.ExpressSourceMode";
+ public static final String EXPRESS_BINARY_MODE = "publishBinary";
+ public static final String EXPRESS_SOURCE_MODE = "publishSource";
public static final String ATTRIBUTE_APPLICATION_NAME = "org.jboss.tools.openshift.express.internal.core.behaviour.ApplicationName";
public static final String ATTRIBUTE_APPLICATION_ID = "org.jboss.tools.openshift.express.internal.core.behaviour.ApplicationId";
public static final String ATTRIBUTE_DOMAIN = "org.jboss.tools.openshift.express.internal.core.behaviour.Domain";
@@ -176,7 +178,22 @@
IServer server = createServer(runtime, IJBossToolingConstants.SERVER_AS_70);
return fillServerWithOpenShiftDetails(server, host, username, password, domain, appName, appId, sourceOrBinary, remoteName);
}
+
+ public static IServer fillServerWithOpenShiftDetails(IServer server, IApplication application,
+ IUser user, String mode, String remoteName) throws CoreException, OpenShiftException {
+ return fillServerWithOpenShiftDetails(server, application.getApplicationUrl(),
+ user.getRhlogin(), user.getPassword(), user.getDomain().getNamespace(),
+ application.getName(), application.getUUID(), mode, remoteName);
+ }
+
+ public static void fillServerWithOpenShiftDetails(IServerWorkingCopy wc, IApplication application,
+ IUser user, String mode, String remoteName) throws CoreException, OpenShiftException {
+ fillServerWithOpenShiftDetails(wc, application.getApplicationUrl(),
+ user.getRhlogin(), user.getDomain().getNamespace(),
+ application.getName(), application.getUUID(), mode, remoteName);
+ }
+
/**
* Fills an already-created server with the proper openshift details.
*
@@ -194,11 +211,21 @@
public static IServer fillServerWithOpenShiftDetails(IServer server, String host,
String username, String password, String domain, String appName, String appId,
String mode, String remoteName) throws CoreException {
+ ServerWorkingCopy wc = (ServerWorkingCopy)server.createWorkingCopy();
+ fillServerWithOpenShiftDetails(wc, host, username, domain, appName, appId, mode, remoteName);
+ IServer saved = wc.save(true, new NullProgressMonitor());
+ ExpressServerUtils.setExpressPassword(wc, password);
+ return saved;
+ }
+
+ public static void fillServerWithOpenShiftDetails(IServerWorkingCopy wc, String host,
+ String username, String domain, String appName, String appId,
+ String mode, String remoteName) throws CoreException {
+
if( host.indexOf("://") != -1)
host = host.substring(host.indexOf("://") + 3);
if( host.endsWith("/"))
host = host.substring(0, host.length()-1);
- ServerWorkingCopy wc = (ServerWorkingCopy)server.createWorkingCopy();
wc.setHost(host);
wc.setAttribute(IDeployableServer.SERVER_MODE, "openshift");
wc.setAttribute(ATTRIBUTE_USERNAME, username);
@@ -207,13 +234,10 @@
wc.setAttribute(ATTRIBUTE_APPLICATION_ID, appId);
wc.setAttribute(ATTRIBUTE_EXPRESS_MODE, mode);
wc.setAttribute(ATTRIBUTE_REMOTE_NAME, remoteName);
- wc.setAutoPublishSetting(Server.AUTO_PUBLISH_DISABLE);
+ ((ServerWorkingCopy)wc).setAutoPublishSetting(Server.AUTO_PUBLISH_DISABLE);
wc.setAttribute(IJBossToolingConstants.IGNORE_LAUNCH_COMMANDS, "true");
wc.setAttribute(IJBossToolingConstants.WEB_PORT, 80);
wc.setAttribute(IJBossToolingConstants.WEB_PORT_DETECT, "false");
- IServer saved = wc.save(true, new NullProgressMonitor());
- ExpressServerUtils.setExpressPassword(wc, password);
- return saved;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/expressMessages.properties
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/expressMessages.properties 2012-01-26 00:56:22 UTC (rev 38193)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/expressMessages.properties 2012-01-26 09:05:38 UTC (rev 38194)
@@ -3,5 +3,6 @@
requestPushTitle=Publish {0}?
requestPushMsg=The are no local changes in "{0}". Do you want to publish to OpenShift by pushing its Git repository?
cannotModifyModules=Openshift Express servers cannot be modified.
+additionNotRequiredModule=This server requires the {0} application.
shareProjectTitle=Share projects?
shareProjectMessage="There are {0} projects that are not connected to any git repository. Would you like to share them now?
\ No newline at end of file
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsSection.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsSection.java 2012-01-26 00:56:22 UTC (rev 38193)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsSection.java 2012-01-26 09:05:38 UTC (rev 38194)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.behaviour;
import org.eclipse.core.runtime.CoreException;
@@ -15,9 +25,7 @@
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.ui.editor.ServerEditorSection;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.ui.Messages;
import org.jboss.ide.eclipse.as.ui.editor.ServerWorkingCopyPropertyCommand;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java 2012-01-26 09:05:38 UTC (rev 38194)
@@ -0,0 +1,240 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.behaviour;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+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.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.TaskModel;
+import org.eclipse.wst.server.ui.wizard.IWizardHandle;
+import org.eclipse.wst.server.ui.wizard.WizardFragment;
+import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
+import org.jboss.tools.openshift.express.internal.ui.wizard.CredentialsWizardPageModel;
+
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.IUser;
+import com.openshift.express.client.OpenShiftException;
+
+public class ExpressWizardFragment extends WizardFragment {
+ private IWizardHandle handle;
+ private IApplication fapplication;
+ private IUser fuser;
+ private String[] appListNames;
+ private String error;
+
+ private Button verifyButton;
+ public ExpressWizardFragment() {
+ // TODO Auto-generated constructor stub
+ }
+
+ public boolean hasComposite() {
+ return true;
+ }
+
+ private String user, pass, app, remote;
+ private Text userText, passText, remoteText;
+ private Combo appNameCombo;
+ public Composite createComposite(Composite parent, IWizardHandle handle) {
+ this.handle = handle;
+ handle.setTitle("Create an Openshift Server");
+ handle.setDescription("Create an Openshift Server adapter by typing in your credentials and choosing an application.");
+ Composite composite = createWidgets(parent);
+ addListeners();
+ setComplete(false);
+ handle.update();
+ return composite;
+ }
+
+ private Composite createWidgets(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(2, false));
+ Label userLabel = new Label(composite, SWT.NONE);
+ userText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).applyTo(userText);
+ Label passLabel = new Label(composite, SWT.NONE);
+ passText = new Text(composite, SWT.PASSWORD | SWT.BORDER);
+ GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).applyTo(passText);
+ Label appNameLabel = new Label(composite, SWT.NONE);
+ appNameCombo = new Combo(composite, SWT.SINGLE);
+ Label remoteLabel = new Label(composite, SWT.NONE);
+ remoteText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ GridDataFactory.fillDefaults().hint(150, SWT.DEFAULT).applyTo(remoteText);
+ verifyButton = new Button(composite, SWT.PUSH);
+
+ // Text
+ userLabel.setText("Username: ");
+ passLabel.setText("Password: ");
+ appNameLabel.setText("Application Name: ");
+ remoteLabel.setText("Remote: ");
+ verifyButton.setText("Verify...");
+ return composite;
+ }
+
+ private void addListeners() {
+ // add listeners
+ ModifyListener l = new ModifyListener(){
+ public void modifyText(ModifyEvent e) {
+ widgetsUpdated();
+ }
+ };
+ userText.addModifyListener(l);
+ passText.addModifyListener(l);
+ appNameCombo.addModifyListener(l);
+ remoteText.addModifyListener(l);
+ appNameCombo.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e) {
+ widgetsUpdated();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetsUpdated();
+ }
+ });
+ verifyButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ verifyPressed();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ verifyPressed();
+ }
+
+ });
+ }
+
+ public void enter() {
+ // do nothing
+ }
+
+ private void widgetsUpdated() {
+ this.user = userText.getText();
+ this.pass = passText.getText();
+ this.app = appNameCombo.getText();
+ this.remote = remoteText.getText();
+ this.verifyButton.setEnabled(true);
+ setComplete(false);
+ handle.update();
+ }
+
+ private void verifyPressed() {
+ final CredentialsWizardPageModel model = new CredentialsWizardPageModel(null);
+ this.fapplication = null;
+ this.fuser = null;
+ this.appListNames = null;
+ model.setPassword(pass);
+ model.setRhLogin(user);
+ verifyButton.setEnabled(false);
+ setComplete(false);
+ handle.update();
+ final Runnable runnable = getVerifyingCredentialsJob(model);
+ Job j = new Job("Verify Pressed") {
+ protected IStatus run(IProgressMonitor monitor) {
+ runnable.run();
+ return Status.OK_STATUS;
+ }
+ };
+ IWizardContainer container = ((WizardPage)handle).getWizard().getContainer();
+ try {
+ WizardUtils.runInWizardSynchronous(j, null, container);
+ postLongRunningValidate();
+ } catch(Exception e) {
+
+ }
+ }
+
+ private void postLongRunningValidate() {
+ if( appListNames == null ) {
+ appListNames = new String[0];
+ }
+ int index = Arrays.asList(appListNames).indexOf(app);
+ appNameCombo.setItems(appListNames);
+ if( index != -1 )
+ appNameCombo.select(index);
+ handle.setMessage(error, IMessageProvider.ERROR);
+ verifyButton.setEnabled(true);
+ setComplete(ExpressWizardFragment.this.fapplication != null );
+ handle.update();
+ }
+
+ private Runnable getVerifyingCredentialsJob(final CredentialsWizardPageModel model) {
+ return new Runnable() {
+ public void run() {
+ final IStatus s = model.validateCredentials();
+ String error = null;
+ String[] appNames = new String[]{};
+ if( !s.isOK() ) {
+ error = "Credentials Failed";
+ } else {
+ // now check the app name and cartridge
+ try {
+ final List<IApplication> allApps = model.getUser().getApplications();
+ appNames = getAppNamesAsStrings(allApps);
+ int index = Arrays.asList(appNames).indexOf(app);
+ IApplication application = index == -1 ? null : allApps.get(index);
+ appListNames = appNames;
+ if( application == null ) {
+ error = "Application " + app + " not found";
+ } else {
+ // Fill with new data
+ try {
+ ExpressWizardFragment.this.fapplication = application;
+ ExpressWizardFragment.this.fuser = model.getUser();
+
+ // update the values
+ IServerWorkingCopy wc = (IServerWorkingCopy)getTaskModel().getObject(TaskModel.TASK_SERVER);
+ ExpressServerUtils.fillServerWithOpenShiftDetails(wc, application, model.getUser(),
+ ExpressServerUtils.EXPRESS_SOURCE_MODE, remote);
+ } catch(CoreException ce) {
+ // TODO FIX HANDLE
+ }
+ }
+ } catch(OpenShiftException ose) {
+ error = "Application \"" + app + "\" not found: " + ose.getMessage();
+ }
+ ExpressWizardFragment.this.error = error;
+ }
+ }
+ };
+ }
+
+ private String[] getAppNamesAsStrings(List<IApplication> allApps) {
+ String[] appNames = new String[allApps.size()];
+ for( int i = 0; i < allApps.size(); i++ ) {
+ appNames[i] = allApps.get(i).getName();
+ }
+ return appNames;
+ }
+
+ public void performFinish(IProgressMonitor monitor) throws CoreException {
+ // do nothing
+ }
+
+}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftApplicationWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftApplicationWizardModel.java 2012-01-26 00:56:22 UTC (rev 38193)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftApplicationWizardModel.java 2012-01-26 09:05:38 UTC (rev 38194)
@@ -18,6 +18,7 @@
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.egit.core.EGitUtils;
import org.jboss.tools.openshift.egit.ui.util.EGitUIUtils;
+import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.ConfigureGitSharedProject;
import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.ConfigureUnsharedProject;
import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.ImportNewProject;
@@ -42,8 +43,8 @@
public static final String CREATE_SERVER_ADAPTER = "createServerAdapter";
public static final String PUBLICATION_MODE = "serverMode";
- public static final String PUBLISH_SOURCE = "publishSource";
- public static final String PUBLISH_BINARY = "publishBinary";
+ 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";
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-01-26 00:56:22 UTC (rev 38193)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-01-26 09:05:38 UTC (rev 38194)
@@ -145,7 +145,8 @@
} catch (Exception e) {
this.user = null;
}
- wizardModel.setUser(user);
+ if( wizardModel != null )
+ wizardModel.setUser(user);
setCredentialsStatus(status);
return status;
}
12 years, 11 months
JBoss Tools SVN: r38193 - in trunk: portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-01-25 19:56:22 -0500 (Wed, 25 Jan 2012)
New Revision: 38193
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/META-INF/MANIFEST.MF
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF
Log:
updated version for org.eclipse.wst.jsdt.web.core from 1.0.401 to 1.0.400, for org.eclipse.wst.jsdt.web.ui from 1.0.401 to 1.0.400 and for org.eclipse.wst.common.modulecore from 1.2.103 to 1.2.100 to let comile under indigo 3.7.0
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/META-INF/MANIFEST.MF 2012-01-25 22:59:36 UTC (rev 38192)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/META-INF/MANIFEST.MF 2012-01-26 00:56:22 UTC (rev 38193)
@@ -25,6 +25,6 @@
org.eclipse.wst.common.frameworks;bundle-version="1.2.100",
org.eclipse.jst.common.project.facet.core;bundle-version="1.4.200",
org.eclipse.wst.common.project.facet.core;bundle-version="1.4.200",
- org.eclipse.wst.common.modulecore;bundle-version="1.2.103"
+ org.eclipse.wst.common.modulecore;bundle-version="1.2.100"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.jboss.ide.eclipse.as.archives.integration.test
Modified: trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF 2012-01-25 22:59:36 UTC (rev 38192)
+++ trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/META-INF/MANIFEST.MF 2012-01-26 00:56:22 UTC (rev 38193)
@@ -17,9 +17,9 @@
org.jboss.tools.ui.bot.ext;bundle-version="1.0.0",
org.hamcrest;bundle-version="1.1.0",
org.eclipse.ui.forms;bundle-version="3.5.0",
- org.eclipse.wst.jsdt.web.core;bundle-version="1.0.401",
+ org.eclipse.wst.jsdt.web.core;bundle-version="1.0.400",
org.eclipse.wst.jsdt.web.support.jsp;bundle-version="1.0.400",
- org.eclipse.wst.jsdt.web.ui;bundle-version="1.0.401",
+ org.eclipse.wst.jsdt.web.ui;bundle-version="1.0.400",
org.jboss.tools.project.examples.cheatsheet;bundle-version="1.2.1"
Import-Package: org.eclipse.core.runtime.adaptor,
org.eclipse.jst.j2ee.internal.plugin
12 years, 11 months
JBoss Tools SVN: r38192 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-01-25 17:59:36 -0500 (Wed, 25 Jan 2012)
New Revision: 38192
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/ChangeAnnotationMarkerResolution.java
Log:
Add the code which is supposed to be inserted by the Quick Fix into its description https://issues.jboss.org/browse/JBIDE-10636
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/ChangeAnnotationMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/ChangeAnnotationMarkerResolution.java 2012-01-25 22:35:08 UTC (rev 38191)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/ChangeAnnotationMarkerResolution.java 2012-01-25 22:59:36 UTC (rev 38192)
@@ -56,6 +56,7 @@
String shortName = CDIMarkerResolutionUtils.getShortName(parameter);
changeString += "("+shortName+")";
+ label = NLS.bind(CDIUIMessages.CHANGE_ANNOTATION_MARKER_RESOLUTION_TITLE, sourceString, changeString);
init();
}
@@ -69,12 +70,14 @@
totalList = CDIMarkerResolutionUtils.OPEN_BRACE+totalList+CDIMarkerResolutionUtils.CLOSE_BRACE;
changeString += "("+totalList+")";
+ label = NLS.bind(CDIUIMessages.CHANGE_ANNOTATION_MARKER_RESOLUTION_TITLE, sourceString, changeString);
init();
}
public ChangeAnnotationMarkerResolution(IAnnotation annotation, String[] typeNames, boolean useBraces){
this(annotation, typeNames);
this.useBraces = useBraces;
+ label = NLS.bind(CDIUIMessages.CHANGE_ANNOTATION_MARKER_RESOLUTION_TITLE, sourceString, changeString);
init();
}
12 years, 11 months
JBoss Tools SVN: r38191 - in trunk: common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-01-25 17:35:08 -0500 (Wed, 25 Jan 2012)
New Revision: 38191
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllDisposerDuplicantMarkerResolution.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllInjectedConstructorsMarkerResolution.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllOtherAnnotationsFromParametersMarkerResolution.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java
Log:
Add the code which is supposed to be inserted by the Quick Fix into its description https://issues.jboss.org/browse/JBIDE-10636
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllDisposerDuplicantMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllDisposerDuplicantMarkerResolution.java 2012-01-25 21:44:57 UTC (rev 38190)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllDisposerDuplicantMarkerResolution.java 2012-01-25 22:35:08 UTC (rev 38191)
@@ -14,7 +14,12 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.jdt.core.IMethod;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring;
import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
import org.eclipse.swt.graphics.Image;
@@ -22,7 +27,9 @@
import org.jboss.tools.cdi.core.CDIImages;
import org.jboss.tools.cdi.internal.core.refactoring.DeleteAllDisposerAnnotationsProcessor;
import org.jboss.tools.cdi.ui.CDIUIMessages;
+import org.jboss.tools.cdi.ui.CDIUIPlugin;
import org.jboss.tools.cdi.ui.wizard.DeletePreviewWizard;
+import org.jboss.tools.common.refactoring.MarkerResolutionUtils;
/**
* @author Daniel Azarov
@@ -31,11 +38,13 @@
private String label;
private IMethod method;
private IFile file;
+ private String description;
public DeleteAllDisposerDuplicantMarkerResolution(IMethod method, IFile file){
this.label = MessageFormat.format(CDIUIMessages.DELETE_ALL_DISPOSER_DUPLICANT_MARKER_RESOLUTION_TITLE, new Object[]{method.getElementName()});
this.method = method;
this.file = file;
+ description = getPreview();
}
@Override
@@ -58,9 +67,37 @@
return new DeleteAllDisposerAnnotationsProcessor(file, method, label);
}
+ private String getPreview(){
+ RefactoringProcessor processor = getRefactoringProcessor();
+ RefactoringStatus status;
+ try {
+ status = processor.checkInitialConditions(new NullProgressMonitor());
+
+
+ if(status.getEntryMatchingSeverity(RefactoringStatus.FATAL) != null){
+ return label;
+ }
+
+ status = processor.checkFinalConditions(new NullProgressMonitor(), null);
+
+ if(status.getEntryMatchingSeverity(RefactoringStatus.FATAL) != null){
+ return label;
+ }
+
+ CompositeChange rootChange = (CompositeChange)processor.createChange(new NullProgressMonitor());
+
+ return MarkerResolutionUtils.getPreview(rootChange);
+ } catch (OperationCanceledException e) {
+ CDIUIPlugin.getDefault().logError(e);
+ } catch (CoreException e) {
+ CDIUIPlugin.getDefault().logError(e);
+ }
+ return label;
+ }
+
@Override
public String getDescription() {
- return label;
+ return description;
}
@Override
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllInjectedConstructorsMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllInjectedConstructorsMarkerResolution.java 2012-01-25 21:44:57 UTC (rev 38190)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllInjectedConstructorsMarkerResolution.java 2012-01-25 22:35:08 UTC (rev 38191)
@@ -14,8 +14,13 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.Signature;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring;
import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
import org.eclipse.swt.graphics.Image;
@@ -23,7 +28,9 @@
import org.jboss.tools.cdi.core.CDIImages;
import org.jboss.tools.cdi.internal.core.refactoring.DeleteAllInjectedConstructorsProcessor;
import org.jboss.tools.cdi.ui.CDIUIMessages;
+import org.jboss.tools.cdi.ui.CDIUIPlugin;
import org.jboss.tools.cdi.ui.wizard.DeletePreviewWizard;
+import org.jboss.tools.common.refactoring.MarkerResolutionUtils;
/**
* @author Daniel Azarov
@@ -32,6 +39,7 @@
private String label;
private IMethod method;
private IFile file;
+ private String description;
public DeleteAllInjectedConstructorsMarkerResolution(IMethod method, IFile file){
StringBuffer buffer = new StringBuffer();
@@ -46,6 +54,7 @@
this.label = MessageFormat.format(CDIUIMessages.DELETE_ALL_INJECTED_CONSTRUCTORS_MARKER_RESOLUTION_TITLE, new Object[]{buffer.toString()});
this.method = method;
this.file = file;
+ description = getPreview();
}
@Override
@@ -53,7 +62,34 @@
return label;
}
+ private String getPreview(){
+ RefactoringProcessor processor = getRefactoringProcessor();
+ RefactoringStatus status;
+ try {
+ status = processor.checkInitialConditions(new NullProgressMonitor());
+
+
+ if(status.getEntryMatchingSeverity(RefactoringStatus.FATAL) != null){
+ return label;
+ }
+ status = processor.checkFinalConditions(new NullProgressMonitor(), null);
+
+ if(status.getEntryMatchingSeverity(RefactoringStatus.FATAL) != null){
+ return label;
+ }
+
+ CompositeChange rootChange = (CompositeChange)processor.createChange(new NullProgressMonitor());
+
+ return MarkerResolutionUtils.getPreview(rootChange);
+ } catch (OperationCanceledException e) {
+ CDIUIPlugin.getDefault().logError(e);
+ } catch (CoreException e) {
+ CDIUIPlugin.getDefault().logError(e);
+ }
+ return label;
+ }
+
@Override
public void run(IMarker marker) {
DeleteAllInjectedConstructorsProcessor processor = new DeleteAllInjectedConstructorsProcessor(file, method, label);
@@ -69,7 +105,7 @@
@Override
public String getDescription() {
- return label;
+ return description;
}
@Override
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllOtherAnnotationsFromParametersMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllOtherAnnotationsFromParametersMarkerResolution.java 2012-01-25 21:44:57 UTC (rev 38190)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAllOtherAnnotationsFromParametersMarkerResolution.java 2012-01-25 22:35:08 UTC (rev 38191)
@@ -14,7 +14,12 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.jdt.core.ILocalVariable;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring;
import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
import org.eclipse.swt.graphics.Image;
@@ -23,7 +28,9 @@
import org.jboss.tools.cdi.internal.core.refactoring.CDIMarkerResolutionUtils;
import org.jboss.tools.cdi.internal.core.refactoring.DeleteOtherAnnotationsFromParametersProcessor;
import org.jboss.tools.cdi.ui.CDIUIMessages;
+import org.jboss.tools.cdi.ui.CDIUIPlugin;
import org.jboss.tools.cdi.ui.wizard.DeletePreviewWizard;
+import org.jboss.tools.common.refactoring.MarkerResolutionUtils;
/**
* @author Daniel Azarov
@@ -33,6 +40,7 @@
private String annotationName;
private ILocalVariable parameter;
private IFile file;
+ private String description;
public DeleteAllOtherAnnotationsFromParametersMarkerResolution(String annotationName, ILocalVariable parameter, IFile file){
String shortName = CDIMarkerResolutionUtils.AT + CDIMarkerResolutionUtils.getShortName(annotationName);
@@ -40,6 +48,7 @@
this.annotationName = annotationName;
this.parameter = parameter;
this.file = file;
+ description = getPreview();
}
@Override
@@ -47,7 +56,34 @@
return label;
}
+ private String getPreview(){
+ RefactoringProcessor processor = getRefactoringProcessor();
+ RefactoringStatus status;
+ try {
+ status = processor.checkInitialConditions(new NullProgressMonitor());
+
+
+ if(status.getEntryMatchingSeverity(RefactoringStatus.FATAL) != null){
+ return label;
+ }
+ status = processor.checkFinalConditions(new NullProgressMonitor(), null);
+
+ if(status.getEntryMatchingSeverity(RefactoringStatus.FATAL) != null){
+ return label;
+ }
+
+ CompositeChange rootChange = (CompositeChange)processor.createChange(new NullProgressMonitor());
+
+ return MarkerResolutionUtils.getPreview(rootChange);
+ } catch (OperationCanceledException e) {
+ CDIUIPlugin.getDefault().logError(e);
+ } catch (CoreException e) {
+ CDIUIPlugin.getDefault().logError(e);
+ }
+ return label;
+ }
+
@Override
public void run(IMarker marker) {
DeleteOtherAnnotationsFromParametersProcessor processor = new DeleteOtherAnnotationsFromParametersProcessor(file, annotationName, parameter, label);
@@ -63,7 +99,7 @@
@Override
public String getDescription() {
- return label;
+ return description;
}
@Override
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java 2012-01-25 21:44:57 UTC (rev 38190)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java 2012-01-25 22:35:08 UTC (rev 38191)
@@ -37,7 +37,10 @@
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.internal.core.JavaElement;
import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.TextEditBasedChange;
import org.eclipse.text.edits.DeleteEdit;
import org.eclipse.text.edits.InsertEdit;
import org.eclipse.text.edits.MultiTextEdit;
@@ -609,29 +612,69 @@
return null;
}
- public static String getPreview(TextChange previewChange) throws CoreException{
+ public static String getPreview(Change previewChange) throws CoreException{
if(previewChange == null)
return null;
- String preview = previewChange.getPreviewContent(new NullProgressMonitor());
- String current = previewChange.getCurrentContent(new NullProgressMonitor());
+ // CompositeChange
+ // TextEditBasedChange
+ // TextChange
- TextEdit edit = previewChange.getEdit();
- EditSet editSet = new EditSet(edit);
+ String preview = getPreviewContent(previewChange);
+ //String current = previewChange.getCurrentContent(new NullProgressMonitor());
- // select
- preview = editSet.select(preview, current);
+ TextEdit edit = getEdit(previewChange);
- // cut
- preview = editSet.cut(preview);
-
- // format
- preview = preview.replaceAll(NEW_LINE, LINE_BREAK);
-
- return preview;
+ if(preview != null && edit != null){
+ EditSet editSet = new EditSet(edit);
+
+ // select
+ preview = editSet.select(preview);
+
+ // cut
+ preview = editSet.cut(preview);
+
+ // format
+ preview = preview.replaceAll(NEW_LINE, LINE_BREAK);
+
+ return preview;
+ }
+ return "";
}
+ private static String getPreviewContent(Change change) throws CoreException{
+ if(change instanceof TextEditBasedChange){
+ return ((TextEditBasedChange) change).getPreviewContent(new NullProgressMonitor());
+ }else if(change instanceof TextChange){
+ return ((TextChange) change).getPreviewContent(new NullProgressMonitor());
+ }else if(change instanceof CompositeChange){
+ for(Change child : ((CompositeChange) change).getChildren()){
+ String prev = getPreviewContent(child);
+ if(prev != null){
+ return prev;
+ }
+ }
+ }
+ return null;
+ }
+
+ private static TextEdit getEdit(Change change) throws CoreException{
+ if(change instanceof BaseFileChange){
+ return ((BaseFileChange) change).getEdit();
+ }else if(change instanceof TextChange){
+ return ((TextChange) change).getEdit();
+ }else if(change instanceof CompositeChange){
+ for(Change child : ((CompositeChange) change).getChildren()){
+ TextEdit prev = getEdit(child);
+ if(prev != null){
+ return prev;
+ }
+ }
+ }
+ return null;
+ }
+
static class EditSet{
private ArrayList<TextEdit> edits = new ArrayList<TextEdit>();
private ArrayList<Region> regions = new ArrayList<Region>();
@@ -672,7 +715,7 @@
edits = sorted;
}
- public String select(String preview, String current){
+ public String select(String preview){
int delta = 0;
for(TextEdit edit : edits){
String text = null;
12 years, 11 months
JBoss Tools SVN: r38190 - trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-01-25 16:44:57 -0500 (Wed, 25 Jan 2012)
New Revision: 38190
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SolderDefaultBeanFilterContributor.java
Log:
Code improvent: default bean extension is to be obtained by static helper method getExtension(CDICoreNature) rather than by common getExtensionByRuntime with runtime id which may change.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SolderDefaultBeanFilterContributor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SolderDefaultBeanFilterContributor.java 2012-01-25 21:27:23 UTC (rev 38189)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/SolderDefaultBeanFilterContributor.java 2012-01-25 21:44:57 UTC (rev 38190)
@@ -14,6 +14,7 @@
import java.util.Iterator;
import java.util.Set;
+import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IBeanMember;
import org.jboss.tools.cdi.core.IInjectionPoint;
@@ -34,7 +35,7 @@
@Override
public void contribute(AssignableBeanFilters filters, IInjectionPoint injectionPoint) {
- ICDIExtension ext = injectionPoint.getCDIProject().getNature().getExtensionManager().getExtensionByRuntime("org.jboss.solder.bean.defaultbean.DefaultBeanExtension");
+ ICDIExtension ext = CDISeamSolderDefaultBeanExtension.getExtension(injectionPoint.getCDIProject().getNature());
if(ext == null) {
return;
}
12 years, 11 months
JBoss Tools SVN: r38189 - trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-01-25 16:27:23 -0500 (Wed, 25 Jan 2012)
New Revision: 38189
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java
Log:
Code improvent: default bean extension is to be obtained by static helper method getExtension(CDICoreNature) rather than by common getExtensionByRuntime with runtime id which may change.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java 2012-01-25 19:12:41 UTC (rev 38188)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java 2012-01-25 21:27:23 UTC (rev 38189)
@@ -24,6 +24,7 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.CDIUtil;
import org.jboss.tools.cdi.core.IBean;
@@ -71,9 +72,22 @@
*
*/
public class CDISeamSolderDefaultBeanExtension implements ICDIExtension, IProcessAnnotatedTypeFeature, IAmbiguousBeanResolverFeature, IValidatorFeature, IBeanKeyProvider, IBeanStoreFeature {
+ private static String ID = "org.jboss.solder.bean.defaultbean.DefaultBeanExtension"; //$NON-NLS-1$
+ private static String ID_30 = "org.jboss.seam.solder.bean.defaultbean.DefaultBeanExtension"; //$NON-NLS-1$
protected Map<String, Set<IBean>> defaultBeansByKey = new HashMap<String, Set<IBean>>();
+ public static CDISeamSolderDefaultBeanExtension getExtension(CDICoreNature project) {
+ ICDIExtension result = project.getExtensionManager().getExtensionByRuntime(ID);
+ if(result == null) {
+ result = project.getExtensionManager().getExtensionByRuntime(ID_30);
+ }
+ if(result instanceof CDISeamSolderDefaultBeanExtension) {
+ return (CDISeamSolderDefaultBeanExtension)result;
+ }
+ return null;
+ }
+
protected Version getVersion() {
return Version.instance;
}
12 years, 11 months
JBoss Tools SVN: r38188 - trunk/openshift/plugins/org.jboss.tools.openshift.express.client.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-01-25 14:12:41 -0500 (Wed, 25 Jan 2012)
New Revision: 38188
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/openshift-java-client-1.0.1-SNAPSHOT.jar
Log:
[JBIDE-10676] added the latest client jar to our client bundle
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/openshift-java-client-1.0.1-SNAPSHOT.jar
===================================================================
(Binary files differ)
12 years, 11 months
JBoss Tools SVN: r38187 - trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-01-25 13:57:36 -0500 (Wed, 25 Jan 2012)
New Revision: 38187
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/CommonValidationPlugin.java
Log:
JBIDE-10703
https://issues.jboss.org/browse/JBIDE-10703
CommonValidationPlugin is modified to follow the common pattern.
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/CommonValidationPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/CommonValidationPlugin.java 2012-01-25 18:50:10 UTC (rev 38186)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/CommonValidationPlugin.java 2012-01-25 18:57:36 UTC (rev 38187)
@@ -16,8 +16,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.jboss.tools.common.log.BaseUIPlugin;
-import org.jboss.tools.common.log.IPluginLog;
-import org.osgi.framework.BundleContext;
/**
* @author Alexey Kazakov
@@ -25,47 +23,21 @@
public class CommonValidationPlugin extends BaseUIPlugin {
public static final String PLUGIN_ID = "org.jboss.tools.common.validation"; //$NON-NLS-1$
- protected static CommonValidationPlugin INSTANCE;
+ protected static CommonValidationPlugin plugin;
public CommonValidationPlugin() {
+ plugin = this;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- INSTANCE = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- INSTANCE = null;
- super.stop(context);
- }
-
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static CommonValidationPlugin getDefault() {
- return INSTANCE;
+ return plugin;
}
- /**
- * @return IPluginLog object
- */
- public static IPluginLog getPluginLog() {
- return getDefault();
- }
-
public static boolean makeBuilderLast(IProject project, String builderId) throws CoreException {
IProjectDescription d = project.getDescription();
ICommand[] bs = d.getBuildSpec();
12 years, 11 months
JBoss Tools SVN: r38186 - trunk/common/plugins/org.jboss.tools.common.resref.ui/src/org/jboss/tools/common/resref/ui.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-01-25 13:50:10 -0500 (Wed, 25 Jan 2012)
New Revision: 38186
Modified:
trunk/common/plugins/org.jboss.tools.common.resref.ui/src/org/jboss/tools/common/resref/ui/Activator.java
Log:
JBIDE-10703
https://issues.jboss.org/browse/JBIDE-10703
resref.ui.Activator is modified to follow the common pattern.
Modified: trunk/common/plugins/org.jboss.tools.common.resref.ui/src/org/jboss/tools/common/resref/ui/Activator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.resref.ui/src/org/jboss/tools/common/resref/ui/Activator.java 2012-01-25 18:46:49 UTC (rev 38185)
+++ trunk/common/plugins/org.jboss.tools.common.resref.ui/src/org/jboss/tools/common/resref/ui/Activator.java 2012-01-25 18:50:10 UTC (rev 38186)
@@ -11,7 +11,6 @@
package org.jboss.tools.common.resref.ui;
import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
@@ -28,26 +27,9 @@
* The constructor
*/
public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
plugin = this;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
/**
* Returns the shared instance
*
12 years, 11 months