JBoss Tools SVN: r26142 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-29 10:51:12 -0400 (Fri, 29 Oct 2010)
New Revision: 26142
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
Log:
[JBIDE-7459] added error dialog and messages to instance action job
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-10-29 14:50:51 UTC (rev 26141)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-10-29 14:51:12 UTC (rev 26142)
@@ -1,5 +1,9 @@
2010-10-29 André Dietisheim <adietish(a)redhat.com>
+ * src/org/jboss/tools/deltacloud/ui/views/CVMessages.java (getFormattedString):
+ [JBIDE-7459] changed to allow variable number of arguments
+ * src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java (getActiveShell):
+ [JBIDE-7459] added error dialog
* src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java (needsProgressMonitor):
[JBIDE-7458] added a progress bar to the wizard, run credentials tests in a separate thread.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java (needsProgressMonitor):
14 years, 1 month
JBoss Tools SVN: r26141 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-29 10:50:51 -0400 (Fri, 29 Oct 2010)
New Revision: 26141
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java
Log:
[JBIDE-7459] added error dialog and messages to instance action job
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-10-29 14:23:51 UTC (rev 26140)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-10-29 14:50:51 UTC (rev 26141)
@@ -8,6 +8,9 @@
# Contributors:
# Red Hat Incorporated - initial API and implementation
#################################################################################
+InstanceActionError.title=Error
+InstanceActionError.msg=Could not {0} on instance {1}
+
InstanceCategoryName=Instances
ImageCategoryName=Images
CloudViewName=Cloud View
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java 2010-10-29 14:23:51 UTC (rev 26140)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java 2010-10-29 14:50:51 UTC (rev 26141)
@@ -14,11 +14,19 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.ui.Activator;
+import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
public class PerformInstanceActionThread extends Job {
+
+ private static final String INSTANCEACTION_ERROR_TITLE = "InstanceActionError.title"; //$NON-NLS-1$
+ private static final String INSTANCEACTION_ERROR_MESSAGE = "InstanceActionError.msg"; //$NON-NLS-1$
+
private DeltaCloud cloud;
private DeltaCloudInstance instance;
private String action;
@@ -63,7 +71,13 @@
}
}
} catch (DeltaCloudException e) {
- // do nothing..action had problem executing..perhaps illegal
+ IStatus status = StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
+ Activator.log(status);
+ ErrorDialog.openError(
+ UIUtils.getActiveShell(),
+ CVMessages.getString(INSTANCEACTION_ERROR_TITLE),
+ CVMessages.getFormattedString(INSTANCEACTION_ERROR_MESSAGE, action, instance.getName()),
+ status);
} finally {
cloud.removeActionJob(id, this);
pm.done();
14 years, 1 month
JBoss Tools SVN: r26140 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-29 10:23:51 -0400 (Fri, 29 Oct 2010)
New Revision: 26140
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionModel.java
Log:
cleanup: removed system.out messages
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionModel.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionModel.java 2010-10-29 14:21:44 UTC (rev 26139)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionModel.java 2010-10-29 14:23:51 UTC (rev 26140)
@@ -105,7 +105,6 @@
}
public String getUrl() {
- System.err.println("getting url: " + url);
return url;
}
@@ -115,7 +114,6 @@
}
public DeltaCloudClient.DeltaCloudType getType() {
- System.err.println("getting cloud type: " + cloudType);
return cloudType;
}
14 years, 1 month
JBoss Tools SVN: r26139 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-29 10:21:44 -0400 (Fri, 29 Oct 2010)
New Revision: 26139
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java
Log:
cleanup: added copyright headers
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java 2010-10-29 14:13:07 UTC (rev 26138)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/PerformInstanceActionThread.java 2010-10-29 14:21:44 UTC (rev 26139)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.deltacloud.ui.views;
import org.eclipse.core.runtime.IProgressMonitor;
14 years, 1 month
JBoss Tools SVN: r26138 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-29 10:13:07 -0400 (Fri, 29 Oct 2010)
New Revision: 26138
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
Log:
[JBIDE-7458] added a progress bar to the wizard, run credentials tests in a separate thread.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-10-29 14:11:29 UTC (rev 26137)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-10-29 14:13:07 UTC (rev 26138)
@@ -1,3 +1,12 @@
+2010-10-29 André Dietisheim <adietish(a)redhat.com>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java (needsProgressMonitor):
+ [JBIDE-7458] added a progress bar to the wizard, run credentials tests in a separate thread.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java (needsProgressMonitor):
+ [JBIDE-7458] added a progress bar to the wizard, run credentials tests in a separate thread.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
+ (CredentialsTestAdapter.onTestCredentials): [JBIDE-7458] added a progress bar to the wizard, run credentials tests in a separate thread.
+
2010-10-26 André Dietisheim <adietish(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudTypeValidator.java (validate):
14 years, 1 month
JBoss Tools SVN: r26137 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-29 10:11:29 -0400 (Fri, 29 Oct 2010)
New Revision: 26137
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
Log:
[JBIDE-7458] added a progress bar to the wizard, run credentials tests in a separate thread.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-10-29 14:06:29 UTC (rev 26136)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-10-29 14:11:29 UTC (rev 26137)
@@ -10,8 +10,11 @@
*******************************************************************************/
package org.jboss.tools.internal.deltacloud.ui.wizards;
+import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
@@ -23,6 +26,7 @@
import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
import org.eclipse.jface.databinding.swt.ISWTObservableValue;
@@ -30,6 +34,7 @@
import org.eclipse.jface.databinding.wizard.WizardPageSupport;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -40,11 +45,13 @@
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.PlatformUI;
import org.jboss.tools.common.log.LogHelper;
import org.jboss.tools.deltacloud.core.DeltaCloudManager;
@@ -63,8 +70,12 @@
private static final int CLOUDTYPE_CHECK_DELAY = 500;
- private static final String DESCRIPTION = "NewCloudConnection.desc"; //$NON-NLS-1$
- private static final String TITLE = "NewCloudConnection.title"; //$NON-NLS-1$
+ private static final String DESCRIPTION = "CloudConnection.desc"; //$NON-NLS-1$
+ private static final String TITLE = "CloudConnection.title"; //$NON-NLS-1$
+ private static final String TEST_SUCCESSFUL = "CloudConnectionTestSuccess.msg"; //$NON-NLS-1$
+ private static final String TEST_FAILURE = "CloudConnectionTestFailure.msg"; //$NON-NLS-1$
+ private static final String TESTING_CREDENTIALS = "CloudConnectionTestingCredentials.msg"; //$NON-NLS-1$;
+ private static final String INVALID_CREDENTIALS = "CloudConnectionInvalidCredentials.msg"; //$NON-NLS-1$;
private static final String URL_LABEL = "Url.label"; //$NON-NLS-1$
private static final String NAME_LABEL = "Name.label"; //$NON-NLS-1$
private static final String CLOUDTYPE_LABEL = "Type.label"; //$NON-NLS-1$
@@ -75,11 +86,9 @@
private static final String EC2_PASSWORD_INFO = "EC2PasswordLink.text"; //$NON-NLS-1$
private static final String NAME_ALREADY_IN_USE = "ErrorNameInUse.text"; //$NON-NLS-1$
private static final String COULD_NOT_OPEN_BROWSER = "ErrorCouldNotOpenBrowser.text"; //$NON-NLS-1$
- private static final String TEST_SUCCESSFUL = "NewCloudConnectionTest.success"; //$NON-NLS-1$
- private static final String TEST_FAILURE = "NewCloudConnectionTest.failure"; //$NON-NLS-1$
private static final String MUST_ENTER_A_NAME = "ErrorMustNameConnection.text"; //$NON-NLS-1$
private static final String MUST_ENTER_A_URL = "ErrorMustProvideUrl.text"; //$NON-NLS-1$;
-
+
private CloudConnectionModel connectionModel;
private CloudConnection cloudConnection;
@@ -137,26 +146,62 @@
}
/**
- * A Listener that listens to user clicks on a button that allows it to test
- * credentials.
+ * A component that displays the result of the credentials test. Listens to
+ * clicks on the test-button (that allows you to test the credentials) and
+ * to changes in the username and password text fields.
*
* @see CloudConnection#performTest()
+ * @see IValueChangeListener#handleValueChange(ValueChangeEvent)
+ * @see ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart,
+ * org.eclipse.jface.viewers.ISelection)
*/
private class CredentialsTestAdapter extends SelectionAdapter implements IValueChangeListener {
- private ControlDecoration[] controlDecorations;
+ private List<ControlDecoration> controlDecorations;
- public CredentialsTestAdapter(ControlDecoration... controlDecorations) {
- this.controlDecorations = controlDecorations;
- setDecorations(false);
+ public CredentialsTestAdapter(Control... controls) {
+ this.controlDecorations = createDecorations(controls);
+ showDecorations(false);
}
+ private List<ControlDecoration> createDecorations(Control... controls) {
+ List<ControlDecoration> decorations = new ArrayList<ControlDecoration>();
+ for (Control control : controls) {
+ decorations.add(JFaceUtils.createDecoration(control, WizardMessages.getString(INVALID_CREDENTIALS)));
+ }
+ return decorations;
+ }
+
public void widgetSelected(SelectionEvent event) {
- boolean success = cloudConnection.performTest();
- setMessage(success);
- setDecorations(!success);
+ try {
+ getWizard().getContainer().run(true, true, onTestCredentials());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
+ private IRunnableWithProgress onTestCredentials() {
+ return new IRunnableWithProgress() {
+ @Override
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ monitor.beginTask(WizardMessages.getString(TESTING_CREDENTIALS), 2);
+ monitor.worked(1);
+ final boolean success = cloudConnection.performTest();
+ monitor.worked(2);
+ getShell().getDisplay().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ setMessage(success);
+ showDecorations(!success);
+ }
+
+ });
+ monitor.done();
+ }
+ };
+ }
+
private void setMessage(boolean success) {
if (success) {
CloudConnectionPage.this.setMessage(WizardMessages.getString(TEST_SUCCESSFUL));
@@ -169,7 +214,7 @@
CloudConnectionPage.this.setMessage(""); //$NON-NLS-1$
}
- private void setDecorations(boolean visible) {
+ private void showDecorations(boolean visible) {
for (ControlDecoration controlDecoration : controlDecorations) {
if (visible) {
controlDecoration.show();
@@ -181,7 +226,7 @@
@Override
public void handleValueChange(ValueChangeEvent event) {
- setDecorations(false);
+ showDecorations(false);
clearMessage();
}
}
@@ -279,7 +324,6 @@
Label usernameLabel = new Label(container, SWT.NULL);
usernameLabel.setText(WizardMessages.getString(USERNAME_LABEL));
Text usernameText = new Text(container, SWT.BORDER | SWT.SINGLE);
- ControlDecoration usernameDecoration = JFaceUtils.createDecoration(usernameText, TEST_FAILURE);
IObservableValue usernameObservable = WidgetProperties.text(SWT.Modify).observe(usernameText);
dbc.bindValue(
usernameObservable,
@@ -290,7 +334,6 @@
Label passwordLabel = new Label(container, SWT.NULL);
passwordLabel.setText(WizardMessages.getString(PASSWORD_LABEL));
Text passwordText = new Text(container, SWT.BORDER | SWT.PASSWORD | SWT.SINGLE);
- ControlDecoration passwordDecoration = JFaceUtils.createDecoration(passwordText, TEST_FAILURE);
ISWTObservableValue passwordTextObservable = WidgetProperties.text(SWT.Modify).observe(passwordText);
dbc.bindValue(
passwordTextObservable,
@@ -303,8 +346,9 @@
urlTypeBinding.getValidationStatus().addValueChangeListener(
enableButtonOnUrlValidityChanges(testButton, isUrlValid));
- CredentialsTestAdapter credentialsTestAdapter = new CredentialsTestAdapter(usernameDecoration,
- passwordDecoration);
+ CredentialsTestAdapter credentialsTestAdapter = new CredentialsTestAdapter(
+ usernameText,
+ passwordText);
testButton.addSelectionListener(credentialsTestAdapter);
usernameObservable.addValueChangeListener(credentialsTestAdapter);
passwordTextObservable.addValueChangeListener(credentialsTestAdapter);
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java 2010-10-29 14:06:29 UTC (rev 26136)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java 2010-10-29 14:11:29 UTC (rev 26137)
@@ -114,4 +114,10 @@
}
return true;
}
+
+ @Override
+ public boolean needsProgressMonitor() {
+ return true;
+ }
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java 2010-10-29 14:06:29 UTC (rev 26136)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java 2010-10-29 14:11:29 UTC (rev 26137)
@@ -87,4 +87,8 @@
return true;
}
+ @Override
+ public boolean needsProgressMonitor() {
+ return true;
+ }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-10-29 14:06:29 UTC (rev 26136)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-10-29 14:11:29 UTC (rev 26137)
@@ -8,11 +8,13 @@
# Contributors:
# Red Hat Incorporated - initial API and implementation
#################################################################################
-NewCloudConnection.desc=Specify connection details for a cloud you wish to access
-NewCloudConnection.title=Cloud Connection
-NewCloudConnection.name=Cloud Connection
-NewCloudConnectionTest.success=Connection Test successful
-NewCloudConnectionTest.failure=Connection Test failed
+CloudConnection.desc=Specify connection details for a cloud you wish to access
+CloudConnection.title=Cloud Connection
+CloudConnection.name=Cloud Connection
+CloudConnectionTestSuccess.msg=Connection Test successful
+CloudConnectionTestFailure.msg=Connection Test failed
+CloudConnectionTestingCredentials.msg=Testing credentials...
+CloudConnectionInvalidCredentials.msg=Invalid credentials
EditCloudConnection.name=Edit Cloud Connection
EditCloudConnectionError.title=Error Editing Cloud Connection
14 years, 1 month
JBoss Tools SVN: r26136 - trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-10-29 10:06:29 -0400 (Fri, 29 Oct 2010)
New Revision: 26136
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsf2-components.meta
Log:
JBIDE-7457
https://jira.jboss.org/browse/JBIDE-7457
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsf2-components.meta
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsf2-components.meta 2010-10-29 14:05:55 UTC (rev 26135)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsf2-components.meta 2010-10-29 14:06:29 UTC (rev 26136)
@@ -33,6 +33,7 @@
</ICONS>
<GlobalActions kind="list"/>
<XModelEntity
+ AdoptManagerClass="org.jboss.tools.jst.web.model.handlers.JSPCompoundAdopt"
ImplementationLoadingClass="org.jboss.tools.jsf.jsf2.model.FileCompositeComponentLoader"
ImplementingClass="org.jboss.tools.common.model.filesystems.impl.SimpleFileImpl"
ObjectEditorClass="org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor"
14 years, 1 month
JBoss Tools SVN: r26135 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-29 10:05:55 -0400 (Fri, 29 Oct 2010)
New Revision: 26135
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java
Log:
cleanup
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java 2010-10-29 14:03:48 UTC (rev 26134)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java 2010-10-29 14:05:55 UTC (rev 26135)
@@ -430,8 +430,6 @@
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.parse(new InputSource(new StringReader(xml)));
- // checkForErrors(document);
-
instance.setImageId(getIdFromHref(getAttributeValues(document, "image", "href").get(0))); //$NON-NLS-1$ //$NON-NLS-2$
instance.setProfileId(getIdFromHref(getAttributeValues(document, "hardware_profile", "href").get(0))); //$NON-NLS-1$ //$NON-NLS-2$
getProfileProperties(instance, getPropertyNodes(document, "hardware_profile")); //$NON-NLS-1$
14 years, 1 month
JBoss Tools SVN: r26134 - trunk/vpe/plugins/org.jboss.tools.vpe.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-10-29 10:03:48 -0400 (Fri, 29 Oct 2010)
New Revision: 26134
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
Log:
https://jira.jboss.org/browse/JBIDE-7383
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2010-10-29 14:00:29 UTC (rev 26133)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2010-10-29 14:03:48 UTC (rev 26134)
@@ -162,6 +162,21 @@
point="org.jboss.tools.jst.jsp.visulaEditorImplementations" id="org.jboss.tools.vpe.editor.VpeEditorPartFactory">
<visualEditorImplementation name="%visualEditorImpl_name" class="org.jboss.tools.vpe.editor.VpeEditorPartFactory"/>
</extension>
+ <extension point="org.eclipse.core.expressions.definitions">
+ <definition id="org.jboss.tools.ui.vpe.editor">
+ <or>
+ <with variable="activeEditorId">
+ <equals value="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor"/>
+ </with>
+ <with variable="activeEditorId">
+ <equals value="org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor"/>
+ </with>
+ <with variable="activeEditorId">
+ <equals value="org.jboss.tools.jst.jsp.jspeditor.DocBookEditor"/>
+ </with>
+ </or>
+ </definition>
+ </extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
@@ -251,7 +266,7 @@
id="org.jboss.tools.vpe.menus.showBundleAsELCommand"
mnemonic="S"/>
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ <reference definitionId="org.jboss.tools.ui.vpe.editor"/>
</visibleWhen>
</menu>
</menuContribution>
@@ -263,7 +278,7 @@
id="org.jboss.tools.vpe.toolbars.preferencesCommand"
tooltip="%vpe.toolbar.preferences">
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ <reference definitionId="org.jboss.tools.ui.vpe.editor"/>
</visibleWhen>
</command>
<command
@@ -272,7 +287,7 @@
id="org.jboss.tools.vpe.toolbars.refreshCommand"
tooltip="%vpe.toolbar.refresh">
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ <reference definitionId="org.jboss.tools.ui.vpe.editor"/>
</visibleWhen>
</command>
<command
@@ -281,7 +296,7 @@
id="org.jboss.tools.vpe.toolbars.pageDesignOptionsCommand"
tooltip="%vpe.toolbar.page_design_options">
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ <reference definitionId="org.jboss.tools.ui.vpe.editor"/>
</visibleWhen>
</command>
<command
@@ -289,7 +304,7 @@
icon=""
id="org.jboss.tools.vpe.toolbars.rotateEditorsCommand">
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ <reference definitionId="org.jboss.tools.ui.vpe.editor"/>
</visibleWhen>
</command>
<command
@@ -299,7 +314,7 @@
id="org.jboss.tools.vpe.toolbars.showBorderCommand"
tooltip="%vpe.toolbar.show_border">
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ <reference definitionId="org.jboss.tools.ui.vpe.editor"/>
</visibleWhen>
</command>
<command
@@ -309,7 +324,7 @@
id="org.jboss.tools.vpe.toolbars.showNonVisualTagsCommand"
tooltip="%vpe.toolbar.show_non_visual_tags">
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ <reference definitionId="org.jboss.tools.ui.vpe.editor"/>
</visibleWhen>
</command>
<command
@@ -319,7 +334,7 @@
id="org.jboss.tools.vpe.toolbars.showTextFormattingCommand"
tooltip="%vpe.toolbar.show_text_formatting">
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ <reference definitionId="org.jboss.tools.ui.vpe.editor"/>
</visibleWhen>
</command>
<command
@@ -329,7 +344,7 @@
id="org.jboss.tools.vpe.toolbars.showBundleAsELCommand"
tooltip="%vpe.toolbar.show_bundle_as_el">
<visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.structuredEditor"/>
+ <reference definitionId="org.jboss.tools.ui.vpe.editor"/>
</visibleWhen>
</command>
</menuContribution>
14 years, 1 month
JBoss Tools SVN: r26133 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar: handlers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-10-29 10:00:29 -0400 (Fri, 29 Oct 2010)
New Revision: 26133
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/handlers/SelectionBarHandler.java
Log:
https://jira.jboss.org/browse/JBIDE-7430: VPE Selection Bar is not visible at first start
- replaced the method SelectionBarHandler.isEnabled() by the method SelectionBarHandler.setEnabled(evaluationContext) which fires the command listeners for every change.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java 2010-10-29 13:14:27 UTC (rev 26132)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java 2010-10-29 14:00:29 UTC (rev 26133)
@@ -185,7 +185,6 @@
toolbar.setLayoutData(toolbarData);
createArrowButton();
- setVisible(toggleSelBarCommand.isEnabled()&&(Boolean)toggleSelBarState.getValue());
return splitter;
}
@@ -208,7 +207,8 @@
* fit in the default-size toolbars (at least under Windows XP).
* This temporary ToolItem is needed to set enough size to the toolbar.*/
ToolItem tempItem = new ToolItem(toolbar, SWT.DROP_DOWN);
- tempItem.setText("foo"); //$NON-NLS-1$
+ tempItem.setText(" "); //$NON-NLS-1$
+ tempItem.setEnabled(false);
this.getParent().layout(true, true);
tempItem.dispose();
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/handlers/SelectionBarHandler.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/handlers/SelectionBarHandler.java 2010-10-29 13:14:27 UTC (rev 26132)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/handlers/SelectionBarHandler.java 2010-10-29 14:00:29 UTC (rev 26133)
@@ -17,8 +17,8 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.HandlerEvent;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.ui.ISources;
import org.eclipse.ui.commands.IElementUpdater;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.menus.UIElement;
@@ -29,34 +29,41 @@
*/
public class SelectionBarHandler extends AbstractHandler implements IElementUpdater{
- @Override
- public boolean isEnabled() {
- boolean result=false;
- IEditorPart activeEditor= PlatformUI
- .getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if(activeEditor instanceof JSPMultiPageEditor){
- JSPMultiPageEditor jspEditor = (JSPMultiPageEditor) activeEditor;
- if(jspEditor.getSelectedPageIndex()!=jspEditor.getPreviewIndex()){
- result=true;
- }
- }
- return result;
- }
/**
* The constructor.
*/
public SelectionBarHandler() {
}
-
+
+ @Override
+ public void setEnabled(Object evaluationContext) {
+ boolean enabled = false;
+
+ if (evaluationContext instanceof IEvaluationContext) {
+ IEvaluationContext context = (IEvaluationContext) evaluationContext;
+ Object activeEditor = context.getVariable(ISources.ACTIVE_EDITOR_NAME);
+ if(activeEditor instanceof JSPMultiPageEditor){
+ JSPMultiPageEditor jspEditor = (JSPMultiPageEditor) activeEditor;
+ if(jspEditor.getSelectedPageIndex() != jspEditor.getPreviewIndex()){
+ enabled = true;
+ }
+ }
+ }
+
+ setBaseEnabled(enabled);
+ }
+
/**
* the command has been executed, so extract extract the needed information
* from the application context.
*/
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
HandlerUtil.toggleCommandState(event.getCommand());
return null;
}
+ @Override
public void updateElement(UIElement element, Map parameters) {
fireHandlerChanged(new HandlerEvent(this, true, false));
}
14 years, 1 month