JBoss Tools SVN: r21285 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-04-06 07:13:35 -0400 (Tue, 06 Apr 2010)
New Revision: 21285
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6146
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2010-04-06 10:44:52 UTC (rev 21284)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2010-04-06 11:13:35 UTC (rev 21285)
@@ -360,7 +360,7 @@
//2. Declaration of inheritable scope in a superclass.
ClassBean scb = getSuperClassBean();
while(scb != null) {
- scopes = getScopeDeclarations();
+ scopes = scb.getScopeDeclarations();
if(!scopes.isEmpty()) {
scope = scopes.iterator().next().getScope();
if(scope.getInheritedDeclaration() == null) {
@@ -383,7 +383,7 @@
}
scb = getSuperClassBean();
while(scb != null) {
- ss = getStereotypeDeclarations();
+ ss = scb.getStereotypeDeclarations();
for (IStereotypeDeclaration d: ss) {
IStereotype s = d.getStereotype();
if(s.getInheritedDeclaration() == null) {
14 years, 9 months
JBoss Tools SVN: r21284 - in trunk: struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-04-06 06:44:52 -0400 (Tue, 06 Apr 2010)
New Revision: 21284
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RunStrutsProjectOnServer.java
Log:
Added uiTimeOut parameter when calling chooseServerPopupMenu() method
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java 2010-04-06 09:37:38 UTC (rev 21283)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java 2010-04-06 10:44:52 UTC (rev 21284)
@@ -34,7 +34,9 @@
*
*/
public class SWTJBTExt {
-
+
+ private static final long DEFAULT_UI_TIMEOUT = 1000L;
+
SWTWorkbenchBot bot;
Logger log = Logger.getLogger(SWTJBTExt.class);
@@ -93,29 +95,59 @@
* Starts Application Server in Server View on position specified by index
* Dynamic version of startApplicationServer
* @param index - zero based Position of Server within Server Tree
+ * @param uiTimeOut
*/
+ public void startApplicationServer(int index, long uiTimeOut){
+ SWTJBTExt.startApplicationServer(bot, index, uiTimeOut);
+ }
+ /**
+ * Starts Application Server in Server View on position specified by index
+ * @param bot
+ * @param index - zero based Position of Server within Server Tree
+ * @param uiTimeOut
+ */
+ public static void startApplicationServer(SWTWorkbenchBot bot , int index, long uiTimeOut){
+ SWTJBTExt.chooseServerPopupMenu(bot,index, IDELabel.Menu.START,120*1000L,uiTimeOut);
+ bot.sleep(10*1000L);
+ }
+ /**
+ * Starts Application Server in Server View on position specified by index
+ * Dynamic version of startApplicationServer with default UI TimeOut
+ * @param index - zero based Position of Server within Server Tree
+ */
public void startApplicationServer(int index){
- SWTJBTExt.startApplicationServer(bot, index);
+ SWTJBTExt.startApplicationServer(bot, index, SWTJBTExt.DEFAULT_UI_TIMEOUT);
}
/**
* Starts Application Server in Server View on position specified by index
+ * with default UI TimeOut
* @param bot
* @param index - zero based Position of Server within Server Tree
*/
public static void startApplicationServer(SWTWorkbenchBot bot , int index){
- SWTJBTExt.chooseServerPopupMenu(bot,index, IDELabel.Menu.START,120*1000L);
- bot.sleep(10*1000L);
+ startApplicationServer(bot , index, SWTJBTExt.DEFAULT_UI_TIMEOUT);
}
/**
* Stops Application Server in Server View on position specified by index
+ * with default UI TimeOut
* Dynamic version of stopApplicationServer
* @param index - zero based Position of Server within Server Tree
*/
public void stopApplicationServer(int index){
+ SWTJBTExt.stopApplicationServer(bot, index, SWTJBTExt.DEFAULT_UI_TIMEOUT);
+ }
+ /**
+ * Stops Application Server in Server View on position specified by index
+ * Dynamic version of stopApplicationServer
+ * @param index - zero based Position of Server within Server Tree
+ * @param uiTimeOut
+ */
+ public void stopApplicationServer(int index,long uiTimeOut){
SWTJBTExt.stopApplicationServer(bot, index);
}
/**
* Stops Application Server in Server View on position specified by index
+ * with default UI TimeOut
* @param bot
* @param index - zero based Position of Server within Server Tree
*/
@@ -123,25 +155,46 @@
SWTJBTExt.chooseServerPopupMenu(bot,index, IDELabel.Menu.STOP,20*1000L);
}
/**
+ * Stops Application Server in Server View on position specified by index
+ * @param bot
+ * @param index - zero based Position of Server within Server Tree
+ * @param iuTimeOut
+ */
+ public static void stopApplicationServer(SWTWorkbenchBot bot , int index,long uiTimeOut){
+ SWTJBTExt.chooseServerPopupMenu(bot,index, IDELabel.Menu.STOP,20*1000L,uiTimeOut);
+ }
+ /**
* Choose Server Popup Menu with specified label on Server with position specified by index
* @param bot
* @param index
* @param menuLabel
* @param timeOut
+ * @param uiTimeOut
*/
- public static void chooseServerPopupMenu(SWTWorkbenchBot bot , int index, String menuLabel, long timeOut){
+ public static void chooseServerPopupMenu(SWTWorkbenchBot bot , int index, String menuLabel, long timeOut, long uiTimeOut){
SWTEclipseExt swtEclipseExt = new SWTEclipseExt();
SWTBot servers = swtEclipseExt.showView(ViewType.SERVERS);
SWTBotTree serverTree = servers.tree();
ContextMenuHelper.prepareTreeItemForContextMenu(serverTree, index);
- SWTTestExt.util.waitForAll(timeOut);
+ SWTTestExt.util.waitForAll(uiTimeOut);
SWTBotMenu menu = new SWTBotMenu(ContextMenuHelper.getContextMenu(serverTree,
menuLabel, false));
- SWTTestExt.util.waitForAll(timeOut);
+ SWTTestExt.util.waitForAll(uiTimeOut);
menu.click();
SWTTestExt.util.waitForAll(timeOut);
}
/**
+ * Choose Server Popup Menu with specified label on Server with position specified by index
+ * with defaul UI TimeOut
+ * @param bot
+ * @param index
+ * @param menuLabel
+ * @param timeOut
+ */
+ public static void chooseServerPopupMenu(SWTWorkbenchBot bot , int index, String menuLabel, long timeOut){
+ chooseServerPopupMenu(bot,index,menuLabel,timeOut,SWTJBTExt.DEFAULT_UI_TIMEOUT);
+ }
+ /**
* Deletes Application Server in Server View on position specified by index
* Dynamic version of deleteApplicationServer
* @param index - zero based Position of Server within Server Tree
Modified: trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RunStrutsProjectOnServer.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RunStrutsProjectOnServer.java 2010-04-06 09:37:38 UTC (rev 21283)
+++ trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/RunStrutsProjectOnServer.java 2010-04-06 10:44:52 UTC (rev 21284)
@@ -33,11 +33,11 @@
@Test
public void testRunStrutsProjectOnServer() {
// Start Application Server
- swtJbtExt.startApplicationServer(0);
+ swtJbtExt.startApplicationServer(0,150*1000L);
swtJbtExt.runProjectOnServer(StrutsAllBotTests.STRUTS_PROJECT_NAME);
// Check Browser Content
String browserText = WidgetFinderHelper.browserInEditorText(bot, "KickStart: Input name",true);
- swtJbtExt.stopApplicationServer( 0);
+ swtJbtExt.stopApplicationServer(0);
swtJbtExt.removeProjectFromServers(StrutsAllBotTests.STRUTS_PROJECT_NAME);
SWTJBTExt.deleteApplicationServer(bot, 0);
assertTrue("Displayed HTML page has wrong content",
14 years, 9 months
JBoss Tools SVN: r21283 - in trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal: wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-04-06 05:37:38 -0400 (Tue, 06 Apr 2010)
New Revision: 21283
Added:
trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/actions/EditConnectionAction.java
trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/EditConnectionWizard.java
Log:
JBIDE-4927 to trunk
Added: trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/actions/EditConnectionAction.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/actions/EditConnectionAction.java (rev 0)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/actions/EditConnectionAction.java 2010-04-06 09:37:38 UTC (rev 21283)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * 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.jmx.ui.internal.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.jmx.core.IConnectionWrapper;
+import org.jboss.tools.jmx.ui.Messages;
+import org.jboss.tools.jmx.ui.internal.wizards.EditConnectionWizard;
+
+public class EditConnectionAction extends Action {
+ private IConnectionWrapper connection;
+ public EditConnectionAction(IConnectionWrapper connection) {
+ this.connection = connection;
+ //setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(key));
+ setEnabled(true);
+ setText(Messages.EditConnectionAction);
+ }
+ public void run() {
+ EditConnectionWizard wizard = new EditConnectionWizard(connection);
+ WizardDialog d = new WizardDialog(new Shell(), wizard);
+ d.open();
+ }
+}
Added: trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/EditConnectionWizard.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/EditConnectionWizard.java (rev 0)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/EditConnectionWizard.java 2010-04-06 09:37:38 UTC (rev 21283)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * 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.jmx.ui.internal.wizards;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.wizard.Wizard;
+import org.jboss.tools.jmx.core.IConnectionWrapper;
+import org.jboss.tools.jmx.ui.ConnectionWizardPage;
+import org.jboss.tools.jmx.ui.IEditableConnectionWizardPage;
+import org.jboss.tools.jmx.ui.UIExtensionManager;
+import org.jboss.tools.jmx.ui.UIExtensionManager.ConnectionProviderUI;
+
+public class EditConnectionWizard extends Wizard {
+ private IConnectionWrapper connection;
+ public EditConnectionWizard(IConnectionWrapper connection) {
+ super();
+ this.connection = connection;
+ }
+ public String getWindowTitle() {
+ return "TEST TITLE"; //$NON-NLS-1$
+ }
+
+ public void addPages() {
+ ConnectionProviderUI ui = UIExtensionManager.getConnectionProviderUI(connection.getProvider().getId());
+ ConnectionWizardPage[] pages = ui.createPages();
+ for( int j = 0; j < pages.length; j++ )
+ if( pages[j] instanceof IEditableConnectionWizardPage) {
+ ((IEditableConnectionWizardPage)pages[j]).setInitialConnection(connection);
+ addPage(pages[j]);
+ }
+ }
+
+ @Override
+ public boolean performFinish() {
+ try {
+ IConnectionWrapper xinda = ((ConnectionWizardPage)getPages()[0]).getConnection();
+ if( xinda == connection)
+ connection.getProvider().connectionChanged(connection);
+ else {
+ connection.getProvider().removeConnection(connection);
+ connection.getProvider().addConnection(xinda);
+ }
+ return true;
+ } catch( CoreException ce) {
+ }
+ return false;
+ }
+
+}
14 years, 9 months
JBoss Tools SVN: r21282 - in trunk: as/plugins/org.jboss.ide.eclipse.as.wtp.ui/src/org/jboss/ide/eclipse/as/wtp/ui/propertypage and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-04-06 05:36:30 -0400 (Tue, 06 Apr 2010)
New Revision: 21282
Added:
trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/IEditableConnectionWizardPage.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/src/org/jboss/ide/eclipse/as/wtp/ui/propertypage/NewReferenceWizard.java
trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProvider.java
trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.java
trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.properties
trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java
trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java
trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/MBeanServerConnectionDescriptor.java
trunk/jmx/plugins/org.jboss.tools.jmx.ui/plugin.xml
trunk/jmx/plugins/org.jboss.tools.jmx.ui/schema/providerUI.exsd
trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.java
trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.properties
trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/UIExtensionManager.java
trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/views/navigator/ActionProvider.java
trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/DefaultConnectionWizardPage.java
trunk/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/test/DefaultProviderTest.java
Log:
JBIDE-4927 to trunk
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java 2010-04-06 09:36:30 UTC (rev 21282)
@@ -192,4 +192,7 @@
public boolean canDelete(IConnectionWrapper wrapper) {
return false;
}
+ public void connectionChanged(IConnectionWrapper connection) {
+ // do nothing
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/src/org/jboss/ide/eclipse/as/wtp/ui/propertypage/NewReferenceWizard.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/src/org/jboss/ide/eclipse/as/wtp/ui/propertypage/NewReferenceWizard.java 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/src/org/jboss/ide/eclipse/as/wtp/ui/propertypage/NewReferenceWizard.java 2010-04-06 09:36:30 UTC (rev 21282)
@@ -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.ide.eclipse.as.wtp.ui.propertypage;
import java.util.List;
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProvider.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProvider.java 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProvider.java 2010-04-06 09:36:30 UTC (rev 21282)
@@ -69,6 +69,8 @@
*/
public void addConnection(IConnectionWrapper connection);
public void removeConnection(IConnectionWrapper connection);
+ public void connectionChanged(IConnectionWrapper connection);
+
public void addListener(IConnectionProviderListener listener);
public void removeListener(IConnectionProviderListener listener);
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.java 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.java 2010-04-06 09:36:30 UTC (rev 21282)
@@ -18,6 +18,7 @@
public static String ExtensionManagerError1;
public static String DefaultConnection_ErrorAdding;
public static String DefaultConnection_ErrorRemoving;
+ public static String DefaultConnection_ErrorChanging;
public static String DefaultConnection_ErrorLoading;
public static String DefaultConnection_ErrorRunningJMXCode;
public static String ProblemWritingToFile;
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.properties
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.properties 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.properties 2010-04-06 09:36:30 UTC (rev 21282)
@@ -7,6 +7,7 @@
DefaultConnection_ErrorLoading=Error loading connection
DefaultConnection_ErrorAdding=Error adding connection.
DefaultConnection_ErrorRemoving=Error removing connection.
+DefaultConnection_ErrorChanging=Error changing connection.
DefaultConnection_ErrorRunningJMXCode=Error executing JMX request.
ProblemWritingToFile=Problem writing to file {0}
LoadMBeans=Load MBeans
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java 2010-04-06 09:36:30 UTC (rev 21282)
@@ -91,6 +91,10 @@
public boolean canDelete(IConnectionWrapper wrapper) {
return wrapper instanceof DefaultConnectionWrapper;
}
+
+ public boolean canEdit(IConnectionWrapper wrapper) {
+ return wrapper instanceof DefaultConnectionWrapper;
+ }
public DefaultConnectionWrapper createConnection(Map map) throws CoreException {
String id = (String)map.get(ID);
@@ -151,6 +155,17 @@
}
}
}
+ public void connectionChanged(IConnectionWrapper connection) {
+ if( connection instanceof DefaultConnectionWrapper ) {
+ try {
+ save();
+ fireChanged(connection);
+ } catch( IOException ioe ) {
+ IStatus s = new Status(IStatus.ERROR, JMXActivator.PLUGIN_ID, JMXCoreMessages.DefaultConnection_ErrorChanging, ioe);
+ JMXActivator.log(s);
+ }
+ }
+ }
protected void loadConnections() {
String filename = JMXActivator.getDefault().getStateLocation().append(STORE_FILE).toOSString();
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java 2010-04-06 09:36:30 UTC (rev 21282)
@@ -35,7 +35,6 @@
import org.jboss.tools.jmx.core.tree.Root;
public class DefaultConnectionWrapper implements IConnectionWrapper {
- private JMXServiceURL url;
private JMXConnector connector;
private MBeanServerConnection connection;
private Root root;
@@ -55,8 +54,6 @@
String[] credentials = new String[] { username, descriptor.getPassword() };
environment.put(JMXConnector.CREDENTIALS, credentials);
}
-
- url = new JMXServiceURL(descriptor.getURL());
}
public MBeanServerConnectionDescriptor getDescriptor() {
@@ -77,7 +74,7 @@
public synchronized void connect() throws IOException {
// try to connect
- connector = JMXConnectorFactory.connect(url, environment);
+ connector = JMXConnectorFactory.connect(new JMXServiceURL(descriptor.getURL()), environment);
connection = connector.getMBeanServerConnection();
isConnected = true;
((DefaultConnectionProvider)getProvider()).fireChanged(this);
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/MBeanServerConnectionDescriptor.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/MBeanServerConnectionDescriptor.java 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/MBeanServerConnectionDescriptor.java 2010-04-06 09:36:30 UTC (rev 21282)
@@ -17,10 +17,10 @@
private static final long serialVersionUID = -8358701879017195518L;
- private final String id;
- private final String url;
- private final String userName;
- private final String password;
+ private String id;
+ private String url;
+ private String userName;
+ private String password;
public MBeanServerConnectionDescriptor(
String id, String url,
@@ -31,6 +31,22 @@
this.password = password;
}
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
public String getID() {
return id;
}
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.ui/plugin.xml
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.ui/plugin.xml 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.ui/plugin.xml 2010-04-06 09:36:30 UTC (rev 21282)
@@ -253,6 +253,7 @@
<extension
point="org.jboss.tools.jmx.ui.providerUI">
<providerUI
+ editable="true"
icon="icons/full/obj16/write_obj.gif"
id="org.jboss.tools.jmx.core.providers.DefaultConnectionProvider"
name="%DefaultJMXConnectionProvider.name">
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.ui/schema/providerUI.exsd
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.ui/schema/providerUI.exsd 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.ui/schema/providerUI.exsd 2010-04-06 09:36:30 UTC (rev 21282)
@@ -2,9 +2,9 @@
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jboss.tools.jmx.ui" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
- <appinfo>
+ <appInfo>
<meta.schema plugin="org.jboss.tools.jmx.ui" id="org.jboss.tools.jmx.ui.wizards.connectionPage" name="Connection Wizard Page"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter description of this extension point.]
</documentation>
@@ -12,9 +12,9 @@
<element name="extension">
<annotation>
- <appinfo>
+ <appInfo>
<meta.element />
- </appinfo>
+ </appInfo>
</annotation>
<complexType>
<sequence minOccurs="1" maxOccurs="unbounded">
@@ -39,9 +39,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute translatable="true"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
</complexType>
@@ -71,11 +71,18 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="resource"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
+ <attribute name="editable" type="boolean">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
</complexType>
</element>
@@ -86,45 +93,45 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="java" basedOn=":org.jboss.tools.jmx.ui.IWizardPageWithFinish"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="since"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="examples"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="apiinfo"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="implementation"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
Added: trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/IEditableConnectionWizardPage.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/IEditableConnectionWizardPage.java (rev 0)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/IEditableConnectionWizardPage.java 2010-04-06 09:36:30 UTC (rev 21282)
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * 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.jmx.ui;
+
+import org.jboss.tools.jmx.core.IConnectionWrapper;
+
+public interface IEditableConnectionWizardPage extends ConnectionWizardPage {
+ public void setInitialConnection(IConnectionWrapper wrapper);
+}
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.java 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.java 2010-04-06 09:36:30 UTC (rev 21282)
@@ -11,6 +11,7 @@
public class Messages extends NLS {
public static String NewConnectionAction;
+ public static String EditConnectionAction;
public static String NewConnectionWizard;
public static String NewConnectionWizard_CreateNewConnection;
public static String DefaultConnectionWizardPage_Title;
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.properties
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.properties 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.properties 2010-04-06 09:36:30 UTC (rev 21282)
@@ -1,4 +1,5 @@
NewConnectionAction=New Connection...
+EditConnectionAction=Edit Connection...
NewConnectionWizard=New Connection Wizard
NewConnectionWizard_CreateNewConnection=Create a new JMX Connection
DefaultConnectionWizardPage_Title=Create JMX Connection
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/UIExtensionManager.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/UIExtensionManager.java 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/UIExtensionManager.java 2010-04-06 09:36:30 UTC (rev 21282)
@@ -34,14 +34,17 @@
private static final String NAME = "name"; //$NON-NLS-1$
private static final String ICON = "icon"; //$NON-NLS-1$
private static final String CLASS = "class"; //$NON-NLS-1$
+ private static final String EDITABLE = "editable"; //$NON-NLS-1$
public static class ConnectionProviderUI {
String id, name, icon;
+ boolean editable;
IConfigurationElement[] wizardPages;
ImageDescriptor imageDescriptor;
public ConnectionProviderUI(IConfigurationElement element) {
id = element.getAttribute(ID);
name = element.getAttribute(NAME);
icon = element.getAttribute(ICON);
+ editable = Boolean.parseBoolean(element.getAttribute(EDITABLE));
wizardPages = element.getChildren();
String pluginName = element.getDeclaringExtension().getContributor().getName();
imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(pluginName, icon);
@@ -55,6 +58,10 @@
public String getIcon() {
return icon;
}
+ public boolean isEditable() {
+ return editable;
+ }
+
public ImageDescriptor getImageDescriptor() {
return imageDescriptor;
}
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/views/navigator/ActionProvider.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/views/navigator/ActionProvider.java 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/views/navigator/ActionProvider.java 2010-04-06 09:36:30 UTC (rev 21282)
@@ -13,7 +13,6 @@
import java.util.ArrayList;
import java.util.Iterator;
-
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.ISelection;
@@ -23,8 +22,11 @@
import org.eclipse.ui.navigator.ICommonActionConstants;
import org.eclipse.ui.navigator.ICommonActionExtensionSite;
import org.jboss.tools.jmx.core.IConnectionWrapper;
+import org.jboss.tools.jmx.ui.UIExtensionManager;
+import org.jboss.tools.jmx.ui.UIExtensionManager.ConnectionProviderUI;
import org.jboss.tools.jmx.ui.internal.actions.DeleteConnectionAction;
import org.jboss.tools.jmx.ui.internal.actions.DoubleClickAction;
+import org.jboss.tools.jmx.ui.internal.actions.EditConnectionAction;
import org.jboss.tools.jmx.ui.internal.actions.MBeanServerConnectAction;
import org.jboss.tools.jmx.ui.internal.actions.MBeanServerDisconnectAction;
import org.jboss.tools.jmx.ui.internal.actions.NewConnectionAction;
@@ -60,7 +62,12 @@
menu.add(new MBeanServerConnectAction(connections));
else if( allControlable(connections))
menu.add(new MBeanServerDisconnectAction(connections));
-
+ if( connections.length == 1 ) {
+ String id = connections[0].getProvider().getId();
+ ConnectionProviderUI ui = UIExtensionManager.getConnectionProviderUI(id);
+ if( ui != null && ui.isEditable() && !connections[0].isConnected())
+ menu.add(new EditConnectionAction(connections[0]));
+ }
menu.add(new DeleteConnectionAction(connections));
}
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/DefaultConnectionWizardPage.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/DefaultConnectionWizardPage.java 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/DefaultConnectionWizardPage.java 2010-04-06 09:36:30 UTC (rev 21282)
@@ -14,7 +14,6 @@
import java.net.UnknownHostException;
import java.util.HashMap;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
@@ -35,22 +34,29 @@
import org.jboss.tools.jmx.core.IConnectionProvider;
import org.jboss.tools.jmx.core.IConnectionWrapper;
import org.jboss.tools.jmx.core.providers.DefaultConnectionProvider;
-import org.jboss.tools.jmx.ui.ConnectionWizardPage;
+import org.jboss.tools.jmx.core.providers.DefaultConnectionWrapper;
+import org.jboss.tools.jmx.ui.IEditableConnectionWizardPage;
import org.jboss.tools.jmx.ui.Messages;
/**
* The connection page for the default wizard implementation.
*/
public class DefaultConnectionWizardPage extends WizardPage implements
- ConnectionWizardPage {
+ IEditableConnectionWizardPage {
private static final String _BLANK_ = ""; //$NON-NLS-1$
+ private static final String SIMPLE_PREFIX = "service:jmx:rmi:///jndi/rmi://"; //$NON-NLS-1$
+ private static final String SIMPLE_SUFFIX = "/jmxrmi"; //$NON-NLS-1$
private TabFolder folder;
private TabItem simpleItem, advancedItem;
private Text hostText, portText, urlText;
private Text nameText, userNameText, passwordText;
private Text advancedNameText, advancedUserNameText, advancedPasswordText;
private String name, url, userName, password;
-
+ private DefaultConnectionWrapper initialConnection;
+ public void setInitialConnection(IConnectionWrapper wrapper) {
+ this.initialConnection = (DefaultConnectionWrapper)wrapper;
+ }
+
private void addListeners() {
ModifyListener listener = new ModifyListener() {
public void modifyText(ModifyEvent e) {
@@ -120,7 +126,6 @@
nameLabel.setText(Messages.DefaultConnectionWizardPage_Name);
nameText = new Text(fieldComposite, SWT.BORDER);
- nameText.setText(getNextName());
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
nameText.setLayoutData(data);
@@ -131,7 +136,6 @@
// 2 host text entry
hostText = new Text(fieldComposite, SWT.BORDER);
- hostText.setText("localhost"); //$NON-NLS-1$
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
hostText.setLayoutData(data);
@@ -143,7 +147,6 @@
// 4 port text entry
portText = new Text(fieldComposite, SWT.BORDER);
portText.setTextLimit(5);
- portText.setText("3000"); //$NON-NLS-1$
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
portText.setLayoutData(data);
@@ -154,7 +157,6 @@
// 6 user name text entry
userNameText = new Text(fieldComposite, SWT.BORDER);
- userNameText.setText(_BLANK_);
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
@@ -166,13 +168,30 @@
// 8 user name text entry
passwordText = new Text(fieldComposite, SWT.BORDER | SWT.PASSWORD);
- passwordText.setText(_BLANK_);
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
passwordText.setLayoutData(data);
+
+ if( initialConnection == null ) {
+ nameText.setText(getNextName());
+ hostText.setText("localhost"); //$NON-NLS-1$
+ portText.setText("3000"); //$NON-NLS-1$
+ userNameText.setText(_BLANK_);
+ passwordText.setText(_BLANK_);
+ } else {
+ nameText.setText(initialConnection.getDescriptor().getID());
+ userNameText.setText(initialConnection.getDescriptor().getUserName());
+ passwordText.setText(initialConnection.getDescriptor().getPassword());
+ String url = initialConnection.getDescriptor().getURL();
+ if( url.startsWith(SIMPLE_PREFIX)) {
+ String host = url.substring(SIMPLE_PREFIX.length(), url.indexOf(":", SIMPLE_PREFIX.length())); //$NON-NLS-1$
+ String port = url.substring(url.indexOf(":", SIMPLE_PREFIX.length())+1, url.indexOf("/", SIMPLE_PREFIX.length()));//$NON-NLS-1$//$NON-NLS-2$
+ hostText.setText(host);
+ portText.setText(port);
+ }
+ }
return fieldComposite;
-
}
private Control createAdvancedConnectionPage(Composite parent) {
@@ -197,7 +216,6 @@
// 2 URL text entry
urlText = new Text(fieldComposite, SWT.BORDER);
- urlText.setText("service:jmx:rmi:"); //$NON-NLS-1$
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
urlText.setLayoutData(data);
@@ -208,7 +226,6 @@
// 4 user name text entry
advancedUserNameText = new Text(fieldComposite, SWT.BORDER);
- advancedUserNameText.setText(_BLANK_);
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
advancedUserNameText.setLayoutData(data);
@@ -220,11 +237,19 @@
// 6 user name text entry
advancedPasswordText = new Text(fieldComposite, SWT.BORDER
| SWT.PASSWORD);
- advancedPasswordText.setText(_BLANK_);
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
advancedPasswordText.setLayoutData(data);
+ if( initialConnection == null ) {
+ urlText.setText("service:jmx:rmi:"); //$NON-NLS-1$
+ advancedUserNameText.setText(_BLANK_);
+ advancedPasswordText.setText(_BLANK_);
+ } else {
+ urlText.setText(initialConnection.getDescriptor().getURL());
+ userNameText.setText(initialConnection.getDescriptor().getUserName());
+ passwordText.setText(initialConnection.getDescriptor().getPassword());
+ }
return fieldComposite;
}
@@ -241,7 +266,6 @@
}
protected void validate() {
- // TODO Validation
if (folder.getSelectionIndex() == 0) {
name = nameText.getText();
userName = userNameText.getText();
@@ -267,7 +291,7 @@
showError(Messages.DefaultConnectionWizardPage_Blank_Invalid);
return;
}
- url = "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/jmxrmi"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ url = SIMPLE_PREFIX + host + ":" + port + SIMPLE_SUFFIX; //$NON-NLS-1$
} else if (folder.getSelectionIndex() == 1) {
name = advancedNameText.getText();
userName = advancedUserNameText.getText();
@@ -315,35 +339,32 @@
protected boolean nameTaken(String s) {
IConnectionProvider provider = ExtensionManager.getProvider(DefaultConnectionProvider.PROVIDER_ID);
- IConnectionWrapper[] connections = provider.getConnections();
- for( int i = 0; i < connections.length; i++ ) {
- if( provider.getName(connections[i]).equals(s)) {
- return true;
+ if( initialConnection == null || !s.equals(provider.getName(initialConnection))) {
+ IConnectionWrapper[] connections = provider.getConnections();
+ for( int i = 0; i < connections.length; i++ ) {
+ if( provider.getName(connections[i]).equals(s)) {
+ return true;
+ }
}
}
return false;
}
- String getURL() {
- return url;
- }
-
- String getUserName() {
- return userName;
- }
-
- String getPassword() {
- return password;
- }
-
public IConnectionWrapper getConnection() throws CoreException {
- HashMap<String,String> map = new HashMap<String,String>();
- map.put(DefaultConnectionProvider.ID, name);
- map.put(DefaultConnectionProvider.URL, url);
- map.put(DefaultConnectionProvider.USERNAME, userName);
- map.put(DefaultConnectionProvider.PASSWORD, password);
- IConnectionProvider provider = ExtensionManager.getProvider(DefaultConnectionProvider.PROVIDER_ID);
-
- return provider.createConnection(map);
+ if( initialConnection == null ) {
+ HashMap<String,String> map = new HashMap<String,String>();
+ map.put(DefaultConnectionProvider.ID, name);
+ map.put(DefaultConnectionProvider.URL, url);
+ map.put(DefaultConnectionProvider.USERNAME, userName);
+ map.put(DefaultConnectionProvider.PASSWORD, password);
+ IConnectionProvider provider = ExtensionManager.getProvider(DefaultConnectionProvider.PROVIDER_ID);
+
+ return provider.createConnection(map);
+ }
+ initialConnection.getDescriptor().setId(name);
+ initialConnection.getDescriptor().setUrl(url);
+ initialConnection.getDescriptor().setUserName(userName);
+ initialConnection.getDescriptor().setPassword(password);
+ return initialConnection;
}
}
Modified: trunk/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/test/DefaultProviderTest.java
===================================================================
--- trunk/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/test/DefaultProviderTest.java 2010-04-06 09:27:27 UTC (rev 21281)
+++ trunk/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/test/DefaultProviderTest.java 2010-04-06 09:36:30 UTC (rev 21282)
@@ -109,8 +109,7 @@
ExtensionManager.getProvider(DefaultConnectionProvider.PROVIDER_ID);
HashMap map = new HashMap();
map.put(DefaultConnectionProvider.ID, "Test Connection");
- map.put(DefaultConnectionProvider.URL, "service:jmx:rmi:///jndi/rmi://localhost:9999" +
- "/jmxrmi");
+ map.put(DefaultConnectionProvider.URL, "service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi");
map.put(DefaultConnectionProvider.USERNAME, "");
map.put(DefaultConnectionProvider.PASSWORD, "");
IConnectionWrapper wrapper = defProvider.createConnection(map);
14 years, 9 months
JBoss Tools SVN: r21281 - in branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui: schema and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-04-06 05:27:27 -0400 (Tue, 06 Apr 2010)
New Revision: 21281
Modified:
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/plugin.xml
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/schema/providerUI.exsd
Log:
JBIDE-4927 weird commit errors
Modified: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/plugin.xml
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/plugin.xml 2010-04-06 09:26:35 UTC (rev 21280)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/plugin.xml 2010-04-06 09:27:27 UTC (rev 21281)
@@ -253,6 +253,7 @@
<extension
point="org.jboss.tools.jmx.ui.providerUI">
<providerUI
+ editable="true"
icon="icons/full/obj16/write_obj.gif"
id="org.jboss.tools.jmx.core.providers.DefaultConnectionProvider"
name="%DefaultJMXConnectionProvider.name">
Modified: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/schema/providerUI.exsd
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/schema/providerUI.exsd 2010-04-06 09:26:35 UTC (rev 21280)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/schema/providerUI.exsd 2010-04-06 09:27:27 UTC (rev 21281)
@@ -2,9 +2,9 @@
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jboss.tools.jmx.ui" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
- <appinfo>
+ <appInfo>
<meta.schema plugin="org.jboss.tools.jmx.ui" id="org.jboss.tools.jmx.ui.wizards.connectionPage" name="Connection Wizard Page"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter description of this extension point.]
</documentation>
@@ -12,9 +12,9 @@
<element name="extension">
<annotation>
- <appinfo>
+ <appInfo>
<meta.element />
- </appinfo>
+ </appInfo>
</annotation>
<complexType>
<sequence minOccurs="1" maxOccurs="unbounded">
@@ -39,9 +39,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute translatable="true"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
</complexType>
@@ -71,11 +71,18 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="resource"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
+ <attribute name="editable" type="boolean">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
</complexType>
</element>
@@ -86,45 +93,45 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="java" basedOn=":org.jboss.tools.jmx.ui.IWizardPageWithFinish"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="since"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="examples"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="apiinfo"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="implementation"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
14 years, 9 months
JBoss Tools SVN: r21280 - in branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui: internal/actions and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-04-06 05:26:35 -0400 (Tue, 06 Apr 2010)
New Revision: 21280
Added:
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/IEditableConnectionWizardPage.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/actions/EditConnectionAction.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/EditConnectionWizard.java
Modified:
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.properties
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/UIExtensionManager.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/views/navigator/ActionProvider.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/DefaultConnectionWizardPage.java
Log:
JBIDE-4927 weird commit errors
Added: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/IEditableConnectionWizardPage.java
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/IEditableConnectionWizardPage.java (rev 0)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/IEditableConnectionWizardPage.java 2010-04-06 09:26:35 UTC (rev 21280)
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * 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.jmx.ui;
+
+import org.jboss.tools.jmx.core.IConnectionWrapper;
+
+public interface IEditableConnectionWizardPage extends ConnectionWizardPage {
+ public void setInitialConnection(IConnectionWrapper wrapper);
+}
Modified: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.java
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.java 2010-04-06 09:24:46 UTC (rev 21279)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.java 2010-04-06 09:26:35 UTC (rev 21280)
@@ -11,6 +11,7 @@
public class Messages extends NLS {
public static String NewConnectionAction;
+ public static String EditConnectionAction;
public static String NewConnectionWizard;
public static String NewConnectionWizard_CreateNewConnection;
public static String DefaultConnectionWizardPage_Title;
Modified: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.properties
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.properties 2010-04-06 09:24:46 UTC (rev 21279)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.properties 2010-04-06 09:26:35 UTC (rev 21280)
@@ -1,4 +1,5 @@
NewConnectionAction=New Connection...
+EditConnectionAction=Edit Connection...
NewConnectionWizard=New Connection Wizard
NewConnectionWizard_CreateNewConnection=Create a new JMX Connection
DefaultConnectionWizardPage_Title=Create JMX Connection
Modified: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/UIExtensionManager.java
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/UIExtensionManager.java 2010-04-06 09:24:46 UTC (rev 21279)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/UIExtensionManager.java 2010-04-06 09:26:35 UTC (rev 21280)
@@ -34,14 +34,17 @@
private static final String NAME = "name"; //$NON-NLS-1$
private static final String ICON = "icon"; //$NON-NLS-1$
private static final String CLASS = "class"; //$NON-NLS-1$
+ private static final String EDITABLE = "editable"; //$NON-NLS-1$
public static class ConnectionProviderUI {
String id, name, icon;
+ boolean editable;
IConfigurationElement[] wizardPages;
ImageDescriptor imageDescriptor;
public ConnectionProviderUI(IConfigurationElement element) {
id = element.getAttribute(ID);
name = element.getAttribute(NAME);
icon = element.getAttribute(ICON);
+ editable = Boolean.parseBoolean(element.getAttribute(EDITABLE));
wizardPages = element.getChildren();
String pluginName = element.getDeclaringExtension().getContributor().getName();
imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(pluginName, icon);
@@ -55,6 +58,10 @@
public String getIcon() {
return icon;
}
+ public boolean isEditable() {
+ return editable;
+ }
+
public ImageDescriptor getImageDescriptor() {
return imageDescriptor;
}
Added: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/actions/EditConnectionAction.java
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/actions/EditConnectionAction.java (rev 0)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/actions/EditConnectionAction.java 2010-04-06 09:26:35 UTC (rev 21280)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * 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.jmx.ui.internal.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.jmx.core.IConnectionWrapper;
+import org.jboss.tools.jmx.ui.Messages;
+import org.jboss.tools.jmx.ui.internal.wizards.EditConnectionWizard;
+
+public class EditConnectionAction extends Action {
+ private IConnectionWrapper connection;
+ public EditConnectionAction(IConnectionWrapper connection) {
+ this.connection = connection;
+ //setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(key));
+ setEnabled(true);
+ setText(Messages.EditConnectionAction);
+ }
+ public void run() {
+ EditConnectionWizard wizard = new EditConnectionWizard(connection);
+ WizardDialog d = new WizardDialog(new Shell(), wizard);
+ d.open();
+ }
+}
Modified: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/views/navigator/ActionProvider.java
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/views/navigator/ActionProvider.java 2010-04-06 09:24:46 UTC (rev 21279)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/views/navigator/ActionProvider.java 2010-04-06 09:26:35 UTC (rev 21280)
@@ -13,7 +13,6 @@
import java.util.ArrayList;
import java.util.Iterator;
-
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.ISelection;
@@ -23,8 +22,11 @@
import org.eclipse.ui.navigator.ICommonActionConstants;
import org.eclipse.ui.navigator.ICommonActionExtensionSite;
import org.jboss.tools.jmx.core.IConnectionWrapper;
+import org.jboss.tools.jmx.ui.UIExtensionManager;
+import org.jboss.tools.jmx.ui.UIExtensionManager.ConnectionProviderUI;
import org.jboss.tools.jmx.ui.internal.actions.DeleteConnectionAction;
import org.jboss.tools.jmx.ui.internal.actions.DoubleClickAction;
+import org.jboss.tools.jmx.ui.internal.actions.EditConnectionAction;
import org.jboss.tools.jmx.ui.internal.actions.MBeanServerConnectAction;
import org.jboss.tools.jmx.ui.internal.actions.MBeanServerDisconnectAction;
import org.jboss.tools.jmx.ui.internal.actions.NewConnectionAction;
@@ -60,7 +62,12 @@
menu.add(new MBeanServerConnectAction(connections));
else if( allControlable(connections))
menu.add(new MBeanServerDisconnectAction(connections));
-
+ if( connections.length == 1 ) {
+ String id = connections[0].getProvider().getId();
+ ConnectionProviderUI ui = UIExtensionManager.getConnectionProviderUI(id);
+ if( ui != null && ui.isEditable() && !connections[0].isConnected())
+ menu.add(new EditConnectionAction(connections[0]));
+ }
menu.add(new DeleteConnectionAction(connections));
}
Modified: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/DefaultConnectionWizardPage.java
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/DefaultConnectionWizardPage.java 2010-04-06 09:24:46 UTC (rev 21279)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/DefaultConnectionWizardPage.java 2010-04-06 09:26:35 UTC (rev 21280)
@@ -14,7 +14,6 @@
import java.net.UnknownHostException;
import java.util.HashMap;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
@@ -35,22 +34,29 @@
import org.jboss.tools.jmx.core.IConnectionProvider;
import org.jboss.tools.jmx.core.IConnectionWrapper;
import org.jboss.tools.jmx.core.providers.DefaultConnectionProvider;
-import org.jboss.tools.jmx.ui.ConnectionWizardPage;
+import org.jboss.tools.jmx.core.providers.DefaultConnectionWrapper;
+import org.jboss.tools.jmx.ui.IEditableConnectionWizardPage;
import org.jboss.tools.jmx.ui.Messages;
/**
* The connection page for the default wizard implementation.
*/
public class DefaultConnectionWizardPage extends WizardPage implements
- ConnectionWizardPage {
+ IEditableConnectionWizardPage {
private static final String _BLANK_ = ""; //$NON-NLS-1$
+ private static final String SIMPLE_PREFIX = "service:jmx:rmi:///jndi/rmi://"; //$NON-NLS-1$
+ private static final String SIMPLE_SUFFIX = "/jmxrmi"; //$NON-NLS-1$
private TabFolder folder;
private TabItem simpleItem, advancedItem;
private Text hostText, portText, urlText;
private Text nameText, userNameText, passwordText;
private Text advancedNameText, advancedUserNameText, advancedPasswordText;
private String name, url, userName, password;
-
+ private DefaultConnectionWrapper initialConnection;
+ public void setInitialConnection(IConnectionWrapper wrapper) {
+ this.initialConnection = (DefaultConnectionWrapper)wrapper;
+ }
+
private void addListeners() {
ModifyListener listener = new ModifyListener() {
public void modifyText(ModifyEvent e) {
@@ -120,7 +126,6 @@
nameLabel.setText(Messages.DefaultConnectionWizardPage_Name);
nameText = new Text(fieldComposite, SWT.BORDER);
- nameText.setText(getNextName());
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
nameText.setLayoutData(data);
@@ -131,7 +136,6 @@
// 2 host text entry
hostText = new Text(fieldComposite, SWT.BORDER);
- hostText.setText("localhost"); //$NON-NLS-1$
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
hostText.setLayoutData(data);
@@ -143,7 +147,6 @@
// 4 port text entry
portText = new Text(fieldComposite, SWT.BORDER);
portText.setTextLimit(5);
- portText.setText("3000"); //$NON-NLS-1$
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
portText.setLayoutData(data);
@@ -154,7 +157,6 @@
// 6 user name text entry
userNameText = new Text(fieldComposite, SWT.BORDER);
- userNameText.setText(_BLANK_);
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
@@ -166,13 +168,30 @@
// 8 user name text entry
passwordText = new Text(fieldComposite, SWT.BORDER | SWT.PASSWORD);
- passwordText.setText(_BLANK_);
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
passwordText.setLayoutData(data);
+
+ if( initialConnection == null ) {
+ nameText.setText(getNextName());
+ hostText.setText("localhost"); //$NON-NLS-1$
+ portText.setText("3000"); //$NON-NLS-1$
+ userNameText.setText(_BLANK_);
+ passwordText.setText(_BLANK_);
+ } else {
+ nameText.setText(initialConnection.getDescriptor().getID());
+ userNameText.setText(initialConnection.getDescriptor().getUserName());
+ passwordText.setText(initialConnection.getDescriptor().getPassword());
+ String url = initialConnection.getDescriptor().getURL();
+ if( url.startsWith(SIMPLE_PREFIX)) {
+ String host = url.substring(SIMPLE_PREFIX.length(), url.indexOf(":", SIMPLE_PREFIX.length())); //$NON-NLS-1$
+ String port = url.substring(url.indexOf(":", SIMPLE_PREFIX.length())+1, url.indexOf("/", SIMPLE_PREFIX.length()));//$NON-NLS-1$//$NON-NLS-2$
+ hostText.setText(host);
+ portText.setText(port);
+ }
+ }
return fieldComposite;
-
}
private Control createAdvancedConnectionPage(Composite parent) {
@@ -197,7 +216,6 @@
// 2 URL text entry
urlText = new Text(fieldComposite, SWT.BORDER);
- urlText.setText("service:jmx:rmi:"); //$NON-NLS-1$
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
urlText.setLayoutData(data);
@@ -208,7 +226,6 @@
// 4 user name text entry
advancedUserNameText = new Text(fieldComposite, SWT.BORDER);
- advancedUserNameText.setText(_BLANK_);
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
advancedUserNameText.setLayoutData(data);
@@ -220,11 +237,19 @@
// 6 user name text entry
advancedPasswordText = new Text(fieldComposite, SWT.BORDER
| SWT.PASSWORD);
- advancedPasswordText.setText(_BLANK_);
data = new GridData(GridData.FILL_HORIZONTAL);
data.grabExcessHorizontalSpace = true;
advancedPasswordText.setLayoutData(data);
+ if( initialConnection == null ) {
+ urlText.setText("service:jmx:rmi:"); //$NON-NLS-1$
+ advancedUserNameText.setText(_BLANK_);
+ advancedPasswordText.setText(_BLANK_);
+ } else {
+ urlText.setText(initialConnection.getDescriptor().getURL());
+ userNameText.setText(initialConnection.getDescriptor().getUserName());
+ passwordText.setText(initialConnection.getDescriptor().getPassword());
+ }
return fieldComposite;
}
@@ -241,7 +266,6 @@
}
protected void validate() {
- // TODO Validation
if (folder.getSelectionIndex() == 0) {
name = nameText.getText();
userName = userNameText.getText();
@@ -267,7 +291,7 @@
showError(Messages.DefaultConnectionWizardPage_Blank_Invalid);
return;
}
- url = "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/jmxrmi"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ url = SIMPLE_PREFIX + host + ":" + port + SIMPLE_SUFFIX; //$NON-NLS-1$
} else if (folder.getSelectionIndex() == 1) {
name = advancedNameText.getText();
userName = advancedUserNameText.getText();
@@ -315,35 +339,32 @@
protected boolean nameTaken(String s) {
IConnectionProvider provider = ExtensionManager.getProvider(DefaultConnectionProvider.PROVIDER_ID);
- IConnectionWrapper[] connections = provider.getConnections();
- for( int i = 0; i < connections.length; i++ ) {
- if( provider.getName(connections[i]).equals(s)) {
- return true;
+ if( initialConnection == null || !s.equals(provider.getName(initialConnection))) {
+ IConnectionWrapper[] connections = provider.getConnections();
+ for( int i = 0; i < connections.length; i++ ) {
+ if( provider.getName(connections[i]).equals(s)) {
+ return true;
+ }
}
}
return false;
}
- String getURL() {
- return url;
- }
-
- String getUserName() {
- return userName;
- }
-
- String getPassword() {
- return password;
- }
-
public IConnectionWrapper getConnection() throws CoreException {
- HashMap<String,String> map = new HashMap<String,String>();
- map.put(DefaultConnectionProvider.ID, name);
- map.put(DefaultConnectionProvider.URL, url);
- map.put(DefaultConnectionProvider.USERNAME, userName);
- map.put(DefaultConnectionProvider.PASSWORD, password);
- IConnectionProvider provider = ExtensionManager.getProvider(DefaultConnectionProvider.PROVIDER_ID);
-
- return provider.createConnection(map);
+ if( initialConnection == null ) {
+ HashMap<String,String> map = new HashMap<String,String>();
+ map.put(DefaultConnectionProvider.ID, name);
+ map.put(DefaultConnectionProvider.URL, url);
+ map.put(DefaultConnectionProvider.USERNAME, userName);
+ map.put(DefaultConnectionProvider.PASSWORD, password);
+ IConnectionProvider provider = ExtensionManager.getProvider(DefaultConnectionProvider.PROVIDER_ID);
+
+ return provider.createConnection(map);
+ }
+ initialConnection.getDescriptor().setId(name);
+ initialConnection.getDescriptor().setUrl(url);
+ initialConnection.getDescriptor().setUserName(userName);
+ initialConnection.getDescriptor().setPassword(password);
+ return initialConnection;
}
}
Added: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/EditConnectionWizard.java
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/EditConnectionWizard.java (rev 0)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/wizards/EditConnectionWizard.java 2010-04-06 09:26:35 UTC (rev 21280)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * 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.jmx.ui.internal.wizards;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.wizard.Wizard;
+import org.jboss.tools.jmx.core.IConnectionWrapper;
+import org.jboss.tools.jmx.ui.ConnectionWizardPage;
+import org.jboss.tools.jmx.ui.IEditableConnectionWizardPage;
+import org.jboss.tools.jmx.ui.UIExtensionManager;
+import org.jboss.tools.jmx.ui.UIExtensionManager.ConnectionProviderUI;
+
+public class EditConnectionWizard extends Wizard {
+ private IConnectionWrapper connection;
+ public EditConnectionWizard(IConnectionWrapper connection) {
+ super();
+ this.connection = connection;
+ }
+ public String getWindowTitle() {
+ return "TEST TITLE"; //$NON-NLS-1$
+ }
+
+ public void addPages() {
+ ConnectionProviderUI ui = UIExtensionManager.getConnectionProviderUI(connection.getProvider().getId());
+ ConnectionWizardPage[] pages = ui.createPages();
+ for( int j = 0; j < pages.length; j++ )
+ if( pages[j] instanceof IEditableConnectionWizardPage) {
+ ((IEditableConnectionWizardPage)pages[j]).setInitialConnection(connection);
+ addPage(pages[j]);
+ }
+ }
+
+ @Override
+ public boolean performFinish() {
+ try {
+ IConnectionWrapper xinda = ((ConnectionWizardPage)getPages()[0]).getConnection();
+ if( xinda == connection)
+ connection.getProvider().connectionChanged(connection);
+ else {
+ connection.getProvider().removeConnection(connection);
+ connection.getProvider().addConnection(xinda);
+ }
+ return true;
+ } catch( CoreException ce) {
+ }
+ return false;
+ }
+
+}
14 years, 9 months
JBoss Tools SVN: r21279 - in branches/jbosstools-3.1.x: as/plugins/org.jboss.ide.eclipse.as.wtp.ui/src/org/jboss/ide/eclipse/as/wtp/ui/propertypage and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-04-06 05:24:46 -0400 (Tue, 06 Apr 2010)
New Revision: 21279
Modified:
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/src/org/jboss/ide/eclipse/as/wtp/ui/propertypage/NewReferenceWizard.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProvider.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.properties
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/MBeanServerConnectionDescriptor.java
branches/jbosstools-3.1.x/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/test/DefaultProviderTest.java
Log:
JBIDE-4927 - editing jmx entries
Modified: branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java
===================================================================
--- branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java 2010-04-06 08:13:02 UTC (rev 21278)
+++ branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java 2010-04-06 09:24:46 UTC (rev 21279)
@@ -192,4 +192,7 @@
public boolean canDelete(IConnectionWrapper wrapper) {
return false;
}
+ public void connectionChanged(IConnectionWrapper connection) {
+ // do nothing
+ }
}
Modified: branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/src/org/jboss/ide/eclipse/as/wtp/ui/propertypage/NewReferenceWizard.java
===================================================================
--- branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/src/org/jboss/ide/eclipse/as/wtp/ui/propertypage/NewReferenceWizard.java 2010-04-06 08:13:02 UTC (rev 21278)
+++ branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/src/org/jboss/ide/eclipse/as/wtp/ui/propertypage/NewReferenceWizard.java 2010-04-06 09:24:46 UTC (rev 21279)
@@ -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.ide.eclipse.as.wtp.ui.propertypage;
import java.util.List;
Modified: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProvider.java
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProvider.java 2010-04-06 08:13:02 UTC (rev 21278)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProvider.java 2010-04-06 09:24:46 UTC (rev 21279)
@@ -69,6 +69,8 @@
*/
public void addConnection(IConnectionWrapper connection);
public void removeConnection(IConnectionWrapper connection);
+ public void connectionChanged(IConnectionWrapper connection);
+
public void addListener(IConnectionProviderListener listener);
public void removeListener(IConnectionProviderListener listener);
Modified: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.java
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.java 2010-04-06 08:13:02 UTC (rev 21278)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.java 2010-04-06 09:24:46 UTC (rev 21279)
@@ -18,6 +18,7 @@
public static String ExtensionManagerError1;
public static String DefaultConnection_ErrorAdding;
public static String DefaultConnection_ErrorRemoving;
+ public static String DefaultConnection_ErrorChanging;
public static String DefaultConnection_ErrorLoading;
public static String DefaultConnection_ErrorRunningJMXCode;
public static String ProblemWritingToFile;
Modified: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.properties
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.properties 2010-04-06 08:13:02 UTC (rev 21278)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.properties 2010-04-06 09:24:46 UTC (rev 21279)
@@ -7,6 +7,7 @@
DefaultConnection_ErrorLoading=Error loading connection
DefaultConnection_ErrorAdding=Error adding connection.
DefaultConnection_ErrorRemoving=Error removing connection.
+DefaultConnection_ErrorChanging=Error changing connection.
DefaultConnection_ErrorRunningJMXCode=Error executing JMX request.
ProblemWritingToFile=Problem writing to file {0}
LoadMBeans=Load MBeans
Modified: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java 2010-04-06 08:13:02 UTC (rev 21278)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java 2010-04-06 09:24:46 UTC (rev 21279)
@@ -91,6 +91,10 @@
public boolean canDelete(IConnectionWrapper wrapper) {
return wrapper instanceof DefaultConnectionWrapper;
}
+
+ public boolean canEdit(IConnectionWrapper wrapper) {
+ return wrapper instanceof DefaultConnectionWrapper;
+ }
public DefaultConnectionWrapper createConnection(Map map) throws CoreException {
String id = (String)map.get(ID);
@@ -151,6 +155,17 @@
}
}
}
+ public void connectionChanged(IConnectionWrapper connection) {
+ if( connection instanceof DefaultConnectionWrapper ) {
+ try {
+ save();
+ fireChanged(connection);
+ } catch( IOException ioe ) {
+ IStatus s = new Status(IStatus.ERROR, JMXActivator.PLUGIN_ID, JMXCoreMessages.DefaultConnection_ErrorChanging, ioe);
+ JMXActivator.log(s);
+ }
+ }
+ }
protected void loadConnections() {
String filename = JMXActivator.getDefault().getStateLocation().append(STORE_FILE).toOSString();
Modified: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java 2010-04-06 08:13:02 UTC (rev 21278)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java 2010-04-06 09:24:46 UTC (rev 21279)
@@ -35,7 +35,6 @@
import org.jboss.tools.jmx.core.tree.Root;
public class DefaultConnectionWrapper implements IConnectionWrapper {
- private JMXServiceURL url;
private JMXConnector connector;
private MBeanServerConnection connection;
private Root root;
@@ -55,8 +54,6 @@
String[] credentials = new String[] { username, descriptor.getPassword() };
environment.put(JMXConnector.CREDENTIALS, credentials);
}
-
- url = new JMXServiceURL(descriptor.getURL());
}
public MBeanServerConnectionDescriptor getDescriptor() {
@@ -77,7 +74,7 @@
public synchronized void connect() throws IOException {
// try to connect
- connector = JMXConnectorFactory.connect(url, environment);
+ connector = JMXConnectorFactory.connect(new JMXServiceURL(descriptor.getURL()), environment);
connection = connector.getMBeanServerConnection();
isConnected = true;
((DefaultConnectionProvider)getProvider()).fireChanged(this);
Modified: branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/MBeanServerConnectionDescriptor.java
===================================================================
--- branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/MBeanServerConnectionDescriptor.java 2010-04-06 08:13:02 UTC (rev 21278)
+++ branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/MBeanServerConnectionDescriptor.java 2010-04-06 09:24:46 UTC (rev 21279)
@@ -17,10 +17,10 @@
private static final long serialVersionUID = -8358701879017195518L;
- private final String id;
- private final String url;
- private final String userName;
- private final String password;
+ private String id;
+ private String url;
+ private String userName;
+ private String password;
public MBeanServerConnectionDescriptor(
String id, String url,
@@ -31,6 +31,22 @@
this.password = password;
}
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
public String getID() {
return id;
}
Modified: branches/jbosstools-3.1.x/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/test/DefaultProviderTest.java
===================================================================
--- branches/jbosstools-3.1.x/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/test/DefaultProviderTest.java 2010-04-06 08:13:02 UTC (rev 21278)
+++ branches/jbosstools-3.1.x/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/test/DefaultProviderTest.java 2010-04-06 09:24:46 UTC (rev 21279)
@@ -109,8 +109,7 @@
ExtensionManager.getProvider(DefaultConnectionProvider.PROVIDER_ID);
HashMap map = new HashMap();
map.put(DefaultConnectionProvider.ID, "Test Connection");
- map.put(DefaultConnectionProvider.URL, "service:jmx:rmi:///jndi/rmi://localhost:9999" +
- "/jmxrmi");
+ map.put(DefaultConnectionProvider.URL, "service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi");
map.put(DefaultConnectionProvider.USERNAME, "");
map.put(DefaultConnectionProvider.PASSWORD, "");
IConnectionWrapper wrapper = defProvider.createConnection(map);
14 years, 9 months
JBoss Tools SVN: r21278 - trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-04-06 04:13:02 -0400 (Tue, 06 Apr 2010)
New Revision: 21278
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamProjects.java
Log:
Ignore NullPointerException when creating first Seam project. It's eclispe bug already fixed in newer Eclipse version.
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamProjects.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamProjects.java 2010-04-06 07:05:31 UTC (rev 21277)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamProjects.java 2010-04-06 08:13:02 UTC (rev 21278)
@@ -1,7 +1,6 @@
package org.jboss.tools.seam.ui.bot.test.create;
import org.jboss.tools.seam.ui.bot.test.TestControl;
-import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.SWTJBTExt;
import org.jboss.tools.ui.bot.ext.SWTUtilExt;
@@ -14,6 +13,17 @@
waitForBlockingJobsAcomplished(240000, BUILDING_WS, VALIDATION +
" " + seam12Settings.getProperty("testProjectName")
+TYPE_WAR, DEPLOY_SOURCE, REG_IN_SERVER);
+ //TODO: This is eclipse bug already fixed in newer versions of Elipse so this should be removed
+ // when JBDS will use never version of Eclipse
+ Throwable exception = getException();
+ if (exception != null
+ && exception instanceof NullPointerException
+ && exception.getStackTrace().length > 0
+ && exception.getStackTrace()[0].getClassName().equals("org.eclipse.wst.server.core.internal.Server")
+ && exception.getStackTrace()[0].getLineNumber() == 783){
+ // Reset returned exception
+ setException(null);
+ }
swtJbtExt.removeSeamProjectFromServers(seam12Settings.getProperty("testProjectName"));
}
14 years, 9 months
JBoss Tools SVN: r21277 - in workspace/dart/org.jboss.tools.smooks.ui.bot.test/src/org/jboss/tools/smooks/ui/bot/test: jira and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2010-04-06 03:05:31 -0400 (Tue, 06 Apr 2010)
New Revision: 21277
Added:
workspace/dart/org.jboss.tools.smooks.ui.bot.test/src/org/jboss/tools/smooks/ui/bot/test/KeyPressHelper.java
workspace/dart/org.jboss.tools.smooks.ui.bot.test/src/org/jboss/tools/smooks/ui/bot/test/jira/KeyboradAbility_JBIDE5831.java
Log:
JBIDE-5831
Install the feature test case for Keyboard ability in Smooks editor
Added: workspace/dart/org.jboss.tools.smooks.ui.bot.test/src/org/jboss/tools/smooks/ui/bot/test/KeyPressHelper.java
===================================================================
--- workspace/dart/org.jboss.tools.smooks.ui.bot.test/src/org/jboss/tools/smooks/ui/bot/test/KeyPressHelper.java (rev 0)
+++ workspace/dart/org.jboss.tools.smooks.ui.bot.test/src/org/jboss/tools/smooks/ui/bot/test/KeyPressHelper.java 2010-04-06 07:05:31 UTC (rev 21277)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.smooks.ui.bot.test;
+
+import org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory;
+import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
+import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
+
+/**
+ * @author Dart
+ *
+ */
+public class KeyPressHelper {
+ public static void pressSingleKeyCode(int keyCode) {
+ SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
+ KeyboardFactory.getSWTKeyboard().pressShortcut(Keystrokes.DELETE);
+
+ }
+
+ public static void pressCompositeKeyCode(int stateMask, char c) {
+
+ SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
+ KeyboardFactory.getSWTKeyboard().pressShortcut(stateMask,c);
+ }
+}
Property changes on: workspace/dart/org.jboss.tools.smooks.ui.bot.test/src/org/jboss/tools/smooks/ui/bot/test/KeyPressHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/dart/org.jboss.tools.smooks.ui.bot.test/src/org/jboss/tools/smooks/ui/bot/test/jira/KeyboradAbility_JBIDE5831.java
===================================================================
--- workspace/dart/org.jboss.tools.smooks.ui.bot.test/src/org/jboss/tools/smooks/ui/bot/test/jira/KeyboradAbility_JBIDE5831.java (rev 0)
+++ workspace/dart/org.jboss.tools.smooks.ui.bot.test/src/org/jboss/tools/smooks/ui/bot/test/jira/KeyboradAbility_JBIDE5831.java 2010-04-06 07:05:31 UTC (rev 21277)
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.smooks.ui.bot.test.jira;
+
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
+import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
+import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory;
+import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.zest.core.widgets.Graph;
+import org.eclipse.zest.core.widgets.GraphNode;
+import org.jboss.tools.smooks.graphical.editors.TaskTypeManager;
+import org.jboss.tools.smooks.graphical.editors.process.TaskType;
+import org.jboss.tools.smooks.ui.bot.test.AbstractSmooksUIBotTest;
+import org.jboss.tools.smooks.ui.bot.test.KeyPressHelper;
+
+/**
+ * @author Dart
+ *
+ */
+public class KeyboradAbility_JBIDE5831 extends AbstractSmooksUIBotTest {
+ private String fileName;
+ public void testKeyboradAbility(){
+ SWTGefBot gefBot = new SWTGefBot();
+
+ fileName = "keyborad.xml";
+ this.newSmooksConfigFile(getTestProjectName(), fileName);
+ SWTBotEditor editor = bot.editorByTitle(fileName);
+ final SWTBot innerBot = editor.bot();
+
+ // add task node via pop menu
+ selectNode(innerBot, TaskTypeManager.TASK_ID_INPUT, 3);
+ SWTBotMenu addJavaMappingMenu = findProcessMapViewerContext(getGraph(innerBot), "Java Mapping");
+ addJavaMappingMenu.click();
+
+ // select at the java mapping task
+ selectNode(innerBot, TaskTypeManager.TASK_ID_JAVA_MAPPING, 1);
+
+ SWTBotGefEditor editor1 = gefBot.gefEditor(fileName);
+
+ // add java class model via pop menu
+ editor1.rootEditPart().click();
+ editor1.clickContextMenu("Java Class ");
+
+ // open java bean creation dialog , add a new Java Bean figure
+ bot.shell("New Java Class Model").activate();
+
+ bot.textWithLabel("Bean ID :").setText("order");
+
+ bot.textWithLabel("Java Class :").setText("edi2java.example.model.Order");
+
+ bot.button("Finish").click();
+
+ /* Test keyborad ability in the Mapping Viewer */
+
+ // Test the Delete key:
+
+ // to find the 'order' GEF edit part:
+ SWTBotGefEditPart part = editor1.getEditPart("order");
+ part.click();
+ // Press Delete
+ KeyPressHelper.pressSingleKeyCode( SWT.DEL);
+ // Find the 'order' GEF edit part agian to test if it disappear.
+ part = editor1.getEditPart("order");
+ Assert.isTrue(part == null , "Delete key doesn't effect");
+
+ // Test Ctrl+Z (redo) key:
+ editor1.rootEditPart().click();
+ KeyPressHelper.pressCompositeKeyCode(SWT.CTRL, 'z');
+
+ part = editor1.getEditPart("order");
+ Assert.isNotNull(part , "Order part isn't added again !!");
+
+ // Test Ctrl+y (undo) key:
+ editor1.rootEditPart().click();
+ KeyPressHelper.pressCompositeKeyCode(SWT.CTRL, 'y');
+
+ part = editor1.getEditPart("order");
+ Assert.isTrue(part == null , "Order part isn't deleted again !!");
+
+ /* Test keyborad ability in Process Viewer*/
+ // select at the java mapping task
+ selectNode(innerBot, TaskTypeManager.TASK_ID_JAVA_MAPPING, 1);
+ KeyPressHelper.pressSingleKeyCode( SWT.DEL);
+ final Graph graph = getGraph(innerBot);
+ final List<?> nodes = graph.getNodes();
+ innerBot.getDisplay().syncExec(new Runnable() {
+ public void run(){
+ for (Iterator<?> iterator = nodes.iterator(); iterator.hasNext();) {
+ GraphNode node = (GraphNode) iterator.next();
+ Object data = node.getData();
+ if (data instanceof TaskType) {
+ String id = ((TaskType) data).getId();
+ if(id.equals(TaskTypeManager.TASK_ID_JAVA_MAPPING)){
+ Assert.isTrue(false,"Java Mapping node isn't deleted");
+ }
+ }
+ }
+ }
+ });
+
+ }
+
+}
Property changes on: workspace/dart/org.jboss.tools.smooks.ui.bot.test/src/org/jboss/tools/smooks/ui/bot/test/jira/KeyboradAbility_JBIDE5831.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 9 months
JBoss Tools SVN: r21276 - branches/jbosstools-3.1.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-04-06 02:38:02 -0400 (Tue, 06 Apr 2010)
New Revision: 21276
Modified:
branches/jbosstools-3.1.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java
Log:
JBIDE-6077 committed to branch
Modified: branches/jbosstools-3.1.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java
===================================================================
--- branches/jbosstools-3.1.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java 2010-04-06 06:34:53 UTC (rev 21275)
+++ branches/jbosstools-3.1.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java 2010-04-06 06:38:02 UTC (rev 21276)
@@ -98,6 +98,7 @@
showProjectRoot.setSelection(
PrefsInitializer.getBoolean(PrefsInitializer.PREF_SHOW_PROJECT_ROOT, getElement(), false));
enableDefaultExcludes.setSelection(PrefsInitializer.getBoolean(PrefsInitializer.PREF_USE_DEFAULT_EXCLUDES, getElement(), false));
+ showNodeOnAllProjects.setSelection(PrefsInitializer.getBoolean(PrefsInitializer.PREF_ALWAYS_SHOW_PROJECT_EXPLORER_NODE, getElement(), false));
defaultExcludes.setText(PrefsInitializer.getString(PrefsInitializer.PREF_DEFAULT_EXCLUDE_LIST, getElement(), true));
showAllProjects.setEnabled(showProjectRoot.getSelection());
if (!showProjectRoot.getSelection())
14 years, 9 months