JBoss Tools SVN: r26758 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers.
by jbosstools-commits@lists.jboss.org
Author: dvinnichek
Date: 2010-11-19 07:54:52 -0500 (Fri, 19 Nov 2010)
New Revision: 26758
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java
Log:
some minor fixes for toolbar buttons tests
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java 2010-11-19 12:38:09 UTC (rev 26757)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java 2010-11-19 12:54:52 UTC (rev 26758)
@@ -102,7 +102,17 @@
* @throws Throwable
*/
public void testCommandState() throws Throwable {
- JSPMultiPageEditor multiPageEditor = openInputUserNameJsp();
+ // initially all commands should be disabled
+ IFile vpeFile = (IFile) TestUtil.getComponentPath("inputUserName.jsp",
+ VpeUiTests.IMPORT_PROJECT_NAME);
+
+ /*
+ * Open file in the VPE
+ */
+ IEditorInput input = new FileEditorInput(vpeFile);
+ JSPMultiPageEditor multiPageEditor = openEditor(input);
+ TestUtil.delay(500);
+ pageChange(multiPageEditor, 0);
checkCommandState(true);
pageChange(multiPageEditor, 1);
checkCommandState(false);
@@ -165,7 +175,7 @@
* @throws Throwable
*/
public void testShowBorderForUnknownTags() throws Throwable {
-
+
JSPMultiPageEditor multiPageEditor = openInputUserNameJsp();
Command command = getCommandById(ShowBorderHandler.COMMAND_ID);
@@ -183,7 +193,7 @@
boolean prefBorderVisibility = prefStore
.getBoolean(IVpePreferencesPage.SHOW_BORDER_FOR_UNKNOWN_TAGS);
assertEquals(!oldToogleState, prefBorderVisibility);
-
+
VpeController vpeController = (VpeController) multiPageEditor
.getVisualEditor().getController();
VpeVisualDomBuilder visualDomBuilder = vpeController.getVisualBuilder();
@@ -191,21 +201,22 @@
.isShowBorderForUnknownTags();
assertEquals(!oldToogleState, uiBorderVisibility);
}
-
+
/**
* Test 'Show non-visual tags' toolbar button
*
* @throws Throwable
*/
public void testShowNonVisualTags() throws Throwable {
-
+
JSPMultiPageEditor multiPageEditor = openInputUserNameJsp();
Command command = getCommandById(ShowNonVisualTagsHandler.COMMAND_ID);
State state = command.getState(RegistryToggleState.STATE_ID);
boolean oldToogleState = ((Boolean) state.getValue()).booleanValue();
- handlerService.executeCommand(ShowNonVisualTagsHandler.COMMAND_ID, null);
+ handlerService
+ .executeCommand(ShowNonVisualTagsHandler.COMMAND_ID, null);
TestUtil.delay(500);
boolean newToogleState = ((Boolean) state.getValue()).booleanValue();
@@ -216,7 +227,7 @@
boolean prefNonVisualTagsVisibility = prefStore
.getBoolean(IVpePreferencesPage.SHOW_NON_VISUAL_TAGS);
assertEquals(!oldToogleState, prefNonVisualTagsVisibility);
-
+
VpeController vpeController = (VpeController) multiPageEditor
.getVisualEditor().getController();
VpeVisualDomBuilder visualDomBuilder = vpeController.getVisualBuilder();
@@ -224,14 +235,14 @@
.isShowInvisibleTags();
assertEquals(!oldToogleState, uiNonVisualTagsVisibility);
}
-
+
/**
* Test 'Show bundle's messages as EL expressions' toolbar button
*
* @throws Throwable
*/
public void testShowBundleAsEL() throws Throwable {
-
+
JSPMultiPageEditor multiPageEditor = openInputUserNameJsp();
Command command = getCommandById(ShowBundleAsELHandler.COMMAND_ID);
@@ -249,7 +260,7 @@
boolean prefBundleAsELVisibility = prefStore
.getBoolean(IVpePreferencesPage.SHOW_RESOURCE_BUNDLES_USAGE_AS_EL);
assertEquals(!oldToogleState, prefBundleAsELVisibility);
-
+
VpeController vpeController = (VpeController) multiPageEditor
.getVisualEditor().getController();
BundleMap bundle = vpeController.getPageContext().getBundle();
15 years, 5 months
JBoss Tools SVN: r26757 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-19 07:38:09 -0500 (Fri, 19 Nov 2010)
New Revision: 26757
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java
Log:
[JBIDE-7642] ignore errors. Odd RSE behavior: reports error even if connection succeeds
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java 2010-11-19 12:35:34 UTC (rev 26756)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java 2010-11-19 12:38:09 UTC (rev 26757)
@@ -110,9 +110,9 @@
monitor.done();
return Status.OK_STATUS;
} catch (Exception e) {
- // odd behavior: ignore errors since things work even if
- // service report connection failure.
-
+ // odd behavior: service reports connection failure even if things seem to work (view opens up with connection in it)
+ // ignore errors since things work
+ //
// return StatusFactory.getInstance(IStatus.ERROR,
// Activator.PLUGIN_ID, e.getMessage(), e);
return Status.OK_STATUS;
15 years, 5 months
JBoss Tools SVN: r26756 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-19 07:35:34 -0500 (Fri, 19 Nov 2010)
New Revision: 26756
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java
Log:
[JBIDE-7642] ignore errors. Odd RSE behavior: reports error even if connection succeeds
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java 2010-11-19 12:31:38 UTC (rev 26755)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java 2010-11-19 12:35:34 UTC (rev 26756)
@@ -110,7 +110,12 @@
monitor.done();
return Status.OK_STATUS;
} catch (Exception e) {
- return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
+ // odd behavior: ignore errors since things work even if
+ // service report connection failure.
+
+ // return StatusFactory.getInstance(IStatus.ERROR,
+ // Activator.PLUGIN_ID, e.getMessage(), e);
+ return Status.OK_STATUS;
}
}
};
@@ -118,7 +123,7 @@
job.schedule();
return job;
}
-
+
public static void showRemoteSystemExplorer(Job job) {
job.addJobChangeListener(new JobChangeAdapter() {
@@ -126,7 +131,8 @@
public void done(IJobChangeEvent event) {
super.done(event);
showRemoteSystemExplorer();
- }});
+ }
+ });
}
public static void showRemoteSystemExplorer() {
15 years, 5 months
JBoss Tools SVN: r26755 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-19 07:31:38 -0500 (Fri, 19 Nov 2010)
New Revision: 26755
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
Log:
[JBIDE-7642] replace remote system explorer icon
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-11-19 12:30:28 UTC (rev 26754)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-11-19 12:31:38 UTC (rev 26755)
@@ -531,8 +531,8 @@
</command>
<command
commandId="org.jboss.tools.deltacloud.ui.showremotesysexplorer"
- disabledIcon="icons/cloud.gif"
- icon="icons/cloud.gif"
+ disabledIcon="icons/system_viewd.gif"
+ icon="icons/system_view.gif"
label="%command.showInRemoteSysExplorer"
style="push"
tooltip="%command.showInRemoteSysExplorer.tooltip">
15 years, 5 months
JBoss Tools SVN: r26754 - 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-11-19 07:30:28 -0500 (Fri, 19 Nov 2010)
New Revision: 26754
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java
Log:
[JBIDE-7642] cleanup, removed erroneous return of OK_STATUS although things failed
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java 2010-11-19 12:02:22 UTC (rev 26753)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java 2010-11-19 12:30:28 UTC (rev 26754)
@@ -103,9 +103,8 @@
RSEUtils.getSystemRegistry());
RSEUtils.connect(connectionName, RSEUtils.getConnectorService(host));
} catch (Exception e) {
- ErrorUtils.handleError("Error", "Could not launch remote system explorer for instance \""
+ return ErrorUtils.handleError("Error", "Could not launch remote system explorer for instance \""
+ instance.getName() + "\"", e, getShell());
- return Status.OK_STATUS;
}
}
pm.done();
15 years, 5 months
JBoss Tools SVN: r26753 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools: deltacloud/ui/commands and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-19 07:02:22 -0500 (Fri, 19 Nov 2010)
New Revision: 26753
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ShowRSEViewRunnable.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/ShowInRemoteSystemExplorerHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java
Log:
[JBIDE-7642] refactored RSEUtils
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java 2010-11-19 11:11:53 UTC (rev 26752)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java 2010-11-19 12:02:22 UTC (rev 26753)
@@ -10,11 +10,16 @@
******************************************************************************/
package org.jboss.tools.deltacloud.ui;
+import java.text.MessageFormat;
+
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.rse.core.IRSECoreRegistry;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin;
@@ -23,13 +28,16 @@
import org.eclipse.rse.core.model.SystemStartHere;
import org.eclipse.rse.core.subsystems.IConnectorService;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PartInitException;
import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.ui.commands.AbstractCloudJob;
import org.jboss.tools.deltacloud.ui.views.CVMessages;
+import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
public class RSEUtils {
+ private static final String VIEW_REMOTESYSEXPLORER_ID = "org.eclipse.rse.ui.view.systemView";
private final static String RSE_CONNECTING_MSG = "ConnectingRSE.msg"; //$NON-NLS-1$
public static IRSESystemType getSSHOnlySystemType() {
@@ -41,6 +49,8 @@
if (sysType.getId().equals(IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID))
sshType = sysType;
}
+ Assert.isTrue(sshType != null,
+ "Remote System Explorer could not initialize SSH subsystem: ssh type not found");
return sshType;
}
@@ -49,23 +59,29 @@
}
public static String createConnectionName(DeltaCloudInstance instance) {
+ Assert.isLegal(instance != null, "Cannot create connection name: instance is not defined");
return instance.getName() + " [" + instance.getId() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
}
public static String createHostName(DeltaCloudInstance instance) {
- if (instance == null) {
- return null;
- }
- return instance.getHostName();
+ Assert.isLegal(instance != null, "Cannot get hostname: instance is not defined");
+
+ String hostName = instance.getHostName();
+ Assert.isTrue(hostName != null && hostName.length() > 0,
+ MessageFormat.format("Cannot get host name: not defined for instance {0}", instance.getName()));
+ return hostName;
}
- public static IHost createHost(String connectionName, String hostname) throws Exception {
- ISystemRegistry registry = getSystemRegistry();
- IRSESystemType sshOnlySystemType = getSSHOnlySystemType();
- // TODO: Internationalize string
- Assert.isTrue(sshOnlySystemType != null,
- "Remote System Explorer could not initialize SSH subsystem: ssh type not found");
- IHost host = registry.createHost(sshOnlySystemType, connectionName, hostname, null);
+ public static IHost createHost(String connectionName, String hostname, IRSESystemType systemType,
+ ISystemRegistry systemRegistry) throws Exception {
+ // TODO: Internationalize strings
+ Assert.isLegal(connectionName != null && connectionName.length() > 0,
+ "Cannot create Host: connectionName is not defined");
+ Assert.isLegal(hostname != null && hostname.length() > 0, "Cannot create Host: hostname is not defined");
+ Assert.isLegal(systemType != null, "Cannot create Host: system type is not defined");
+ Assert.isLegal(systemRegistry != null, "Cannot create Host: system registry is not defined");
+
+ IHost host = systemRegistry.createHost(systemType, connectionName, hostname, null);
host.setDefaultUserId("root"); //$NON-NLS-1$
return host;
}
@@ -78,16 +94,19 @@
return services[0];
}
- public static void connect(final String instanceName, final IConnectorService service, String connectionName) {
+ public static Job connect(String connectionName, final IConnectorService service)
+ throws Exception {
// TODO: internationalize strings
+ Assert.isLegal(connectionName != null,
+ "Remote System Explorer could not connect: connection name is not defined");
Assert.isLegal(service != null, "Remote System Explorer could not connect: connector service not found.");
- Job connect = new AbstractCloudJob(CVMessages.getFormattedString(RSE_CONNECTING_MSG, connectionName)) {
+
+ Job job = new AbstractCloudJob(CVMessages.getFormattedString(RSE_CONNECTING_MSG, connectionName)) {
@Override
protected IStatus doRun(IProgressMonitor monitor) {
try {
monitor.worked(1);
service.connect(monitor);
- Display.getDefault().asyncExec(new ShowRSEViewRunnable(instanceName));
monitor.done();
return Status.OK_STATUS;
} catch (Exception e) {
@@ -95,17 +114,80 @@
}
}
};
- connect.setUser(true);
- connect.schedule();
+ job.setUser(true);
+ job.schedule();
+ return job;
}
+
+ public static void showRemoteSystemExplorer(Job job) {
+ job.addJobChangeListener(new JobChangeAdapter() {
- public static void launchRemoteSystemExplorer(String instanceName, String connectionName, IHost host) throws Exception {
- if (host != null) {
- IConnectorService service = RSEUtils.getConnectorService(host);
- connect(instanceName, service, connectionName);
- } else {
- // Assume failure is due to name already in use
- Display.getDefault().asyncExec(new ShowRSEViewRunnable(instanceName));
- }
+ @Override
+ public void done(IJobChangeEvent event) {
+ super.done(event);
+ showRemoteSystemExplorer();
+ }});
}
+
+ public static void showRemoteSystemExplorer() {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ UIUtils.showView(VIEW_REMOTESYSEXPLORER_ID);
+ } catch (PartInitException e) {
+ IStatus status = StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
+ // TODO: internationalize strings
+ ErrorDialog.openError(UIUtils.getActiveShell(),
+ "Error",
+ "Could not launch remote system explorer",
+ status);
+ }
+ }
+ });
+ }
+
+ // private static void test() {
+ // ISystemRegistry registry = SystemStartHere.getSystemRegistry();
+ // RSECorePlugin rsep = RSECorePlugin.getDefault();
+ // IRSECoreRegistry coreRegistry = rsep.getCoreRegistry();
+ // IRSESystemType[] sysTypes = coreRegistry.getSystemTypes();
+ // IRSESystemType sshType = null;
+ // for (IRSESystemType sysType : sysTypes) {
+ // if (sysType.getId().equals(IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID))
+ // sshType = sysType;
+ // }
+ // String connectionName = instance.getName() + " [" + instance.getId() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ // try {
+ // IHost host = registry.createHost(sshType, connectionName, hostname,
+ // null);
+ // if (host != null) {
+ // host.setDefaultUserId("root"); //$NON-NLS-1$
+ // IConnectorService[] services = host.getConnectorServices();
+ // if (services.length > 0) {
+ // final IConnectorService service = services[0];
+ // Job connect = new Job(CVMessages.getFormattedString(RSE_CONNECTING_MSG,
+ // connectionName)) {
+ // @Override
+ // protected IStatus run(IProgressMonitor monitor) {
+ // try {
+ // service.connect(monitor);
+ // return Status.OK_STATUS;
+ // } catch (Exception e) {
+ // return Status.CANCEL_STATUS;
+ // }
+ // }
+ // };
+ // connect.setUser(true);
+ // connect.schedule();
+ // }
+ // }
+ // } catch (Exception e) {
+ // // TODO Auto-generated catch block
+ // Activator.log(e);
+ // }
+ //
+ // }
+
}
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ShowRSEViewRunnable.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ShowRSEViewRunnable.java 2010-11-19 11:11:53 UTC (rev 26752)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ShowRSEViewRunnable.java 2010-11-19 12:02:22 UTC (rev 26753)
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * 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;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.jboss.tools.common.log.StatusFactory;
-
-public class ShowRSEViewRunnable implements Runnable {
-
- private static final String VIEW_REMOTESYSEXPLORER_ID = "org.eclipse.rse.ui.view.systemView";
-
- private String instanceName;
-
- public ShowRSEViewRunnable(String instanceName) {
- this.instanceName = instanceName;
- }
-
- @Override
- public void run() {
- try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow()
- .getActivePage()
- .showView(VIEW_REMOTESYSEXPLORER_ID);
- } catch (PartInitException e) {
- IStatus status = StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
- // TODO: internationalize strings
- ErrorDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- "Error",
- "Could not launch remote system explorer for instance \"" + instanceName + "\"",
- status);
- }
- }
-}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/ShowInRemoteSystemExplorerHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/ShowInRemoteSystemExplorerHandler.java 2010-11-19 11:11:53 UTC (rev 26752)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/ShowInRemoteSystemExplorerHandler.java 2010-11-19 12:02:22 UTC (rev 26753)
@@ -16,6 +16,7 @@
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.rse.core.model.IHost;
@@ -38,10 +39,14 @@
DeltaCloudInstance instance = UIUtils.getFirstAdaptedElement(selection, DeltaCloudInstance.class);
try {
String connectionName = RSEUtils.createConnectionName(instance);
- IHost host = RSEUtils.createHost(connectionName, RSEUtils.createHostName(instance));
- RSEUtils.launchRemoteSystemExplorer(instance.getName(), connectionName, host);
+ IHost host = RSEUtils.createHost(connectionName,
+ RSEUtils.createHostName(instance),
+ RSEUtils.getSSHOnlySystemType(),
+ RSEUtils.getSystemRegistry());
+ Job connectJob = RSEUtils.connect(connectionName, RSEUtils.getConnectorService(host));
+ RSEUtils.showRemoteSystemExplorer(connectJob);
} catch (Exception e) {
- return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
"Could not launch remote system explorer for instance \"" + instance.getName() + "\"",
e);
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java 2010-11-19 11:11:53 UTC (rev 26752)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java 2010-11-19 12:02:22 UTC (rev 26753)
@@ -38,6 +38,7 @@
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.menus.IMenuService;
import org.eclipse.ui.part.EditorPart;
@@ -328,4 +329,9 @@
return site.getPage();
}
+ public static void showView(String viewId) throws PartInitException {
+ Assert.isLegal(viewId != null && viewId.length() > 0);
+ getActivePage().showView(viewId);
+ }
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2010-11-19 11:11:53 UTC (rev 26752)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2010-11-19 12:02:22 UTC (rev 26753)
@@ -46,9 +46,9 @@
private final static String DONT_SHOW_THIS_AGAIN_MSG = "DontShowThisAgain.msg"; //$NON-NLS-1$
private final static String STARTING_INSTANCE_MSG = "StartingInstance.msg"; //$NON-NLS-1$
private final static String STARTING_INSTANCE_TITLE = "StartingInstance.title"; //$NON-NLS-1$
-
+
private NewInstancePage mainPage;
-
+
private DeltaCloud cloud;
private DeltaCloudImage image;
private DeltaCloudInstance instance;
@@ -57,38 +57,39 @@
this.cloud = cloud;
this.image = image;
}
-
+
@Override
public void addPages() {
mainPage = new NewInstancePage(cloud, image);
addPage(mainPage);
}
-
+
@Override
public boolean canFinish() {
return mainPage.isPageComplete();
}
-
-
+
private class WatchCreateJob extends Job {
-
+
private DeltaCloud cloud;
private String instanceId;
private String instanceName;
-
- public WatchCreateJob(String title, DeltaCloud cloud,
+
+ public WatchCreateJob(String title, DeltaCloud cloud,
String instanceId, String instanceName) {
super(title);
this.cloud = cloud;
this.instanceId = instanceId;
this.instanceName = instanceName;
}
-
+
public IStatus run(IProgressMonitor pm) {
- if (!pm.isCanceled()){
+ if (!pm.isCanceled()) {
DeltaCloudInstance instance = null;
try {
- pm.beginTask(WizardMessages.getFormattedString(STARTING_INSTANCE_MSG, new String[] {instanceName}), IProgressMonitor.UNKNOWN);
+ pm.beginTask(
+ WizardMessages.getFormattedString(STARTING_INSTANCE_MSG, new String[] { instanceName }),
+ IProgressMonitor.UNKNOWN);
pm.worked(1);
cloud.registerInstanceJob(instanceId, this);
instance = cloud.waitWhilePending(instanceId, pm);
@@ -103,24 +104,27 @@
if (hostname != null && hostname.length() > 0 && autoConnect) {
try {
String connectionName = RSEUtils.createConnectionName(instance);
- IHost host = RSEUtils.createHost(connectionName, RSEUtils.createHostName(instance));
- RSEUtils.launchRemoteSystemExplorer(instance.getName(), connectionName, host);
+ IHost host = RSEUtils.createHost(connectionName,
+ RSEUtils.createHostName(instance),
+ RSEUtils.getSSHOnlySystemType(),
+ RSEUtils.getSystemRegistry());
+ RSEUtils.connect(connectionName, RSEUtils.getConnectorService(host));
} catch (Exception e) {
- ErrorUtils.handleError("Error", "Could not launch remote system explorer for instance \"" + instance.getName() + "\"", e, getShell());
+ ErrorUtils.handleError("Error", "Could not launch remote system explorer for instance \""
+ + instance.getName() + "\"", e, getShell());
return Status.OK_STATUS;
}
}
pm.done();
}
return Status.OK_STATUS;
- }
- else {
+ } else {
pm.done();
return Status.CANCEL_STATUS;
}
};
};
-
+
@Override
public boolean performFinish() {
String imageId = image.getId();
@@ -135,24 +139,27 @@
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- }
-
+ }
+
boolean result = false;
String errorMessage = WizardMessages.getString(DEFAULT_REASON);
try {
Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
- boolean dontShowDialog = prefs.getBoolean(IDeltaCloudPreferenceConstants.DONT_CONFIRM_CREATE_INSTANCE, false);
+ boolean dontShowDialog = prefs.getBoolean(IDeltaCloudPreferenceConstants.DONT_CONFIRM_CREATE_INSTANCE,
+ false);
if (!dontShowDialog) {
MessageDialogWithToggle dialog =
- MessageDialogWithToggle.openOkCancelConfirm(getShell(), WizardMessages.getString(CONFIRM_CREATE_TITLE),
- WizardMessages.getString(CONFIRM_CREATE_MSG),
- WizardMessages.getString(DONT_SHOW_THIS_AGAIN_MSG),
- false, null, null);
+ MessageDialogWithToggle.openOkCancelConfirm(getShell(),
+ WizardMessages.getString(CONFIRM_CREATE_TITLE),
+ WizardMessages.getString(CONFIRM_CREATE_MSG),
+ WizardMessages.getString(DONT_SHOW_THIS_AGAIN_MSG),
+ false, null, null);
int retCode = dialog.getReturnCode();
boolean toggleState = dialog.getToggleState();
if (retCode == Dialog.CANCEL)
return true;
- // If warning turned off by user, set the preference for future usage
+ // If warning turned off by user, set the preference for future
+ // usage
if (toggleState) {
prefs.putBoolean(IDeltaCloudPreferenceConstants.DONT_CONFIRM_CREATE_INSTANCE, true);
}
@@ -173,9 +180,11 @@
errorMessage = e.getLocalizedMessage();
}
if (!result) {
- ErrorDialog.openError(this.getShell(),
+ ErrorDialog.openError(
+ this.getShell(),
WizardMessages.getString(CREATE_INSTANCE_FAILURE_TITLE),
- WizardMessages.getFormattedString(CREATE_INSTANCE_FAILURE_MSG, new String[] {name, imageId, realmId, profileId}),
+ WizardMessages.getFormattedString(CREATE_INSTANCE_FAILURE_MSG, new String[] { name, imageId,
+ realmId, profileId }),
new Status(IStatus.ERROR, Activator.PLUGIN_ID, errorMessage));
}
return result;
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java 2010-11-19 11:11:53 UTC (rev 26752)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java 2010-11-19 12:02:22 UTC (rev 26753)
@@ -97,10 +97,14 @@
if (hostname != null && hostname.length() > 0 && isAutoconnect()) {
try {
String connectionName = RSEUtils.createConnectionName(instance);
- IHost host = RSEUtils.createHost(connectionName, RSEUtils.createHostName(instance), RSEUtils.getSSHOnlySystemType());
- RSEUtils.launchRemoteSystemExplorer(instance.getName(), connectionName, host);
+ IHost host = RSEUtils.createHost(connectionName,
+ RSEUtils.createHostName(instance),
+ RSEUtils.getSSHOnlySystemType(),
+ RSEUtils.getSystemRegistry());
+ RSEUtils.connect(connectionName, RSEUtils.getConnectorService(host));
} catch (Exception e) {
- ErrorUtils.handleError("Error", "Could not launch remote system explorer for instance \"" + instance.getName() + "\"", e, getShell());
+ ErrorUtils.handleError("Error", "Could not launch remote system explorer for instance \""
+ + instance.getName() + "\"", e, getShell());
return Status.OK_STATUS;
}
}
@@ -133,7 +137,7 @@
// Save persistent settings for this particular cloud
cloud.setLastImageId(imageId);
cloud.setLastKeyname(keyname);
-
+
Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
boolean result = false;
15 years, 5 months
JBoss Tools SVN: r26752 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers.
by jbosstools-commits@lists.jboss.org
Author: dvinnichek
Date: 2010-11-19 06:11:53 -0500 (Fri, 19 Nov 2010)
New Revision: 26752
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java
Log:
added test for 'Show bundle's messages as EL expressions' button on vpe toolbar
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java 2010-11-19 11:06:34 UTC (rev 26751)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/handlers/VpeCommandsTests.java 2010-11-19 11:11:53 UTC (rev 26752)
@@ -30,6 +30,7 @@
import org.eclipse.ui.handlers.RegistryToggleState;
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.bundle.BundleMap;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditorPart;
import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
@@ -223,7 +224,39 @@
.isShowInvisibleTags();
assertEquals(!oldToogleState, uiNonVisualTagsVisibility);
}
+
+ /**
+ * Test 'Show bundle's messages as EL expressions' toolbar button
+ *
+ * @throws Throwable
+ */
+ public void testShowBundleAsEL() throws Throwable {
+
+ JSPMultiPageEditor multiPageEditor = openInputUserNameJsp();
+ Command command = getCommandById(ShowBundleAsELHandler.COMMAND_ID);
+ State state = command.getState(RegistryToggleState.STATE_ID);
+ boolean oldToogleState = ((Boolean) state.getValue()).booleanValue();
+
+ handlerService.executeCommand(ShowBundleAsELHandler.COMMAND_ID, null);
+ TestUtil.delay(500);
+
+ boolean newToogleState = ((Boolean) state.getValue()).booleanValue();
+ assertEquals(!oldToogleState, newToogleState);
+
+ IPreferenceStore prefStore = JspEditorPlugin.getDefault()
+ .getPreferenceStore();
+ boolean prefBundleAsELVisibility = prefStore
+ .getBoolean(IVpePreferencesPage.SHOW_RESOURCE_BUNDLES_USAGE_AS_EL);
+ assertEquals(!oldToogleState, prefBundleAsELVisibility);
+
+ VpeController vpeController = (VpeController) multiPageEditor
+ .getVisualEditor().getController();
+ BundleMap bundle = vpeController.getPageContext().getBundle();
+ boolean uiBundleAsELVisibility = bundle.isShowBundleUsageAsEL();
+ assertEquals(!oldToogleState, uiBundleAsELVisibility);
+ }
+
private JSPMultiPageEditor openInputUserNameJsp() throws CoreException,
IOException, SecurityException, IllegalArgumentException,
NoSuchMethodException, IllegalAccessException,
15 years, 5 months
JBoss Tools SVN: r26751 - 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-11-19 06:06:34 -0500 (Fri, 19 Nov 2010)
New Revision: 26751
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java
Log:
[JBIDE-7642] cleanup, extracted method
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java 2010-11-19 11:06:06 UTC (rev 26750)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java 2010-11-19 11:06:34 UTC (rev 26751)
@@ -94,8 +94,7 @@
cloud.replaceInstance(instance);
cloud.removeInstanceJob(instanceId, this);
String hostname = RSEUtils.createHostName(instance);
- boolean autoConnect = isAutoconnect();
- if (hostname != null && hostname.length() > 0 && autoConnect) {
+ if (hostname != null && hostname.length() > 0 && isAutoconnect()) {
try {
String connectionName = RSEUtils.createConnectionName(instance);
IHost host = RSEUtils.createHost(connectionName, RSEUtils.createHostName(instance), RSEUtils.getSSHOnlySystemType());
15 years, 5 months
JBoss Tools SVN: r26750 - 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-11-19 06:06:06 -0500 (Fri, 19 Nov 2010)
New Revision: 26750
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java
Log:
[JBIDE-7642] cleanup, extracted method
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java 2010-11-19 11:01:16 UTC (rev 26749)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard2.java 2010-11-19 11:06:06 UTC (rev 26750)
@@ -94,12 +94,11 @@
cloud.replaceInstance(instance);
cloud.removeInstanceJob(instanceId, this);
String hostname = RSEUtils.createHostName(instance);
- Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
- boolean autoConnect = prefs.getBoolean(IDeltaCloudPreferenceConstants.AUTO_CONNECT_INSTANCE, true);
+ boolean autoConnect = isAutoconnect();
if (hostname != null && hostname.length() > 0 && autoConnect) {
try {
String connectionName = RSEUtils.createConnectionName(instance);
- IHost host = RSEUtils.createHost(connectionName, RSEUtils.createHostName(instance));
+ IHost host = RSEUtils.createHost(connectionName, RSEUtils.createHostName(instance), RSEUtils.getSSHOnlySystemType());
RSEUtils.launchRemoteSystemExplorer(instance.getName(), connectionName, host);
} catch (Exception e) {
ErrorUtils.handleError("Error", "Could not launch remote system explorer for instance \"" + instance.getName() + "\"", e, getShell());
@@ -113,6 +112,12 @@
pm.done();
return Status.CANCEL_STATUS;
}
+ }
+
+ private boolean isAutoconnect() {
+ Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
+ boolean autoConnect = prefs.getBoolean(IDeltaCloudPreferenceConstants.AUTO_CONNECT_INSTANCE, true);
+ return autoConnect;
};
};
15 years, 5 months
JBoss Tools SVN: r26749 - in trunk/common/plugins/org.jboss.tools.common.ui.sidebyside: bin and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-11-19 06:01:16 -0500 (Fri, 19 Nov 2010)
New Revision: 26749
Removed:
trunk/common/plugins/org.jboss.tools.common.ui.sidebyside/bin/org/
Modified:
trunk/common/plugins/org.jboss.tools.common.ui.sidebyside/.project
Log:
Fixed the project name.
Modified: trunk/common/plugins/org.jboss.tools.common.ui.sidebyside/.project
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui.sidebyside/.project 2010-11-19 10:56:03 UTC (rev 26748)
+++ trunk/common/plugins/org.jboss.tools.common.ui.sidebyside/.project 2010-11-19 11:01:16 UTC (rev 26749)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.jboss.tools.neweditor.sidebyside</name>
+ <name>org.jboss.tools.common.ui.sidebyside</name>
<comment></comment>
<projects>
</projects>
15 years, 5 months