JBoss Tools SVN: r33895 - in trunk/common: plugins/org.jboss.tools.common.jdt.debug and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-08-14 20:26:33 -0400 (Sun, 14 Aug 2011)
New Revision: 33895
Modified:
trunk/common/features/org.jboss.tools.common.jdt.feature/pom.xml
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/pom.xml
trunk/common/plugins/org.jboss.tools.common.jdt.debug/pom.xml
Log:
JBIDE-9545 Add remote debug attach to jboss tools
Modified: trunk/common/features/org.jboss.tools.common.jdt.feature/pom.xml
===================================================================
--- trunk/common/features/org.jboss.tools.common.jdt.feature/pom.xml 2011-08-14 23:55:25 UTC (rev 33894)
+++ trunk/common/features/org.jboss.tools.common.jdt.feature/pom.xml 2011-08-15 00:26:33 UTC (rev 33895)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jboss.tools.common</groupId>
<artifactId>features</artifactId>
- <version>3.3.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.common.features</groupId>
<artifactId>org.jboss.tools.common.jdt.feature</artifactId>
Modified: trunk/common/plugins/org.jboss.tools.common.jdt.debug/pom.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/pom.xml 2011-08-14 23:55:25 UTC (rev 33894)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/pom.xml 2011-08-15 00:26:33 UTC (rev 33895)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jboss.tools.common</groupId>
<artifactId>plugins</artifactId>
- <version>3.3.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.common.plugins</groupId>
<artifactId>org.jboss.tools.common.jdt.debug</artifactId>
Modified: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/pom.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/pom.xml 2011-08-14 23:55:25 UTC (rev 33894)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/pom.xml 2011-08-15 00:26:33 UTC (rev 33895)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.jboss.tools.common</groupId>
<artifactId>plugins</artifactId>
- <version>3.3.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.common.plugins</groupId>
<artifactId>org.jboss.tools.common.jdt.debug.ui</artifactId>
14 years, 8 months
JBoss Tools SVN: r33894 - in trunk: common/features and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-08-14 19:55:25 -0400 (Sun, 14 Aug 2011)
New Revision: 33894
Modified:
trunk/build/aggregate/site/site.xml
trunk/common/features/pom.xml
trunk/common/plugins/pom.xml
trunk/common/site/site.xml
trunk/site/site.xml
Log:
JBIDE-9545 Add remote debug attach to jboss tools
Modified: trunk/build/aggregate/site/site.xml
===================================================================
--- trunk/build/aggregate/site/site.xml 2011-08-14 23:52:38 UTC (rev 33893)
+++ trunk/build/aggregate/site/site.xml 2011-08-14 23:55:25 UTC (rev 33894)
@@ -131,6 +131,10 @@
<category name="GeneralTools" />
</feature>
+ <feature url="features/org.jboss.tools.common.jdt.feature_0.0.0.jar" id="org.jboss.tools.common.jdt.feature" version="0.0.0">
+ <category name="AllTools" />
+ </feature>
+
<feature url="features/org.jboss.tools.runtime.feature_0.0.0.jar" id="org.jboss.tools.runtime.feature" version="0.0.0">
<category name="AllTools" />
</feature>
Modified: trunk/common/features/pom.xml
===================================================================
--- trunk/common/features/pom.xml 2011-08-14 23:52:38 UTC (rev 33893)
+++ trunk/common/features/pom.xml 2011-08-14 23:55:25 UTC (rev 33894)
@@ -19,6 +19,7 @@
<module>org.jboss.tools.common.text.ext.feature</module>
<module>org.jboss.tools.common.ui.feature</module>
<module>org.jboss.tools.common.verification.feature</module>
+ <module>org.jboss.tools.common.jdt.feature</module>
</modules>
</project>
Modified: trunk/common/plugins/pom.xml
===================================================================
--- trunk/common/plugins/pom.xml 2011-08-14 23:52:38 UTC (rev 33893)
+++ trunk/common/plugins/pom.xml 2011-08-14 23:55:25 UTC (rev 33894)
@@ -29,6 +29,8 @@
<module>org.jboss.tools.common.ui</module>
<module>org.jboss.tools.common.verification</module>
<module>org.jboss.tools.common.verification.ui</module>
+ <module>org.jboss.tools.common.jdt.debug</module>
+ <module>org.jboss.tools.common.jdt.debug.ui</module>
</modules>
</project>
Modified: trunk/common/site/site.xml
===================================================================
--- trunk/common/site/site.xml 2011-08-14 23:52:38 UTC (rev 33893)
+++ trunk/common/site/site.xml 2011-08-14 23:55:25 UTC (rev 33894)
@@ -23,6 +23,9 @@
<feature url="features/org.jboss.tools.common.verification.feature_0.0.0.jar" id="org.jboss.tools.common.verification.feature" version="0.0.0">
<category name="JBoss Tools common Nightly Build Update Site"/>
</feature>
+ <feature url="features/org.jboss.tools.common.jdt.feature_0.0.0.jar" id="org.jboss.tools.common.jdt.feature" version="0.0.0">
+ <category name="JBoss Tools common Nightly Build Update Site"/>
+ </feature>
<!-- add tests plugins since downstream projects like ESB depend on them -->
<feature url="features/org.jboss.tools.common.all.tests.feature_0.0.0.jar" id="org.jboss.tools.common.all.tests.feature" version="0.0.0">
Modified: trunk/site/site.xml
===================================================================
--- trunk/site/site.xml 2011-08-14 23:52:38 UTC (rev 33893)
+++ trunk/site/site.xml 2011-08-14 23:55:25 UTC (rev 33894)
@@ -49,4 +49,5 @@
<feature url="features/org.jboss.tools.runtime.jbpm.detector.feature_0.0.0.jar" id="org.jboss.tools.runtime.jbpm.detector.feature" version="0.0.0" />
<feature url="features/org.jboss.tools.deltacloud.feature_0.0.0.jar" id="org.jboss.tools.deltacloud.feature" version="0.0.0" />
<feature url="features/org.jboss.tools.usage.feature_0.0.0.jar" id="org.jboss.tools.usage.feature" version="0.0.0" />
+ <feature url="features/org.jboss.tools.common.jdt.feature_0.0.0.jar" id="org.jboss.tools.common.jdt.feature" version="0.0.0" />
</site>
14 years, 8 months
JBoss Tools SVN: r33893 - in trunk/common: plugins/org.jboss.tools.common.jdt.debug and 28 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-08-14 19:52:38 -0400 (Sun, 14 Aug 2011)
New Revision: 33893
Added:
trunk/common/features/org.jboss.tools.common.jdt.feature/.project
trunk/common/features/org.jboss.tools.common.jdt.feature/build.properties
trunk/common/features/org.jboss.tools.common.jdt.feature/feature.properties
trunk/common/features/org.jboss.tools.common.jdt.feature/feature.xml
trunk/common/features/org.jboss.tools.common.jdt.feature/license.html
trunk/common/features/org.jboss.tools.common.jdt.feature/pom.xml
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.classpath
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.gitignore
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.project
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.settings/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.settings/org.eclipse.jdt.core.prefs
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/META-INF/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/build.properties
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/icons/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/icons/jboss.gif
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/icons/xpl/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/icons/xpl/complete_tsk.gif
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/icons/xpl/error_tsk.gif
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/icons/xpl/incomplete_tsk.gif
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/plugin.properties
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/plugin.xml
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/pom.xml
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/Messages.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/RemoteDebugUIActivator.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/DiscoverRemoteApplicationAction.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/LaunchDialogAction.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteApplicationPropertyTester.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteDebugItems.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteLaunchAction.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/handlers/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/handlers/DiscoverRemoteApplicationHandler.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/handlers/RemoteDebugHandler.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/JBossConnectTab.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/JBossRemoteJavaApplicationTabGroup.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/JBossRemoteJavaApplicationTabGroup2.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/LaunchRemoteApplicationDialog.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/RemoteJavaApplicationLaunchShortcut.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/xpl/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/xpl/JavaConnectTab.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/messages.properties
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/AutoResizeTableLayout.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebug.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebugEditingSupport.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebugPreferencePage.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug/.classpath
trunk/common/plugins/org.jboss.tools.common.jdt.debug/.gitignore
trunk/common/plugins/org.jboss.tools.common.jdt.debug/.project
trunk/common/plugins/org.jboss.tools.common.jdt.debug/.settings/
trunk/common/plugins/org.jboss.tools.common.jdt.debug/.settings/org.eclipse.jdt.core.prefs
trunk/common/plugins/org.jboss.tools.common.jdt.debug/META-INF/
trunk/common/plugins/org.jboss.tools.common.jdt.debug/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.html
trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.ini
trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.mappings
trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.properties
trunk/common/plugins/org.jboss.tools.common.jdt.debug/build.properties
trunk/common/plugins/org.jboss.tools.common.jdt.debug/jboss_about.png
trunk/common/plugins/org.jboss.tools.common.jdt.debug/plugin.properties
trunk/common/plugins/org.jboss.tools.common.jdt.debug/plugin.xml
trunk/common/plugins/org.jboss.tools.common.jdt.debug/pom.xml
trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/
trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/
trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/
trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/
trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/
trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/
trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/
trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/RemoteDebugActivator.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/VmModel.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/sourcelookup/
trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/sourcelookup/DebugLaunchConfigurationListener.java
trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/sourcelookup/RemoteDebugSourcePathComputer.java
Log:
JBIDE-9545 Add remote debug attach to jboss tools
Added: trunk/common/features/org.jboss.tools.common.jdt.feature/.project
===================================================================
--- trunk/common/features/org.jboss.tools.common.jdt.feature/.project (rev 0)
+++ trunk/common/features/org.jboss.tools.common.jdt.feature/.project 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.common.jdt.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/common/features/org.jboss.tools.common.jdt.feature/build.properties
===================================================================
--- trunk/common/features/org.jboss.tools.common.jdt.feature/build.properties (rev 0)
+++ trunk/common/features/org.jboss.tools.common.jdt.feature/build.properties 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,3 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ license.html
Added: trunk/common/features/org.jboss.tools.common.jdt.feature/feature.properties
===================================================================
--- trunk/common/features/org.jboss.tools.common.jdt.feature/feature.properties (rev 0)
+++ trunk/common/features/org.jboss.tools.common.jdt.feature/feature.properties 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,54 @@
+###############################################################################
+# Copyright (c) 2008-2011 Red Hat, Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# JBoss by Red Hat - Initial implementation.
+##############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=JBoss Tools Launching Support
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update site
+updateSiteName=JBossTools Update Site
+
+# "description" property - description of the feature
+description=JBoss Tools Launching Support
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=Copyright (c) 2008-2011 Red Hat, Inc. and others.\nAll rights reserved. This program and the accompanying materials\n
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http\://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors\:\n\
+JBoss by Red Hat - Initial implementation.\n
+ ############### end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=Red Hat, Inc. licenses these features and plugins to you under \
+certain open source licenses (or aggregations of such licenses), which \
+in a particular case may include the Eclipse Public License, the GNU \
+Lesser General Public License, and/or certain other open source \
+licenses. For precise licensing details, consult the corresponding \
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive, \
+Raleigh NC 27606 USA.
+# END NON-TRANSLATABLE
+########### end of license property ##########################################
Added: trunk/common/features/org.jboss.tools.common.jdt.feature/feature.xml
===================================================================
--- trunk/common/features/org.jboss.tools.common.jdt.feature/feature.xml (rev 0)
+++ trunk/common/features/org.jboss.tools.common.jdt.feature/feature.xml 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.common.jdt.feature"
+ label="%featureName"
+ version="1.0.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.jboss.tools.common.jdt.debug">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <plugin
+ id="org.jboss.tools.common.jdt.debug"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.common.jdt.debug.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Added: trunk/common/features/org.jboss.tools.common.jdt.feature/license.html
===================================================================
--- trunk/common/features/org.jboss.tools.common.jdt.feature/license.html (rev 0)
+++ trunk/common/features/org.jboss.tools.common.jdt.feature/license.html 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+
+<body>
+<p>Red Hat, Inc. licenses these features and plugins to you under
+certain open source licenses (or aggregations of such licenses), which
+in a particular case may include the Eclipse Public License, the GNU
+Lesser General Public License, and/or certain other open source
+licenses. For precise licensing details, consult the corresponding
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
+Raleigh NC 27606 USA.
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/common/features/org.jboss.tools.common.jdt.feature/pom.xml
===================================================================
--- trunk/common/features/org.jboss.tools.common.jdt.feature/pom.xml (rev 0)
+++ trunk/common/features/org.jboss.tools.common.jdt.feature/pom.xml 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.common</groupId>
+ <artifactId>features</artifactId>
+ <version>3.3.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.common.features</groupId>
+ <artifactId>org.jboss.tools.common.jdt.feature</artifactId>
+
+ <packaging>eclipse-feature</packaging>
+</project>
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/.classpath
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/.classpath (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/.classpath 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/.gitignore
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/.gitignore (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/.gitignore 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,2 @@
+/target
+/bin
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/.project
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/.project (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/.project 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.common.jdt.debug</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/.settings/org.eclipse.jdt.core.prefs 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,8 @@
+#Sun Jul 03 18:38:35 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/META-INF/MANIFEST.MF (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/META-INF/MANIFEST.MF 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %BundleName
+Bundle-SymbolicName: org.jboss.tools.common.jdt.debug;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.common.jdt.debug.RemoteDebugActivator
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.core.resources;bundle-version="3.7.100",
+ org.eclipse.jdt.core;bundle-version="3.7.0",
+ org.eclipse.debug.core;bundle-version="3.7.0",
+ org.eclipse.jdt.launching;bundle-version="3.6.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: %BundleVendor
+Bundle-Localization: plugin
+Export-Package: org.jboss.tools.common.jdt.debug,
+ org.jboss.tools.common.jdt.debug.sourcelookup
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.html
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.html (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.html 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>JBoss Tools Launching Support</title>
+<style type="text/css" media="screen">
+<!--
+ body {
+ font-family: Sans-serif, Arial, Helvetica;
+ }
+
+-->
+</style>
+</head>
+<body>
+<h1>JBoss Tools Launching Support</h1>
+
+<p>
+This plugin is part of the JBoss Tools developed by the <a href="http://www.jboss.com">JBoss Inc.</a>
+</p>
+
+<p>Information about this plugin is available at <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
+
+<p>
+This software is distributed under the terms of the Eclipse Public License - v 1.0
+(see <a href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License - Version 1.0</a>).
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.ini
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.ini (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.ini 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,27 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+# test
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=jboss_about.png
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+
+# Property "appName" contains name of the application (not translated)
+# needed for primary features only
+
+# Property "welcomePerspective" contains the id of the perspective in which the
+# welcome page is to be opened.
+# optional
+
+
+
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.mappings
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.mappings (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.mappings 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,5 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.properties (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/about.properties 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,2 @@
+blurb=JBoss Tools Launching Support\n\nVersion\: {featureVersion}\n\n(c) Copyright JBoss by Red Hat, contributors and others 2004 - 2011. All rights reserved.\nVisit http\://jboss.org/tools
+
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/build.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/build.properties (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/build.properties 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,11 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html,\
+ about.ini,\
+ about.mappings,\
+ about.properties,\
+ jboss_about.png
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/jboss_about.png
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.jdt.debug/jboss_about.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/plugin.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/plugin.properties (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/plugin.properties 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,8 @@
+#Properties file for org.jboss.tools.common.jdt.debug
+BundleVendor = JBoss by Red Hat
+BundleName = JBoss Tools Launching Support
+
+remoteJavaApplicationDelegate.description=The Eclipse JDT Java Remote Launcher supports attaching to and debugging remote Java applications.
+remoteJavaApplication = JBoss Tools Remote Java Application
+eclipseJDTLauncher.name=Eclipse JDT Launcher
+
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/plugin.xml (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/plugin.xml 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <!--
+ <extension
+ point="org.eclipse.debug.core.launchConfigurationTypes">
+ <launchConfigurationType
+ delegate="org.eclipse.jdt.internal.launching.JavaRemoteApplicationLaunchConfigurationDelegate"
+ delegateDescription="%remoteJavaApplicationDelegate.description"
+ delegateName="%eclipseJDTLauncher.name"
+ id="org.jboss.tools.common.jdt.debug.launching.JBossRemoteJavaApplication"
+ migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate"
+ modes="debug"
+ name="%remoteJavaApplication"
+ sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
+ sourcePathComputerId="org.jboss.tools.common.jdt.debug.sourceLookup.remoteDebugSourcePathComputer">
+ </launchConfigurationType>
+ </extension>
+ -->
+
+ <extension point="org.eclipse.debug.core.sourcePathComputers">
+ <sourcePathComputer
+ id="org.jboss.tools.common.jdt.debug.sourceLookup.remoteDebugSourcePathComputer"
+ class="org.jboss.tools.common.jdt.debug.sourcelookup.RemoteDebugSourcePathComputer">
+ </sourcePathComputer>
+ </extension>
+
+</plugin>
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/pom.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/pom.xml (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/pom.xml 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.common</groupId>
+ <artifactId>plugins</artifactId>
+ <version>3.3.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.common.plugins</groupId>
+ <artifactId>org.jboss.tools.common.jdt.debug</artifactId>
+
+ <packaging>eclipse-plugin</packaging>
+</project>
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/RemoteDebugActivator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/RemoteDebugActivator.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/RemoteDebugActivator.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,608 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.internal.runtime.InternalPlatform;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
+import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jdt.internal.launching.SocketAttachConnector;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.launching.IVMConnector;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.IVMInstallType;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.jboss.tools.common.jdt.debug.sourcelookup.DebugLaunchConfigurationListener;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class RemoteDebugActivator implements BundleActivator, IPropertyChangeListener {
+
+ public static final String UNKNOWN = "<Unknown>";
+ public static final String LOCALHOST = "localhost"; //$NON-NLS-1$
+ public static final String LAUNCH_CONFIGURATION_ID = "org.jboss.tools.common.jdt.debug.launching.JBossRemoteJavaApplication"; //$NON-NLS-1$
+ public static final String REMOTE_JAVA_APPLICATION_ID = IJavaLaunchConfigurationConstants.ID_REMOTE_JAVA_APPLICATION;
+ public static final String JBOSS_REMOTE_JAVA_APPLICATION = "JBossRemoteJavaApplication"; //$NON-NLS-1$
+ public static final String JBOSS_SOURCE_PATH_COMPUTER_ID = "org.jboss.tools.common.jdt.debug.sourceLookup.remoteDebugSourcePathComputer"; //$NON-NLS-1$
+
+ public static final String LAUNCH_CATEGORY = "org.eclipse.debug.ui.launchGroup.debug"; //$NON-NLS-1$
+ public static final String DEFAULT_REMOTE_JBOSS_APP = "Remote myapp"; //$NON-NLS-1$
+ public static final String JBOSS_TEMP_JAVA_APPLICATION = "jbossTempJavaApplication"; //$NON-NLS-1$
+ public static final String DT_SOCKET = "dt_socket"; //$NON-NLS-1$
+ public static final String SET_AS_DEFAULT = "setAsDefault"; //$NON-NLS-1$
+ public static final String ATTR_SELECTED_PROJECTS = "selectedProjects"; //$NON-NLS-1$
+ public static final String MAVEN_SOURCEPATH_PROVIDER = "org.eclipse.m2e.launchconfig.sourcepathProvider"; //$NON-NLS-1$
+ public static final String MAVEN_CLASSPATH_PROVIDER = "org.eclipse.m2e.launchconfig.classpathProvider"; //$NON-NLS-1$
+ public static final String JDT_JAVA_APPLICATION = "org.eclipse.jdt.launching.localJavaApplication"; //$NON-NLS-1$
+ public static final String JDT_JUNIT_TEST = "org.eclipse.jdt.junit.launchconfig"; //$NON-NLS-1$
+
+ private static final String JAVA_HOME = "java.home"; //$NON-NLS-1$
+ private static final String TOOLS_JAR = File.separator + "lib" + File.separator + "tools.jar"; //$NON-NLS-1$ //$NON-NLS-2$
+ private static final String PLUGIN_ID = "org.jboss.tools.common.jdt.debug"; //$NON-NLS-1$
+
+ private static String[] WIN_CMD_ARRAY = { "netstat", "-ona", "-p", "tcp" };
+ private static String[] MAC_CMD_ARRAY = { "lsof", "-i", "-P" };
+ private static String[] LINUX_CMD_ARRAY = { "netstat", "-nlt", "-p", "" };
+
+ private static final String MAVEN_PLUGIN_ID = "org.eclipse.m2e.core"; //$NON-NLS-1$
+ public static final String MAVEN_NATURE = MAVEN_PLUGIN_ID + ".maven2Nature"; //$NON-NLS-1$
+
+ private boolean jdk = false;
+ private boolean logged = false;
+ private ClassLoader toolsLoader;
+ private static RemoteDebugActivator plugin;
+
+ private static BundleContext context;
+
+ private DebugLaunchConfigurationListener listener;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ RemoteDebugActivator.context = bundleContext;
+ plugin = this;
+ JavaRuntime.getPreferences().addPropertyChangeListener(this);
+ listener= new DebugLaunchConfigurationListener();
+ DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(listener);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ RemoteDebugActivator.context = null;
+ JavaRuntime.getPreferences().removePropertyChangeListener(this);
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(listener);
+
+ }
+
+ public static RemoteDebugActivator getDefault() {
+ return plugin;
+ }
+
+ private File getToolsJar() {
+ String javaHome = System.getProperty(JAVA_HOME);
+ File javaHomeFile = new File(javaHome);
+ File tools = getFile(javaHomeFile);
+ if (tools.exists()) {
+ return tools;
+ }
+ File parentDir = new File(javaHome + File.separator + ".."); //$NON-NLS-1$
+ tools = getFile(parentDir);
+ if (tools.exists()) {
+ return tools;
+ }
+ if (parentDir.isDirectory()) {
+ for (File child : parentDir.listFiles()) {
+ if (!child.isDirectory()) {
+ continue;
+ }
+ tools = getFile(child);
+ if (tools.exists()) {
+ return tools;
+ }
+ }
+ }
+ for (IVMInstallType type : JavaRuntime.getVMInstallTypes()) {
+ for (IVMInstall install : type.getVMInstalls()) {
+ File jdkRoot = install.getInstallLocation();
+ tools = getFile(jdkRoot);
+ if (tools.exists()) {
+ return tools;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private File getFile(File dir) {
+ File tools = new File(dir, TOOLS_JAR);
+ if (tools.exists()) {
+ return tools;
+ }
+ return tools;
+ }
+
+ private ClassLoader getToolsLoader() {
+ if (toolsLoader == null) {
+ toolsLoader = Thread.currentThread().getContextClassLoader();
+ File toolsJar = getToolsJar();
+ if (toolsJar == null) {
+ return toolsLoader;
+ }
+ try {
+ toolsJar = toolsJar.getCanonicalFile();
+ } catch (IOException e1) {
+ return toolsLoader;
+ }
+ if (toolsJar.exists()) {
+ URL toolsUrl;
+ try {
+ toolsUrl = toolsJar.toURI().toURL();
+ } catch (MalformedURLException e) {
+ return toolsLoader;
+ }
+ toolsLoader = new URLClassLoader(new URL[] { toolsUrl },
+ toolsLoader);
+ }
+ }
+ return toolsLoader;
+ }
+
+ private List<VmModel> getVmModels(String name, IProgressMonitor monitor) {
+ if (monitor == null) {
+ monitor = new NullProgressMonitor();
+ }
+ ClassLoader currentLoader = Thread.currentThread().getContextClassLoader();
+ List<VmModel> models = new ArrayList<VmModel>();
+ try {
+ Thread.currentThread().setContextClassLoader(getToolsLoader());
+ Class<?> hostClazz = toolsLoader.loadClass("sun.jvmstat.monitor.MonitoredHost"); //$NON-NLS-1$
+ Method method = hostClazz.getDeclaredMethod("getMonitoredHost", //$NON-NLS-1$
+ new Class[] { String.class });
+ Object host = method.invoke(null, name);
+ if (host != null) {
+ method = hostClazz.getDeclaredMethod("activeVms", new Class[0]); //$NON-NLS-1$
+ Object vmObjects = method.invoke(host, new Object[0]);
+ int i = 1;
+ if (vmObjects instanceof Set) {
+ Set<Integer> vmPids = (Set<Integer>) vmObjects;
+ int size = vmPids.size();
+ monitor.beginTask("Discovering Remote Aplications", vmPids.size() + 1);
+ for (Integer vmPid : vmPids) {
+ monitor.worked(1);
+ monitor.setTaskName(i++ + " out of " + size + ": Discovering port, main class and arguments for process id " + vmPid);
+ VmModel model = getVmModelsUsingTools(hostClazz, host, vmPid, monitor);
+ if (model != null) {
+ models.add(model);
+ } else {
+ model = getVmModelUsingOsCommand(vmPid, monitor);
+ if (model != null) {
+ models.add(model);
+ }
+ }
+ }
+ }
+ }
+ jdk = true;
+ } catch (ClassNotFoundException e) {
+ logWarning(e);
+ jdk = false;
+ } catch (SecurityException e) {
+ logWarning(e);
+ } catch (NoSuchMethodException e) {
+ logWarning(e);
+ } catch (IllegalArgumentException e) {
+ logWarning(e);
+ } catch (IllegalAccessException e) {
+ logWarning(e);
+ } catch (InvocationTargetException e) {
+ logWarning(e);
+ } finally {
+ Thread.currentThread().setContextClassLoader(currentLoader);
+ }
+ return models;
+ }
+
+ private String[] getOsCommand(String pid) {
+ if (Platform.OS_WIN32.equals(Platform.getOS())) {
+ return WIN_CMD_ARRAY;
+ } else if (Platform.OS_MACOSX.equals(Platform.getOS())) {
+ return MAC_CMD_ARRAY;
+ } else if (Platform.OS_LINUX.equals(Platform.getOS())) {
+ String[] cmdarray = LINUX_CMD_ARRAY;
+ cmdarray[cmdarray.length-1] = pid;
+ return cmdarray;
+ }
+ return null;
+ }
+
+ private VmModel getVmModelUsingOsCommand(Integer vmPid, IProgressMonitor monitor) {
+ if (vmPid == null) {
+ return null;
+ }
+ if (monitor == null) {
+ monitor = new NullProgressMonitor();
+ }
+ if (monitor.isCanceled()) {
+ return null;
+ }
+ String vmPidStr = String.valueOf(vmPid);
+ String[] cmdarray = getOsCommand(vmPidStr);
+ if (cmdarray == null) {
+ return null;
+ }
+ InputStream is = null;
+ BufferedReader reader = null;
+ try {
+ Process process = Runtime.getRuntime().exec(cmdarray);
+ if (monitor.isCanceled()) {
+ return null;
+ }
+ is = process.getInputStream();
+ reader = new BufferedReader(new InputStreamReader(is));
+ String line = reader.readLine();
+
+ while (line != null) {
+ if (line.contains("LISTEN")) {
+ line = clearWhiteSpace(line);
+ VmModel model = processLine(line, vmPidStr);
+ if (model != null) {
+ return model;
+ }
+ }
+ if (monitor.isCanceled()) {
+ return null;
+ }
+ line = reader.readLine();
+ }
+ } catch (IOException e) {
+ logWarning(e);
+ } finally {
+ if (reader != null) {
+ try {
+ reader.close();
+ } catch (IOException e1) {
+ // ignore
+ }
+ }
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e1) {
+ // ignore
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private VmModel processLine(String line, String vmPidStr) {
+ if (Platform.OS_WIN32.equals(Platform.getOS())) {
+ return processWinLine(line, vmPidStr);
+ } else if (Platform.OS_MACOSX.equals(Platform.getOS())) {
+ return processMacLine(line, vmPidStr);
+ } else if (Platform.OS_LINUX.equals(Platform.getOS())) {
+ return processLinuxLine(line, vmPidStr);
+ }
+ return null;
+ }
+
+ private VmModel processLinuxLine(String line, String vmPidStr) {
+ String[] elements = line.split(" ", 7);
+ if (elements.length >= 7 &&
+ elements[0] != null && elements[0].equals("tcp")) {
+ if (elements[6] != null) {
+ String[] pids = elements[6].split("/");
+ String pid;
+ if (pids.length == 2) {
+ pid = pids[0];
+ if (pid != null && pid.equals(vmPidStr)) {
+ if (elements[3] != null) {
+ String port = getPort(elements[3]);
+ if (port != null) {
+ VmModel model = new VmModel();
+ model.setPid(vmPidStr);
+ model.setMainClass(UNKNOWN);
+ model.setPort(port);
+ model.setTransport(DT_SOCKET);
+ return model;
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private VmModel processMacLine(String line, String vmPidStr) {
+ String[] elements = line.split(" ", 10);
+ if (elements.length >= 10 &&
+ elements[1] != null && elements[1].equals(vmPidStr) &&
+ elements[7] != null && elements[7].equals("TCP")) {
+ if (elements[8] != null) {
+ String port = getPort(elements[8]);
+ if (port != null && !port.isEmpty()) {
+ VmModel model = new VmModel();
+ model.setPid(vmPidStr);
+ model.setMainClass(UNKNOWN);
+ model.setPort(port);
+ model.setTransport(DT_SOCKET);
+ return model;
+ }
+ }
+ }
+ return null;
+ }
+
+ private String getPort(String element) {
+ String[] ports = element.split(":");
+ String port;
+ if (ports.length == 2) {
+ port = ports[1];
+ } else {
+ port = ports[0];
+ }
+ return port;
+ }
+
+ private VmModel processWinLine(String line, String vmPidStr) {
+ String[] elements = line.split(" ", 5);
+ if (elements.length == 5 && elements[4] != null && elements[4].equals(vmPidStr)) {
+ if (elements[1] != null) {
+ String port = getPort(elements[1]);
+ if (port != null && !port.isEmpty()) {
+ VmModel model = new VmModel();
+ model.setPid(vmPidStr);
+ model.setMainClass(UNKNOWN);
+ model.setPort(port);
+ model.setTransport(DT_SOCKET);
+ return model;
+ }
+ }
+ }
+ return null;
+ }
+
+ private String clearWhiteSpace(String line) {
+ line = line.trim();
+ while (line.contains("\t")) {
+ line = line.replace(" ", "\t");
+ }
+ while (line.contains(" ")) {
+ line = line.replace(" ", " ");
+ }
+ return line;
+ }
+
+ private VmModel getVmModelsUsingTools(Class<?> hostClazz, Object host, Integer vmPid, IProgressMonitor monitor) {
+ if (monitor == null) {
+ monitor = new NullProgressMonitor();
+ }
+ if (monitor.isCanceled()) {
+ return null;
+ }
+ String vmPidStr = String.valueOf(vmPid);
+ try {
+ Class<?> vmIdentifier = toolsLoader.loadClass("sun.jvmstat.monitor.VmIdentifier"); //$NON-NLS-1$
+ Constructor<?> vmIdentifierConstructor = vmIdentifier.getConstructor(new Class[] {String.class});
+ Object vmIdentifierObject = vmIdentifierConstructor.newInstance(new Object[] {vmPidStr});
+ Method getMonitoredVm = hostClazz.getDeclaredMethod("getMonitoredVm", new Class[] {vmIdentifier}); //$NON-NLS-1$
+ Object vm = getMonitoredVm.invoke(host, vmIdentifierObject);
+ Class<?> vmUtil = toolsLoader.loadClass("sun.jvmstat.monitor.MonitoredVmUtil"); //$NON-NLS-1$
+ Class<?> monitoredVm = toolsLoader.loadClass("sun.jvmstat.monitor.MonitoredVm"); //$NON-NLS-1$
+ if (monitor.isCanceled()) {
+ return null;
+ }
+ VmModel model = new VmModel();
+ model.setPid(vmPidStr);
+ Method jvmArgs = vmUtil.getDeclaredMethod("jvmArgs", //$NON-NLS-1$
+ new Class[] { monitoredVm });
+ Object jvmArgsObj = jvmArgs.invoke(null, vm);
+ if (jvmArgsObj instanceof String) {
+ model.setJvmArgs((String) jvmArgsObj);
+ }
+ Method mainClass = vmUtil.getDeclaredMethod(
+ "mainClass", new Class[] { monitoredVm, //$NON-NLS-1$
+ boolean.class });
+ Object mainClassObj = mainClass.invoke(null,
+ new Object[] { vm, true });
+ if (mainClassObj instanceof String) {
+ model.setMainClass((String) mainClassObj);
+ }
+ Method mainArgs = vmUtil.getDeclaredMethod("mainArgs", //$NON-NLS-1$
+ new Class[] { monitoredVm });
+ Object mainArgsObj = mainArgs.invoke(null, vm);
+ if (mainArgsObj instanceof String) {
+ model.setMainArgs((String) mainArgsObj);
+ }
+ return model;
+ } catch (Exception e) {
+ logWarning(e);
+ }
+ return null;
+ }
+
+ private void logWarning(Exception e) {
+ if (!logged) {
+ IStatus status = new Status(IStatus.WARNING, context.getBundle().getSymbolicName(), e.getLocalizedMessage(), e);
+ getLog().log(status);
+ logged = true;
+ }
+ }
+
+ public ILog getLog() {
+ Bundle bundle = context.getBundle();
+ return InternalPlatform.getDefault().getLog(bundle);
+ }
+
+ public VmModel[] getDebugModels(String name, IProgressMonitor monitor) {
+ List<VmModel> debugModels = new ArrayList<VmModel>();
+ List<VmModel> models = getVmModels(name, monitor);
+ if (models == null) {
+ return null;
+ }
+ for (VmModel model:models) {
+ if (model.getPort() != null && DT_SOCKET.equals(model.getTransport())) {
+ debugModels.add(model);
+ }
+ }
+ return debugModels.toArray(new VmModel[0]);
+ }
+
+ public boolean isJdk() {
+ if (!jdk && toolsLoader == null) {
+ getVmModels(LOCALHOST, new NullProgressMonitor());
+ }
+ return jdk;
+ }
+
+ public static void log(Exception e, String message) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
+ plugin.getLog().log(status);
+ }
+
+ public static void log(Throwable e) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
+ .getLocalizedMessage(), e);
+ plugin.getLog().log(status);
+ }
+
+ public static IVMConnector getDefaultVMConnector() {
+ IVMConnector[] connectors = JavaRuntime.getVMConnectors();
+ for (IVMConnector connector:connectors) {
+ if (connector instanceof SocketAttachConnector) {
+ return connector;
+ }
+ }
+ return null;
+ }
+
+ public VmModel[] getDebugModels(IProgressMonitor monitor) {
+ return getDebugModels(LOCALHOST, monitor);
+ }
+
+ public ILaunchConfiguration getDefaultLaunchConfiguration() {
+ ILaunchConfiguration[] configs = getLaunchConfigurations();
+ if (configs != null && configs.length > 0) {
+ for (ILaunchConfiguration config:configs) {
+ boolean isDefault = false;
+ try {
+ isDefault = config.getAttribute(SET_AS_DEFAULT, false);
+ } catch (CoreException e) {
+ // ignore
+ }
+ if (isDefault) {
+ return config;
+ }
+ }
+ if (configs.length == 1) {
+ try {
+ ILaunchConfigurationWorkingCopy wc = configs[0].getWorkingCopy();
+ wc.setAttribute(RemoteDebugActivator.SET_AS_DEFAULT, true);
+ wc.doSave();
+ } catch (CoreException e) {
+ log(e);
+ }
+ }
+ return configs[0];
+ }
+ return null;
+ }
+
+ public ILaunchConfiguration[] getLaunchConfigurations() {
+ ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType type = manager.getLaunchConfigurationType(RemoteDebugActivator.REMOTE_JAVA_APPLICATION_ID);
+ try {
+ ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type);
+ List<ILaunchConfiguration> jbossConfigurations = new ArrayList<ILaunchConfiguration>();
+ for (ILaunchConfiguration config:configs) {
+ if (config.getAttribute(RemoteDebugActivator.JBOSS_REMOTE_JAVA_APPLICATION, false)) {
+ jbossConfigurations.add(config);
+ }
+ }
+ return jbossConfigurations.toArray(new ILaunchConfiguration[0]);
+ } catch (CoreException e) {
+ return null;
+ }
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
+ String property = event.getProperty();
+ if (JavaRuntime.PREF_VM_XML.equals(property)) {
+ toolsLoader = null;
+ logged = false;
+ }
+ }
+
+ public static boolean m2eExists() {
+ Bundle bundle = Platform.getBundle(MAVEN_PLUGIN_ID);
+ return bundle != null;
+ }
+
+ public static ILaunchConfiguration createTemporaryLaunchConfiguration(String projectName, String typeId)
+ throws CoreException {
+ ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType type = manager.getLaunchConfigurationType(typeId);
+ ILaunchConfigurationWorkingCopy wc = type.newInstance(null, manager.generateLaunchConfigurationName(RemoteDebugActivator.JBOSS_TEMP_JAVA_APPLICATION));
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
+ ILaunchConfiguration config = wc.doSave();
+ return config;
+ }
+
+ public static ILaunchConfigurationWorkingCopy createNewLaunchConfiguration(ILaunchConfigurationType type)
+ throws CoreException {
+ ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationWorkingCopy wc = type.newInstance(null, manager.generateLaunchConfigurationName(RemoteDebugActivator.DEFAULT_REMOTE_JBOSS_APP));
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_ALLOW_TERMINATE, false);
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_CONNECTOR, RemoteDebugActivator.getDefaultVMConnector().getIdentifier());
+ wc.setAttribute(RemoteDebugActivator.JBOSS_REMOTE_JAVA_APPLICATION, true);
+ return wc;
+ }
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/VmModel.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/VmModel.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/VmModel.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,195 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class VmModel {
+ private String pid;
+ private String port;
+ private String transport;
+ private String jvmArgs;
+ private String mainClass;
+ private String mainArgs;
+ private Map<String, String> args;
+ private String jdwpArgs;
+ private String displayName;
+
+ public String getJvmArgs() {
+ return jvmArgs;
+ }
+
+ public void setJvmArgs(String jvmArgs) {
+ this.jvmArgs = jvmArgs;
+ args = getArguments(jvmArgs);
+ jdwpArgs = getJdwpArg(args);
+ }
+
+ public String getMainClass() {
+ return mainClass;
+ }
+
+ public void setMainClass(String mainClass) {
+ this.mainClass = mainClass;
+ }
+
+ public String getMainArgs() {
+ return mainArgs;
+ }
+
+ public void setMainArgs(String mainArgs) {
+ this.mainArgs = mainArgs;
+ }
+
+ private Map<String, String> getArguments(String args) {
+ Map<String, String> arguments = new HashMap<String, String>();
+
+ for (String argument : args.split(" ")) { //$NON-NLS-1$
+ if (argument.length() == 0) {
+ continue;
+ }
+ String[] nameValue = argument.split("=", 2); //$NON-NLS-1$
+ if (nameValue.length == 1) {
+ arguments.put(nameValue[0], nameValue[0]);
+ } else {
+ arguments.put(nameValue[0], nameValue[1]);
+ }
+
+ }
+ return arguments;
+ }
+
+ private String getJdwpArg(Map<String, String> arguments) {
+ String jdwpArg = arguments.get("-agentlib:jdwp"); //$NON-NLS-1$
+ if (jdwpArg == null) {
+ jdwpArg = arguments.get("-Xrunjdwp:transport"); //$NON-NLS-1$
+ }
+ return jdwpArg;
+ }
+
+ public String getPort() {
+ if (this.port != null) {
+ return this.port;
+ }
+ if (jdwpArgs == null) {
+ return null;
+ }
+ for (String argument : jdwpArgs.split(",")) { //$NON-NLS-1$
+ String[] nameValue = argument.split("=", 2); //$NON-NLS-1$
+ if (nameValue.length == 2) {
+ if ("address".equals(nameValue[0])) { //$NON-NLS-1$
+ String address = nameValue[1];
+ if (address == null) {
+ continue;
+ }
+ String[] addresses = address.split(":", 2); //$NON-NLS-1$
+ if (addresses.length == 1) {
+ port = addresses[0];
+ return port;
+ } else {
+ port = addresses[1];
+ return port;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public String getTransport() {
+ if (this.transport != null) {
+ return this.transport;
+ }
+ if (jdwpArgs == null) {
+ return null;
+ }
+ for (String argument : jdwpArgs.split(",")) { //$NON-NLS-1$
+ String[] nameValue = argument.split("=", 2); //$NON-NLS-1$
+ if (nameValue.length == 2) {
+ if ("transport".equals(nameValue[0])) { //$NON-NLS-1$
+ this.transport = nameValue[1];
+ return transport;
+ }
+ }
+ if (nameValue.length == 1) {
+ if (RemoteDebugActivator.DT_SOCKET.equals(nameValue[0])) {
+ this.transport = nameValue[0];
+ return transport;
+ }
+ }
+ }
+ return null;
+ }
+
+ public String getDisplayName() {
+ if (displayName == null) {
+ StringBuffer buffer = new StringBuffer();
+ if (getMainClass() != null) {
+ buffer.append(mainClass);
+// if (mainArgs != null) {
+// if (buffer.length() > 0) {
+// buffer.append(" ");
+// }
+// buffer.append(mainArgs);
+// }
+ if (pid != null) {
+ if (buffer.length() > 0) {
+ buffer.append(",pid="); //$NON-NLS-1$
+ }
+ buffer.append(pid);
+ }
+ String port = getPort();
+ if (port != null) {
+ if (buffer.length() > 0) {
+ buffer.append(",port="); //$NON-NLS-1$
+ }
+ buffer.append(port);
+ }
+ }
+ if (buffer.length() > 0) {
+ displayName = buffer.toString();
+ }
+ }
+ return displayName;
+ }
+
+ public String getPid() {
+ return pid;
+ }
+
+ public void setPid(String pid) {
+ this.pid = pid;
+ }
+
+ public void setPort(String port) {
+ this.port = port;
+ }
+
+ public void setTransport(String transport) {
+ this.transport = transport;
+ }
+
+ @Override
+ public String toString() {
+ return "VmModel [pid=" + pid + ", port=" + port + ", transport="
+ + transport + ", jvmArgs=" + jvmArgs + ", mainClass="
+ + mainClass + ", mainArgs=" + mainArgs + ", args=" + args
+ + ", jdwpArgs=" + jdwpArgs + ", displayName=" + displayName
+ + "]";
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/sourcelookup/DebugLaunchConfigurationListener.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/sourcelookup/DebugLaunchConfigurationListener.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/sourcelookup/DebugLaunchConfigurationListener.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,110 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.sourcelookup;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationListener;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.sourcelookup.ISourcePathComputer;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.jboss.tools.common.jdt.debug.RemoteDebugActivator;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class DebugLaunchConfigurationListener implements
+ ILaunchConfigurationListener {
+
+ public void launchConfigurationAdded(ILaunchConfiguration configuration) {
+ updateLaunchConfiguration(configuration);
+ }
+
+ public void launchConfigurationChanged(ILaunchConfiguration configuration) {
+ updateLaunchConfiguration(configuration);
+ }
+
+ public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
+ // do nothing
+ }
+
+ private void updateLaunchConfiguration(ILaunchConfiguration configuration) {
+ try {
+ if (!RemoteDebugActivator.REMOTE_JAVA_APPLICATION_ID
+ .equals(configuration.getType().getIdentifier())) {
+ return;
+ }
+ if (configuration.getAttributes().containsKey(
+ IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER)) {
+ return;
+ }
+ if (!configuration.getAttribute(RemoteDebugActivator.JBOSS_REMOTE_JAVA_APPLICATION, false)) {
+ return;
+ }
+
+ IJavaProject javaProject = JavaRuntime
+ .getJavaProject(configuration);
+ if (javaProject == null) {
+ return;
+ }
+ String sourcePathComputer = configuration.getAttribute(ISourcePathComputer.ATTR_SOURCE_PATH_COMPUTER_ID, (String) null);
+ ILaunchConfigurationWorkingCopy wc = getLaunchConfigurationWorkingCopy(configuration);
+ boolean save = false;
+ if (sourcePathComputer == null) {
+ wc.setAttribute(ISourcePathComputer.ATTR_SOURCE_PATH_COMPUTER_ID, RemoteDebugActivator.JBOSS_SOURCE_PATH_COMPUTER_ID);
+ save = true;
+ }
+ if (javaProject.getProject().hasNature(RemoteDebugActivator.MAVEN_NATURE)) {
+ if (RemoteDebugActivator.m2eExists()) {
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER,
+ RemoteDebugActivator.MAVEN_CLASSPATH_PROVIDER);
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER,
+ RemoteDebugActivator.MAVEN_SOURCEPATH_PROVIDER);
+ } else {
+ String classPathProvider = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, "");
+ if (RemoteDebugActivator.MAVEN_CLASSPATH_PROVIDER.equals(classPathProvider)) {
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER,
+ (String)null);
+ }
+ String sourcePathProvider = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER, "");
+ if (RemoteDebugActivator.MAVEN_SOURCEPATH_PROVIDER.equals(sourcePathProvider)) {
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER,
+ (String)null);
+ }
+ }
+ save = true;
+ }
+ if (save) {
+ wc.doSave();
+ }
+ } catch (CoreException e) {
+ RemoteDebugActivator.log(e);
+ }
+ }
+
+ private ILaunchConfigurationWorkingCopy getLaunchConfigurationWorkingCopy(
+ ILaunchConfiguration configuration) throws CoreException {
+ ILaunchConfigurationWorkingCopy wc;
+ if (configuration instanceof ILaunchConfigurationWorkingCopy) {
+ wc = (ILaunchConfigurationWorkingCopy) configuration;
+ } else {
+ wc = configuration.getWorkingCopy();
+ }
+ return wc;
+ }
+
+
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/sourcelookup/RemoteDebugSourcePathComputer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/sourcelookup/RemoteDebugSourcePathComputer.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug/src/org/jboss/tools/common/jdt/debug/sourcelookup/RemoteDebugSourcePathComputer.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,112 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.sourcelookup;
+
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.sourcelookup.ISourceContainer;
+import org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.jboss.tools.common.jdt.debug.RemoteDebugActivator;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class RemoteDebugSourcePathComputer implements ISourcePathComputerDelegate {
+
+ public static final String ID = "org.jboss.tools.common.jdt.debug.sourceLookup.remoteDebugSourcePathComputer"; //$NON-NLS-1$
+
+ public String getId() {
+ return ID;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate#computeSourceContainers(org.eclipse.debug.core.ILaunchConfiguration, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
+ IRuntimeClasspathEntry[] entries = JavaRuntime.computeUnresolvedSourceLookupPath(configuration);
+ List<String> projectNames = configuration.getAttribute(RemoteDebugActivator.ATTR_SELECTED_PROJECTS, new ArrayList<String>());
+ for (String projectName:projectNames) {
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ if (project != null) {
+ IJavaProject javaProject = JavaCore.create(project);
+ entries = addProjectEntry(entries, javaProject);
+ }
+
+ }
+ IRuntimeClasspathEntry[] resolved;
+ if (RemoteDebugActivator.m2eExists()) {
+ resolved = resolveM2eSourceLookupPath(configuration, entries);
+ } else {
+ resolved = JavaRuntime.resolveSourceLookupPath(entries, configuration);
+ }
+
+ return JavaRuntime.getSourceContainers(resolved);
+ }
+
+ private IRuntimeClasspathEntry[] resolveM2eSourceLookupPath(
+ ILaunchConfiguration configuration, IRuntimeClasspathEntry[] entries)
+ throws CoreException {
+ String projectName = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null);
+ IRuntimeClasspathEntry[] runtimeResolved = getResolvedEntries(entries, projectName, RemoteDebugActivator.JDT_JAVA_APPLICATION);
+ IRuntimeClasspathEntry[] testResolved = getResolvedEntries(entries, projectName, RemoteDebugActivator.JDT_JUNIT_TEST);
+ return combineEntries(runtimeResolved, testResolved);
+ }
+
+ private IRuntimeClasspathEntry[] combineEntries(
+ IRuntimeClasspathEntry[] runtimeResolved,
+ IRuntimeClasspathEntry[] testResolved) {
+ Set<IRuntimeClasspathEntry> resolved = new LinkedHashSet<IRuntimeClasspathEntry>();
+ for (IRuntimeClasspathEntry entry:runtimeResolved) {
+ resolved.add(entry);
+ }
+ for (IRuntimeClasspathEntry entry:testResolved) {
+ resolved.add(entry);
+ }
+ return resolved.toArray(new IRuntimeClasspathEntry[0]);
+ }
+
+ private IRuntimeClasspathEntry[] getResolvedEntries(
+ IRuntimeClasspathEntry[] entries, String projectName, String typeId)
+ throws CoreException {
+ ILaunchConfiguration tempConfiguration = RemoteDebugActivator.createTemporaryLaunchConfiguration(projectName, typeId);
+ IRuntimeClasspathEntry[] resolved = JavaRuntime.resolveSourceLookupPath(entries, tempConfiguration);
+ tempConfiguration.delete();
+ return resolved;
+ }
+
+ private IRuntimeClasspathEntry[] addProjectEntry(
+ IRuntimeClasspathEntry[] entries, IJavaProject javaProject) {
+ if (javaProject != null) {
+ IRuntimeClasspathEntry runtime = JavaRuntime.newDefaultProjectClasspathEntry(javaProject);
+ IRuntimeClasspathEntry[] copy = new IRuntimeClasspathEntry[entries.length + 1];
+ System.arraycopy(entries, 0, copy, 0, entries.length);
+ copy[entries.length] = runtime;
+ entries = copy;
+ }
+ return entries;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.classpath
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.classpath (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.classpath 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.gitignore
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.gitignore (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.gitignore 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,2 @@
+/target
+/bin
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.project
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.project (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.project 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.common.jdt.debug.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/.settings/org.eclipse.jdt.core.prefs 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,8 @@
+#Sun Jul 03 19:41:52 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/META-INF/MANIFEST.MF (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/META-INF/MANIFEST.MF 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,27 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %BundleName
+Bundle-SymbolicName: org.jboss.tools.common.jdt.debug.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator
+Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.jboss.tools.common.jdt.debug,
+ org.eclipse.jdt.debug.ui;bundle-version="3.6.0",
+ org.eclipse.debug.ui;bundle-version="3.7.0",
+ org.eclipse.jdt.core;bundle-version="3.7.0",
+ org.eclipse.jdt.launching;bundle-version="3.6.0",
+ org.eclipse.jdt.debug;bundle-version="3.7.0",
+ org.eclipse.core.expressions;bundle-version="3.4.300",
+ org.eclipse.jdt.ui;bundle-version="3.7.0",
+ org.eclipse.core.variables;bundle-version="3.2.500"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: %BundleVendor
+Bundle-Localization: plugin
+Export-Package: org.jboss.tools.common.jdt.debug.ui,
+ org.jboss.tools.common.jdt.debug.ui.actions,
+ org.jboss.tools.common.jdt.debug.ui.handlers,
+ org.jboss.tools.common.jdt.debug.ui.launching,
+ org.jboss.tools.common.jdt.debug.ui.launching.xpl,
+ org.jboss.tools.common.jdt.debug.ui.preferences
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/build.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/build.properties (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/build.properties 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ icons/
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/icons/jboss.gif
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/icons/jboss.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/icons/xpl/complete_tsk.gif
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/icons/xpl/complete_tsk.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/icons/xpl/error_tsk.gif
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/icons/xpl/error_tsk.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/icons/xpl/incomplete_tsk.gif
===================================================================
(Binary files differ)
Property changes on: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/icons/xpl/incomplete_tsk.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/plugin.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/plugin.properties (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/plugin.properties 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,9 @@
+#Properties file for org.jboss.tools.common.jdt.debug.ui
+BundleVendor = JBoss by Red Hat
+BundleName = JBoss Tools Launching Support UI
+
+remoteJavaApplicationTabGroupDescription=Attach to a Java virtual machine accepting debug connections
+
+
+menu.label = Remote Debug As
+menu.mnemonic = r
\ No newline at end of file
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/plugin.xml (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/plugin.xml 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,287 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension point="org.eclipse.debug.ui.launchConfigurationTabGroups">
+ <launchConfigurationTabGroup
+ type="org.eclipse.jdt.launching.remoteJavaApplication"
+ description="Attach to a Java virtual machine accepting debug connections"
+ class="org.jboss.tools.common.jdt.debug.ui.launching.JBossRemoteJavaApplicationTabGroup2"
+ id="org.jboss.tools.common.jdt.debug.ui.launching.launchConfigurationTabGroup.JBossRemoteJavaApplication2">
+ </launchConfigurationTabGroup>
+ </extension>
+ <!--
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTabGroups">
+ <launchConfigurationTabGroup
+ type="org.jboss.tools.common.jdt.debug.launching.JBossRemoteJavaApplication"
+ description="%remoteJavaApplicationTabGroupDescription"
+ class="org.jboss.tools.common.jdt.debug.ui.launching.JBossRemoteJavaApplicationTabGroup"
+ id="org.jboss.tools.common.jdt.debug.ui.launching.launchConfigurationTabGroup.JBossRemoteJavaApplication">
+ </launchConfigurationTabGroup>
+ </extension>
+
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTypeImages">
+ <launchConfigurationTypeImage
+ icon="$nl$/icons/jboss.gif"
+ configTypeID="org.jboss.tools.common.jdt.debug.launching.JBossRemoteJavaApplication"
+ id="org.jboss.tools.common.jdt.debug.launchConfigurationTypeImage.JBossRemoteJavaApplication">
+ </launchConfigurationTypeImage>
+ </extension>
+
+ <extension point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ id="org.jboss.tools.common.jdt.debug.ui.propertyTester"
+ namespace="org.jboss.tools.common.jdt.debug.ui"
+ properties="remoteCount, remoteExists"
+ type="java.lang.Object"
+ class="org.jboss.tools.common.jdt.debug.ui.actions.RemoteApplicationPropertyTester">
+ </propertyTester>
+ </extension>
+
+ <extension point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="popup:org.eclipse.ui.popup.any?before=additions">
+ <menu
+ id="org.jboss.tools.common.jdt.debug.ui.remoteDebug"
+ label="%menu.label"
+ mnemonic="%menu.mnemonic">
+ <dynamic class="org.jboss.tools.common.jdt.debug.ui.actions.RemoteDebugItems"
+ id="org.jboss.tools.common.jdt.debug.ui.items"/>
+ <visibleWhen
+ checkEnabled="false">
+ <with variable="selection">
+ <iterate>
+ <adapt type="org.eclipse.core.resources.IProject">
+ <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.jdt.core.javanature"/>
+ </adapt>
+
+ <test
+ forcePluginActivation="true"
+ property="org.jboss.tools.common.jdt.debug.ui.remoteExists"
+ value="true"/>
+
+ </iterate>
+ </with>
+ </visibleWhen>
+ <separator
+ name="additions"
+ visible="false">
+ </separator>
+ </menu>
+ </menuContribution>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <category
+ name="JBoss Tools Remote Debugging"
+ description="JBoss Tools Remote Debugging"
+ id="org.jboss.tools.common.jdt.debug" />
+ <command
+ name="Remote Debug 0"
+ description="Remote Debug 0"
+ categoryId="org.jboss.tools.common.jdt.debug"
+ defaultHandler="org.jboss.tools.common.jdt.debug.ui.handlers.RemoteDebugHandler"
+ id="org.jboss.tools.common.jdt.debug.0">
+ </command>
+ <command
+ name="Remote Debug 1"
+ description="Remote Debug 1"
+ categoryId="org.jboss.tools.common.jdt.debug"
+ defaultHandler="org.jboss.tools.common.jdt.debug.ui.handlers.RemoteDebugHandler"
+ id="org.jboss.tools.common.jdt.debug.1">
+ </command>
+ <command
+ name="Remote Debug 2"
+ description="Remote Debug 2"
+ categoryId="org.jboss.tools.common.jdt.debug"
+ defaultHandler="org.jboss.tools.common.jdt.debug.ui.handlers.RemoteDebugHandler"
+ id="org.jboss.tools.common.jdt.debug.2">
+ </command>
+ <command
+ name="Remote Debug 3"
+ description="Remote Debug 3"
+ categoryId="org.jboss.tools.common.jdt.debug"
+ defaultHandler="org.jboss.tools.common.jdt.debug.ui.handlers.RemoteDebugHandler"
+ id="org.jboss.tools.common.jdt.debug.3">
+ </command>
+ <command
+ name="Remote Debug 4"
+ description="Remote Debug 4"
+ categoryId="org.jboss.tools.common.jdt.debug"
+ defaultHandler="org.jboss.tools.common.jdt.debug.ui.handlers.RemoteDebugHandler"
+ id="org.jboss.tools.common.jdt.debug.4">
+ </command>
+ <command
+ name="Remote Debug 5"
+ description="Remote Debug 5"
+ categoryId="org.jboss.tools.common.jdt.debug"
+ defaultHandler="org.jboss.tools.common.jdt.debug.ui.handlers.RemoteDebugHandler"
+ id="org.jboss.tools.common.jdt.debug.5">
+ </command>
+ <command
+ name="Remote Debug 6"
+ description="Remote Debug 6"
+ categoryId="org.jboss.tools.common.jdt.debug"
+ defaultHandler="org.jboss.tools.common.jdt.debug.ui.handlers.RemoteDebugHandler"
+ id="org.jboss.tools.common.jdt.debug.6">
+ </command>
+ <command
+ name="Remote Debug 7"
+ description="Remote Debug 7"
+ categoryId="org.jboss.tools.common.jdt.debug"
+ defaultHandler="org.jboss.tools.common.jdt.debug.ui.handlers.RemoteDebugHandler"
+ id="org.jboss.tools.common.jdt.debug.7">
+ </command>
+ <command
+ name="Remote Debug 8"
+ description="Remote Debug 8"
+ categoryId="org.jboss.tools.common.jdt.debug"
+ defaultHandler="org.jboss.tools.common.jdt.debug.ui.handlers.RemoteDebugHandler"
+ id="org.jboss.tools.common.jdt.debug.8">
+ </command>
+ <command
+ name="Remote Debug 9"
+ description="Remote Debug 9"
+ categoryId="org.jboss.tools.common.jdt.debug"
+ defaultHandler="org.jboss.tools.common.jdt.debug.ui.handlers.RemoteDebugHandler"
+ id="org.jboss.tools.common.jdt.debug.9">
+ </command>
+
+ <command
+ name="Configure"
+ description="Configure"
+ categoryId="org.jboss.tools.common.jdt.debug"
+ defaultHandler="org.jboss.tools.common.jdt.debug.ui.handlers.RemoteDebugHandler"
+ id="org.jboss.tools.common.jdt.debug.ui.configure">
+ </command>
+
+ <command
+ name="Discover Remote Applications"
+ description="Discover Remote Applications"
+ categoryId="org.jboss.tools.common.jdt.debug"
+ defaultHandler="org.jboss.tools.common.jdt.debug.ui.handlers.DiscoverRemoteApplicationHandler"
+ id="org.jboss.tools.common.jdt.debug.ui.discover">
+ </command>
+
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.jboss.tools.common.jdt.debug.0"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+D 0">
+ </key>
+ <key
+ commandId="org.jboss.tools.common.jdt.debug.1"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+D 1">
+ </key>
+ <key
+ commandId="org.jboss.tools.common.jdt.debug.2"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+D 2">
+ </key>
+ <key
+ commandId="org.jboss.tools.common.jdt.debug.3"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+D 3">
+ </key>
+ <key
+ commandId="org.jboss.tools.common.jdt.debug.4"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+D 4">
+ </key>
+ <key
+ commandId="org.jboss.tools.common.jdt.debug.5"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+D 5">
+ </key>
+ <key
+ commandId="org.jboss.tools.common.jdt.debug.6"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+D 6">
+ </key>
+ <key
+ commandId="org.jboss.tools.common.jdt.debug.7"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+D 7">
+ </key>
+ <key
+ commandId="org.jboss.tools.common.jdt.debug.8"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+D 8">
+ </key>
+ <key
+ commandId="org.jboss.tools.common.jdt.debug.9"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+D 9">
+ </key>
+ <key
+ commandId="org.jboss.tools.common.jdt.debug.ui.discover"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+D D">
+ </key>
+
+ </extension>
+ -->
+
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.jboss.tools.common.model.ui.MainPreferencePage"
+ class="org.jboss.tools.common.jdt.debug.ui.preferences.RemoteDebugPreferencePage"
+ id="org.jboss.tools.common.jdt.debug.ui.preferences.RemoteDebugPreferencePage"
+ name="Remote Debug"/>
+ </extension>
+
+ <extension point="org.eclipse.debug.ui.launchShortcuts">
+ <shortcut
+ class="org.jboss.tools.common.jdt.debug.ui.launching.RemoteJavaApplicationLaunchShortcut"
+ description="Remote Java Application..."
+ icon="$nl$/icons/jboss.gif"
+ id="org.jboss.tools.common.jdt.debug.ui.remoteJavaApplicationShortcut"
+ label="Remote Java Application..."
+ modes="debug">
+ <contextualLaunch>
+ <enablement>
+ <with variable="selection">
+ <iterate>
+ <adapt type="org.eclipse.jdt.core.IJavaElement">
+ <test property="org.eclipse.jdt.core.isInJavaProject"/>
+ </adapt>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+ <configurationType
+ id="org.eclipse.jdt.launching.remoteJavaApplication">
+ </configurationType>
+ <description
+ description="Remote Java Application..."
+ mode="debug">
+ </description>
+ </shortcut>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ name="Remote Java Application..."
+ description="Remote Java Application..."
+ categoryId="org.eclipse.debug.ui.category.run"
+ id="org.jboss.tools.common.jdt.debug.ui.remoteJavaApplicationShortcut.debug">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ sequence="M3+M2+D D"
+ commandId="org.jboss.tools.common.jdt.debug.ui.remoteJavaApplicationShortcut.debug"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
+ </extension>
+
+</plugin>
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/pom.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/pom.xml (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/pom.xml 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.common</groupId>
+ <artifactId>plugins</artifactId>
+ <version>3.3.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.common.plugins</groupId>
+ <artifactId>org.jboss.tools.common.jdt.debug.ui</artifactId>
+
+ <packaging>eclipse-plugin</packaging>
+</project>
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/Messages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/Messages.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/Messages.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,46 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.common.jdt.debug.ui.messages"; //$NON-NLS-1$
+ public static String RemoteDebugItems_Configure;
+ public static String Discover_Remote_Applications;
+ public static String JavaConnectTab_Add_JDK;
+ public static String JavaConnectTab_Host;
+ public static String JavaConnectTab_Invalid_Host;
+ public static String JavaConnectTab_Invalid_Port;
+ public static String JavaConnectTab_JDK_Required;
+ public static String JavaConnectTab_Port;
+ public static String JavaConnectTab_Refresh;
+ public static String JavaConnectTab_SetAsDefault;
+ public static String JavaConnectTab_Warning;
+ public static String JavaConnectTab__Allow_termination_of_remote_VM_6;
+ public static String JavaConnectTab_Conn_ect_20;
+ public static String JavaConnectTab_Connection_Properties_1;
+ public static String JavaConnectTab_Project_does_not_exist_14;
+
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/RemoteDebugUIActivator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/RemoteDebugUIActivator.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/RemoteDebugUIActivator.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,341 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui;
+
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.model.IPersistableSourceLocator;
+import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
+import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.tools.common.jdt.debug.RemoteDebugActivator;
+import org.jboss.tools.common.jdt.debug.VmModel;
+import org.jboss.tools.common.jdt.debug.ui.preferences.RemoteDebug;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.prefs.BackingStoreException;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class RemoteDebugUIActivator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.common.jdt.debug.ui"; //$NON-NLS-1$
+ public static final String PORT = "port";
+ public static final String DESCRIPTION = "description";
+ public static final String SHOW = "show";
+ public static final int KEYS = 10;
+ public static final String DEFAULT_PORT = "0";
+ public static final String DEFAULT_DESCRIPTION = "";
+ public static final boolean DEFAULT_SHOW = true;
+ public static final String DISCOVER_REMOTE_APPLICATION = "discoverRemoteApplication";
+ public static final boolean DEFAULT_DISCOVER_REMOTE_APPLICATION = true;
+ public static final String COMMAND_PREFIX = "org.jboss.tools.common.jdt.debug.";
+ public static final String CONFIGURE_ACTION_ID = "org.jboss.tools.common.jdt.debug.ui.configure"; //$NON-NLS-1$
+
+ public static final String AUTO_CONNECT = "autoConnect";
+ public static final boolean AUTO_CONNECT_DEFAULT = false;
+
+ private static final String KEY_SEQUENCE_PREFIX = "M1+D ";
+ public static final String DISCOVER_REMOTE_APPLICATION_ACTION_ID = "org.jboss.tools.common.jdt.debug.ui.discover";
+
+ // The shared instance
+ private static RemoteDebugUIActivator plugin;
+ private static VmModel[] vmModels;
+ private static Job discoverRemoteApplicationJob;
+
+ /**
+ * The constructor
+ */
+ public RemoteDebugUIActivator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ vmModels = new VmModel[0];
+ discoverRemoteApplicationJob = new Job(Messages.Discover_Remote_Applications) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ if (monitor.isCanceled()) {
+ return Status.CANCEL_STATUS;
+ }
+ discoverRemoteApplication(monitor);
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ };
+ discoverRemoteApplicationJob.setUser(true);
+ discoverRemoteApplicationJob.setSystem(false);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ vmModels = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static RemoteDebugUIActivator getDefault() {
+ return plugin;
+ }
+
+ public synchronized VmModel[] getDebugModels(IProgressMonitor monitor) {
+ if (isDiscoverRemoteApplication()) {
+ VmModel[] newModels = RemoteDebugActivator.getDefault().getDebugModels(monitor);
+ if (newModels != null) {
+ vmModels = newModels;
+ }
+ }
+ return vmModels;
+ }
+
+ public synchronized VmModel[] getCurrentDebugModels() {
+ return vmModels;
+ }
+
+ public synchronized void discoverRemoteApplication(IProgressMonitor monitor) {
+ VmModel[] newModels = RemoteDebugActivator.getDefault().getDebugModels(monitor);
+ if (newModels != null) {
+ vmModels = newModels;
+ }
+ }
+
+ public Job discoverRemoteApplicationInJob() {
+ Job job = new Job(Messages.Discover_Remote_Applications) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ if (monitor.isCanceled()) {
+ return Status.CANCEL_STATUS;
+ }
+ discoverRemoteApplication(monitor);
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ };
+ job.setUser(true);
+ job.setSystem(false);
+ job.schedule(50);
+ return job;
+ }
+
+ public Job getRemoteApplicationJob() {
+ return discoverRemoteApplicationJob;
+ }
+
+ public static void log(Exception e, String message) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
+ plugin.getLog().log(status);
+ }
+
+ public static void logWarning(String message) {
+ IStatus status = new Status(IStatus.WARNING, PLUGIN_ID, message);
+ plugin.getLog().log(status);
+ }
+
+ public static void log(Throwable e) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, e
+ .getLocalizedMessage(), e);
+ plugin.getLog().log(status);
+ }
+
+ public static String getPortPreferenceName(int i) {
+ return PORT + i;
+ }
+
+ public static String getDescriptionPreferenceName(int i) {
+ return DESCRIPTION + i;
+ }
+
+ public static String getShowPreferenceName(int i) {
+ return SHOW + i;
+ }
+
+ public void savePreferences() {
+ IEclipsePreferences prefs = getPreferences();
+ try {
+ prefs.flush();
+ } catch (BackingStoreException e) {
+ log(e);
+ }
+ }
+
+ public IEclipsePreferences getPreferences() {
+ IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(PLUGIN_ID);
+ return prefs;
+ }
+
+ public RemoteDebug[] getRemoteDebugs() {
+ int keys = RemoteDebugUIActivator.KEYS;
+ RemoteDebug[] remoteDebugs = new RemoteDebug[keys];
+ IEclipsePreferences preferences = getPreferences();
+ for (int i = 0; i < keys; i++) {
+ String description = preferences.get(RemoteDebugUIActivator.getDescriptionPreferenceName(i), RemoteDebugUIActivator.DEFAULT_DESCRIPTION);
+ String port = preferences.get(RemoteDebugUIActivator.getPortPreferenceName(i), RemoteDebugUIActivator.DEFAULT_PORT);
+ boolean show = preferences.getBoolean(RemoteDebugUIActivator.getShowPreferenceName(i), RemoteDebugUIActivator.DEFAULT_SHOW);
+ String key = KEY_SEQUENCE_PREFIX + i;
+ remoteDebugs[i] = new RemoteDebug(i, key, description, port, show);
+ }
+ return remoteDebugs;
+ }
+
+ public List<RemoteDebug> getValidRemoteDebugs() {
+ int keys = RemoteDebugUIActivator.KEYS;
+ List <RemoteDebug> remoteDebugs = new ArrayList<RemoteDebug>();
+ IEclipsePreferences preferences = getPreferences();
+ for (int i = 0; i < keys; i++) {
+ String description = preferences.get(RemoteDebugUIActivator.getDescriptionPreferenceName(i), RemoteDebugUIActivator.DEFAULT_DESCRIPTION);
+ String port = preferences.get(RemoteDebugUIActivator.getPortPreferenceName(i), RemoteDebugUIActivator.DEFAULT_PORT);
+ boolean show = preferences.getBoolean(RemoteDebugUIActivator.getShowPreferenceName(i), RemoteDebugUIActivator.DEFAULT_SHOW);
+ String key = KEY_SEQUENCE_PREFIX + i;
+ RemoteDebug remoteDebug = new RemoteDebug(i, key, description, port, show);
+ if (remoteDebug.isValid()) {
+ remoteDebugs.add(remoteDebug);
+ }
+ }
+ return remoteDebugs;
+ }
+
+ public boolean isAutoConnect() {
+ return getPreferences().getBoolean(AUTO_CONNECT, AUTO_CONNECT_DEFAULT);
+ }
+
+ public void setAutoConnect(boolean autoConnect) {
+ getPreferences().putBoolean(AUTO_CONNECT, autoConnect);
+ }
+
+ public boolean isDiscoverRemoteApplication() {
+ return getPreferences().getBoolean(DISCOVER_REMOTE_APPLICATION, DEFAULT_DISCOVER_REMOTE_APPLICATION);
+ }
+
+ public void setDiscoverRemoteApplication(boolean value) {
+ getPreferences().putBoolean(DISCOVER_REMOTE_APPLICATION, value);
+ }
+
+ public void addSelectedProjects(ILaunchConfigurationWorkingCopy wc, ISelection selection,
+ IJavaProject javaProject) throws CoreException {
+ if (! (selection instanceof ITreeSelection)) {
+ return;
+ }
+ ITreeSelection treeSelection = (ITreeSelection) selection;
+ int size = treeSelection.size();
+ if (size > 1) {
+ ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ ISourceLookupDirector director = addSourceContainers(manager, wc, treeSelection, javaProject);
+ if (director != null) {
+ wc.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, director.getMemento());
+ wc.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, director.getId());
+ }
+ } else {
+ wc.setAttribute(RemoteDebugActivator.ATTR_SELECTED_PROJECTS, (List<String>)null);
+ }
+ }
+
+ private ISourceLookupDirector addSourceContainers(ILaunchManager manager,
+ ILaunchConfigurationWorkingCopy wc, ITreeSelection selection, IJavaProject javaProject) throws CoreException {
+ String memento = null;
+ String locatorId = null;
+ try {
+ memento = wc.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO,(String) null);
+ locatorId = wc.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID,(String) null);
+ if (locatorId == null) {
+ locatorId = wc.getType().getSourceLocatorId();
+ }
+ } catch (CoreException e) {
+ log(e);
+ }
+ IPersistableSourceLocator locator = manager.newSourceLocator(locatorId);
+ if (memento != null) {
+ locator.initializeFromMemento(memento);
+ } else {
+ locator.initializeDefaults(wc);
+ }
+ if (locator instanceof AbstractSourceLookupDirector) {
+ ISourceLookupDirector director = (ISourceLookupDirector) locator;
+ List objects = selection.toList();
+ Set<String> projectNames = new LinkedHashSet<String>();
+ for (Object object:objects) {
+ if (!(object instanceof IJavaElement)
+ && object instanceof IAdaptable) {
+ object = ((IAdaptable) object)
+ .getAdapter(IJavaElement.class);
+ }
+ if ( ! (object instanceof IJavaElement) ) {
+ continue;
+ }
+ IJavaElement javaElement = (IJavaElement) object;
+ IJavaProject project = javaElement.getJavaProject();
+ if (project instanceof IJavaProject && !project.equals(javaProject)) {
+ projectNames.add( ((IJavaProject) project).getElementName());
+ }
+ }
+ List<String> projectsList = new ArrayList<String>();
+ projectsList.addAll(projectNames);
+ wc.setAttribute(RemoteDebugActivator.ATTR_SELECTED_PROJECTS, projectsList);
+ return director;
+ } else {
+ logWarning("Launch configuration doesn't support source lookup");
+ }
+ return null;
+ }
+
+ public static void displayLaunchError(Shell shell, ILaunchConfiguration config, Exception e) {
+ //String configName = config.getName();
+ String title = "Problem Occured";
+ String message = "Opening the configuration dialog has encoutered a problem.\n\n" + e.getLocalizedMessage();
+ MessageDialog.openError(shell, title, message);
+ }
+
+ public static RemoteDebug findRemoteDebug(List<RemoteDebug> remoteDebugs,
+ String port) {
+ for (RemoteDebug remoteDebug:remoteDebugs) {
+ if (port != null && port.equals(remoteDebug.getPort())) {
+ return remoteDebug;
+ }
+ }
+ return null;
+ }
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/DiscoverRemoteApplicationAction.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/DiscoverRemoteApplicationAction.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/DiscoverRemoteApplicationAction.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,27 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui.actions;
+
+import org.eclipse.jface.action.Action;
+import org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class DiscoverRemoteApplicationAction extends Action {
+
+ public void run() {
+ RemoteDebugUIActivator.getDefault().discoverRemoteApplicationInJob();
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/LaunchDialogAction.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/LaunchDialogAction.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/LaunchDialogAction.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,108 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui.actions;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.jdt.debug.RemoteDebugActivator;
+import org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class LaunchDialogAction extends Action {
+
+ public void run() {
+ LaunchConfigurationManager lcManager = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
+ LaunchGroupExtension group = lcManager.getLaunchGroup(RemoteDebugActivator.LAUNCH_CATEGORY);
+ LaunchConfigurationsDialog dialog = new LaunchConfigurationsDialog(getShell(), group);
+ ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType type = manager.getLaunchConfigurationType(RemoteDebugActivator.REMOTE_JAVA_APPLICATION_ID);
+ ILaunchConfiguration config = RemoteDebugActivator.getDefault().getDefaultLaunchConfiguration();
+ ILaunchConfigurationWorkingCopy wc = null;
+ try {
+ if (config == null) {
+ wc = RemoteDebugActivator.createNewLaunchConfiguration(type);
+ } else {
+ wc = config.getWorkingCopy();
+ }
+ } catch (CoreException e) {
+ RemoteDebugUIActivator.log(e);
+ RemoteDebugUIActivator.displayLaunchError(getShell(), config, e);
+ }
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ ISelection currentSelection = page.getSelection();
+ if (currentSelection instanceof ITreeSelection) {
+ ITreeSelection selection = (ITreeSelection) currentSelection;
+ Object object = selection.getFirstElement();
+ if (!(object instanceof IJavaElement)
+ && object instanceof IAdaptable) {
+ object = ((IAdaptable) object)
+ .getAdapter(IJavaElement.class);
+ }
+ if (object instanceof IJavaElement) {
+ IJavaElement javaElement = (IJavaElement) object;
+ IJavaProject javaProject = javaElement.getJavaProject();
+ if (javaProject != null) {
+ try {
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, javaProject.getElementName());
+ RemoteDebugUIActivator.getDefault().addSelectedProjects(wc, selection, javaProject);
+ config = wc.doSave();
+ } catch (CoreException e) {
+ RemoteDebugUIActivator.log(e);
+ RemoteDebugUIActivator.displayLaunchError(getShell(), config, e);
+ }
+ }
+ }
+ }
+ IStructuredSelection selection = new StructuredSelection(config);
+ dialog.setInitialSelection(selection);
+ dialog.setOpenMode(LaunchConfigurationsDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION);
+ dialog.open();
+ }
+
+ private static Shell getShell() {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window == null) {
+ IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
+ if (windows.length > 0) {
+ return windows[0].getShell();
+ }
+ }
+ else {
+ return window.getShell();
+ }
+ return null;
+ }
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteApplicationPropertyTester.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteApplicationPropertyTester.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteApplicationPropertyTester.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,51 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui.actions;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.jboss.tools.common.jdt.debug.RemoteDebugActivator;
+import org.jboss.tools.common.jdt.debug.VmModel;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class RemoteApplicationPropertyTester extends PropertyTester {
+
+ @Override
+ public boolean test(Object receiver, String property, Object[] args,
+ Object expectedValue) {
+ if ("remoteCount".equals(property)) { //$NON-NLS-1$
+ VmModel[] models = RemoteDebugActivator.getDefault().getDebugModels(new NullProgressMonitor());
+ if (expectedValue instanceof Integer) {
+ int value = (Integer) expectedValue;
+ if (models != null) {
+ int count = models.length;
+ return count >= value;
+ }
+ }
+ }
+ if ("remoteExists".equals(property)) { //$NON-NLS-1$
+ if (expectedValue instanceof Boolean) {
+ Boolean value = (Boolean) expectedValue;
+ if (value) {
+ VmModel[] models = RemoteDebugActivator.getDefault().getDebugModels(new NullProgressMonitor());
+ boolean exists = models != null && models.length > 0;
+ return exists;
+ }
+ }
+ }
+ return false;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteDebugItems.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteDebugItems.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteDebugItems.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,120 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui.actions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.actions.CompoundContributionItem;
+import org.jboss.tools.common.jdt.debug.RemoteDebugActivator;
+import org.jboss.tools.common.jdt.debug.VmModel;
+import org.jboss.tools.common.jdt.debug.ui.Messages;
+import org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator;
+import org.jboss.tools.common.jdt.debug.ui.preferences.RemoteDebug;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class RemoteDebugItems extends CompoundContributionItem {
+
+ @Override
+ protected IContributionItem[] getContributionItems() {
+ List<IContributionItem> items = new ArrayList<IContributionItem>();
+ List<RemoteDebug> remoteDebugs = RemoteDebugUIActivator.getDefault()
+ .getValidRemoteDebugs();
+ VmModel[] models = RemoteDebugUIActivator.getDefault().getDebugModels(new NullProgressMonitor());
+ if (models != null) {
+ for (VmModel model : models) {
+ RemoteLaunchAction action = new RemoteLaunchAction(
+ model.getPort());
+ RemoteDebug remoteDebug = RemoteDebugUIActivator.findRemoteDebug(remoteDebugs,
+ model.getPort());
+ if (remoteDebug != null) {
+ String id = RemoteDebugUIActivator.COMMAND_PREFIX
+ + remoteDebug.getId();
+ action.setActionDefinitionId(id);
+ if (remoteDebug.isShow()) {
+ StringBuffer buffer = new StringBuffer();
+ if (remoteDebug.getDescription() != null
+ && !remoteDebug.getDescription().isEmpty()) {
+ if (buffer.length() > 0) {
+ buffer.append(","); //$NON-NLS-1$
+ }
+ buffer.append(remoteDebug.getDescription());
+ }
+ String text = model.getMainClass();
+ if (text != null
+ && !RemoteDebugActivator.UNKNOWN.equals(text)) {
+ if (buffer.length() > 0) {
+ buffer.append(",main="); //$NON-NLS-1$
+ }
+ buffer.append(text);
+ }
+ String pid = model.getPid();
+ if (pid != null) {
+ if (buffer.length() > 0) {
+ buffer.append(",pid="); //$NON-NLS-1$
+ }
+ buffer.append(pid);
+ }
+ String port = model.getPort();
+ if (port != null) {
+ if (buffer.length() > 0) {
+ buffer.append(",port="); //$NON-NLS-1$
+ }
+ buffer.append(port);
+ }
+ action.setText(buffer.toString());
+ } else {
+ action.setText(model.getDisplayName());
+ }
+ } else {
+ action.setText(model.getDisplayName());
+ }
+ ActionContributionItem item = new ActionContributionItem(
+ action);
+ items.add(item);
+ }
+
+ }
+ if (items.size() > 0) {
+ items.add(new Separator());
+ }
+ if (!RemoteDebugUIActivator.getDefault().isDiscoverRemoteApplication()) {
+ IAction action = new DiscoverRemoteApplicationAction();
+ String id = RemoteDebugUIActivator.DISCOVER_REMOTE_APPLICATION_ACTION_ID;
+ action.setActionDefinitionId(id);
+ action.setText(Messages.Discover_Remote_Applications);
+ ActionContributionItem item = new ActionContributionItem(action);
+ items.add(item);
+ }
+ IAction action = new LaunchDialogAction();
+ String id = RemoteDebugUIActivator.CONFIGURE_ACTION_ID;
+ action.setActionDefinitionId(id);
+ action.setText(Messages.RemoteDebugItems_Configure);
+ ActionContributionItem item = new ActionContributionItem(action);
+ items.add(item);
+ if (items.size() > 0) {
+ return items.toArray(new IContributionItem[0]);
+ }
+ return null;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteLaunchAction.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteLaunchAction.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/actions/RemoteLaunchAction.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,193 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui.actions;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.ITypeRoot;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
+import org.eclipse.jdt.internal.debug.ui.launcher.LauncherMessages;
+import org.eclipse.jdt.internal.launching.JavaMigrationDelegate;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IEditorPart;
+import org.jboss.tools.common.jdt.debug.RemoteDebugActivator;
+import org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class RemoteLaunchAction extends Action {
+
+ private String port;
+
+ public RemoteLaunchAction(String port) {
+ this.port = port;
+ }
+
+ /**
+ * Runs with either the active editor or workbench selection.
+ *
+ * @see IAction#run()
+ */
+ public void run() {
+ IStructuredSelection ss = SelectedResourceManager.getDefault().getCurrentSelection();
+ Object o = ss.getFirstElement();
+ if(o instanceof IEditorPart) {
+ launch((IEditorPart) o);
+ }
+ else {
+ launch(ss);
+ }
+ }
+
+ private void launch(ISelection selection) {
+ IResource resource = getLaunchableResource(selection);
+ IJavaProject javaProject = null;
+ if (resource != null) {
+ IProject project = resource.getProject();
+ javaProject = JavaCore.create(project);
+ }
+ ILaunchConfiguration config = createOrGetDefaultLaunchConfiguration(javaProject, selection);
+ DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
+ }
+
+ private void launch(IEditorPart editor) {
+ IResource resource = getLaunchableResource(editor);
+ IJavaProject javaProject = null;
+ if (resource != null) {
+ IProject project = resource.getProject();
+ javaProject = JavaCore.create(project);
+ }
+ ILaunchConfiguration config = createOrGetDefaultLaunchConfiguration(javaProject, null);
+ DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
+ */
+ public void runWithEvent(Event event) {
+ run();
+ }
+
+ private IResource getLaunchableResource(ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ if (ss.size() == 1) {
+ Object selected = ss.getFirstElement();
+ if (!(selected instanceof IJavaElement)
+ && selected instanceof IAdaptable) {
+ selected = ((IAdaptable) selected)
+ .getAdapter(IJavaElement.class);
+ }
+ if (selected instanceof IJavaElement) {
+ return ((IJavaElement) selected).getResource();
+ }
+ }
+ }
+ return null;
+ }
+
+ private IResource getLaunchableResource(IEditorPart editorpart) {
+ ITypeRoot element = JavaUI.getEditorInputTypeRoot(editorpart
+ .getEditorInput());
+ if (element != null) {
+ try {
+ return element.getCorrespondingResource();
+ } catch (JavaModelException e) {
+ }
+ }
+ return null;
+ }
+
+ protected ILaunchConfiguration createOrGetDefaultLaunchConfiguration(IJavaProject javaProject, ISelection selection) {
+ ILaunchConfiguration config = RemoteDebugActivator.getDefault().getDefaultLaunchConfiguration();
+ ILaunchConfigurationWorkingCopy wc = null;
+ try {
+ if (config != null) {
+ wc = config.getWorkingCopy();
+ setAttribute(wc);
+ wc.doSave();
+ } else {
+ ILaunchConfigurationType configType = getConfigurationType();
+ wc = RemoteDebugActivator.createNewLaunchConfiguration(configType);
+ }
+ if (javaProject != null && javaProject.isOpen()) {
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, javaProject.getElementName());
+
+ try {
+ JavaMigrationDelegate.updateResourceMapping(wc);
+ } catch (CoreException ce) {
+ RemoteDebugActivator.log(ce);
+ }
+ }
+ setAttribute(wc);
+ if (selection != null) {
+ RemoteDebugUIActivator.getDefault().addSelectedProjects(wc, selection, javaProject);
+ }
+ config = wc.doSave();
+ } catch (CoreException exception) {
+ MessageDialog.openError(JDIDebugUIPlugin.getActiveWorkbenchShell(),
+ LauncherMessages.JavaLaunchShortcut_3, exception
+ .getStatus().getMessage());
+ }
+ return config;
+ }
+
+ private void setAttribute(ILaunchConfigurationWorkingCopy wc) {
+ Map attrMap = new HashMap(2);
+ attrMap.put("hostname", RemoteDebugActivator.LOCALHOST); //$NON-NLS-1$
+ if (port != null) {
+ attrMap.put("port", port); //$NON-NLS-1$
+ } else {
+ attrMap.put("port", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CONNECT_MAP,
+ attrMap);
+ }
+
+ private ILaunchManager getLaunchManager() {
+ return DebugPlugin.getDefault().getLaunchManager();
+ }
+
+ private ILaunchConfigurationType getConfigurationType() {
+ ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType type = manager
+ .getLaunchConfigurationType(RemoteDebugActivator.REMOTE_JAVA_APPLICATION_ID);
+ return type;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/handlers/DiscoverRemoteApplicationHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/handlers/DiscoverRemoteApplicationHandler.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/handlers/DiscoverRemoteApplicationHandler.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,33 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class DiscoverRemoteApplicationHandler extends AbstractHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ if (!RemoteDebugUIActivator.getDefault().isDiscoverRemoteApplication()) {
+ RemoteDebugUIActivator.getDefault().discoverRemoteApplicationInJob();
+ }
+ return null;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/handlers/RemoteDebugHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/handlers/RemoteDebugHandler.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/handlers/RemoteDebugHandler.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,52 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.widgets.Display;
+import org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator;
+import org.jboss.tools.common.jdt.debug.ui.actions.RemoteLaunchAction;
+import org.jboss.tools.common.jdt.debug.ui.preferences.RemoteDebug;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class RemoteDebugHandler extends AbstractHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ Command command = event.getCommand();
+ String id = command.getId();
+ String[] segments = id.split("\\.");
+ String keyStr = segments[segments.length-1];
+ int key = new Integer(keyStr);
+ RemoteDebug remoteDebug = RemoteDebugUIActivator.getDefault().getRemoteDebugs()[key];
+ if (remoteDebug.isValid()) {
+ final Action action = new RemoteLaunchAction(remoteDebug.getPort());
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ action.run();
+ }
+ });
+
+ }
+ return null;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/JBossConnectTab.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/JBossConnectTab.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/JBossConnectTab.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,180 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui.launching;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.internal.ui.SWTFactory;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.jboss.tools.common.jdt.debug.RemoteDebugActivator;
+import org.jboss.tools.common.jdt.debug.ui.Messages;
+import org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class JBossConnectTab extends AbstractLaunchConfigurationTab {
+
+ private Group messageGroup;
+ private Button jbossConfigurationButton;
+ private Image image;
+
+ public JBossConnectTab() {
+ super();
+ image = RemoteDebugUIActivator.imageDescriptorFromPlugin(RemoteDebugUIActivator.PLUGIN_ID, "/icons/jboss.gif").createImage();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ Font font = parent.getFont();
+ Composite comp = SWTFactory.createComposite(parent, font, 1, 1, GridData.FILL_BOTH);
+ GridLayout layout = new GridLayout();
+ layout.verticalSpacing = 0;
+ comp.setLayout(layout);
+
+ createVerticalSpacer(comp, 2);
+ jbossConfigurationButton = createCheckButton(comp, "JBoss Remote Configuration");
+ jbossConfigurationButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setDirty(true);
+ updateLaunchConfigurationDialog();
+ }
+
+ });
+ createVerticalSpacer(comp, 2);
+ messageGroup = new Group(comp, SWT.NONE);
+ messageGroup.setText(Messages.JavaConnectTab_Warning);
+ messageGroup.setLayout(new GridLayout(3, false));
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ messageGroup.setLayoutData(gd);
+
+ Label noteLabel = new Label(messageGroup,SWT.NONE);
+ gd=new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false);
+ noteLabel.setLayoutData(gd);
+ Image image = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
+ image.setBackground(noteLabel.getBackground());
+ noteLabel.setImage(image);
+
+ Text noteText = new Text(messageGroup, SWT.WRAP | SWT.READ_ONLY);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ GC gc = new GC(parent);
+ gd.heightHint = Dialog.convertHeightInCharsToPixels(gc
+ .getFontMetrics(), 3);
+ gc.dispose();
+ noteText.setLayoutData(gd);
+ noteText.setText(Messages.JavaConnectTab_JDK_Required);
+
+ messageGroup.setVisible(!RemoteDebugActivator.getDefault().isJdk());
+
+ Button addJDK = new Button(messageGroup, SWT.PUSH);
+ addJDK.setText(Messages.JavaConnectTab_Add_JDK);
+ gd=new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
+ addJDK.setLayoutData(gd);
+ addJDK.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ String preferenceId = "org.eclipse.jdt.debug.ui.preferences.VMPreferencePage"; //$NON-NLS-1$
+ PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(),preferenceId, null, null);
+ dialog.open();
+ updateLaunchConfigurationDialog();
+ messageGroup.setVisible(!RemoteDebugActivator.getDefault().isJdk());
+ }
+ });
+
+ setControl(comp);
+ }
+
+ private void updateMarkAsJBossFromConfig(ILaunchConfiguration config) {
+ boolean markAsJBoss = false;
+ try {
+ markAsJBoss = config.getAttribute(RemoteDebugActivator.JBOSS_REMOTE_JAVA_APPLICATION, false);
+ }
+ catch (CoreException ce) {RemoteDebugUIActivator.log(ce);}
+ jbossConfigurationButton.setSelection(markAsJBoss);
+ }
+
+ public void performApply(ILaunchConfigurationWorkingCopy config) {
+ config.setAttribute(RemoteDebugActivator.JBOSS_REMOTE_JAVA_APPLICATION, jbossConfigurationButton.getSelection());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
+ public void setDefaults(ILaunchConfigurationWorkingCopy config) {
+ config.setAttribute(RemoteDebugActivator.JBOSS_REMOTE_JAVA_APPLICATION, false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ public boolean isValid(ILaunchConfiguration config) {
+ setErrorMessage(null);
+ setMessage(null);
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
+ */
+ public String getName() {
+ return "JBoss Preferences";
+ }
+
+ /**
+ * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
+ *
+ * @since 3.3
+ */
+ public String getId() {
+ return "org.jboss.tools.common.jdt.debug.ui.launching.launchConfigurationTabGroup.JBossRemoteJavaApplication2"; //$NON-NLS-1$
+ }
+
+ @Override
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ updateMarkAsJBossFromConfig(configuration);
+ }
+
+ @Override
+ public Image getImage() {
+ return image;
+ }
+
+ @Override
+ public void dispose() {
+ image.dispose();
+ super.dispose();
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/JBossRemoteJavaApplicationTabGroup.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/JBossRemoteJavaApplicationTabGroup.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/JBossRemoteJavaApplicationTabGroup.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,38 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui.launching;
+
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
+import org.jboss.tools.common.jdt.debug.ui.launching.xpl.JavaConnectTab;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class JBossRemoteJavaApplicationTabGroup extends AbstractLaunchConfigurationTabGroup {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
+ */
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
+ new JavaConnectTab(),
+ new SourceLookupTab(),
+ new CommonTab(),
+ };
+ setTabs(tabs);
+ }
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/JBossRemoteJavaApplicationTabGroup2.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/JBossRemoteJavaApplicationTabGroup2.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/JBossRemoteJavaApplicationTabGroup2.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,39 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui.launching;
+
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaConnectTab;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class JBossRemoteJavaApplicationTabGroup2 extends AbstractLaunchConfigurationTabGroup {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
+ */
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
+ new JavaConnectTab(),
+ new SourceLookupTab(),
+ new CommonTab(),
+ new JBossConnectTab(),
+ };
+ setTabs(tabs);
+ }
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/LaunchRemoteApplicationDialog.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/LaunchRemoteApplicationDialog.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/LaunchRemoteApplicationDialog.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,306 @@
+package org.jboss.tools.common.jdt.debug.ui.launching;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ColumnLayoutData;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.jboss.tools.common.jdt.debug.RemoteDebugActivator;
+import org.jboss.tools.common.jdt.debug.VmModel;
+import org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator;
+import org.jboss.tools.common.jdt.debug.ui.actions.LaunchDialogAction;
+import org.jboss.tools.common.jdt.debug.ui.actions.RemoteLaunchAction;
+import org.jboss.tools.common.jdt.debug.ui.preferences.AutoResizeTableLayout;
+
+/**
+ * @author snjeza
+ *
+ */
+public class LaunchRemoteApplicationDialog extends Dialog {
+
+ private VmModel[] vmModels;
+ private TableViewer viewer;
+ private Combo configurationsCombo;
+
+ public LaunchRemoteApplicationDialog(Shell parentShell) {
+ super(parentShell);
+ setShellStyle(SWT.CLOSE | SWT.MAX | SWT.TITLE | SWT.BORDER
+ | SWT.RESIZE | getDefaultOrientation());
+ vmModels = RemoteDebugUIActivator.getDefault().getCurrentDebugModels();
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ getShell().setText("Remote Java Application");
+ Composite area = (Composite) super.createDialogArea(parent);
+ Composite contents = new Composite(area, SWT.NONE);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 400;
+ gd.widthHint = 600;
+ contents.setLayoutData(gd);
+ contents.setLayout(new GridLayout(1, false));
+ applyDialogFont(contents);
+ initializeDialogUnits(area);
+
+ Composite messageComposite = new Composite(contents, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ messageComposite.setLayoutData(gd);
+ messageComposite.setLayout(new GridLayout(1, false));
+ Label pathLabel = new Label(messageComposite, SWT.NONE);
+ pathLabel.setText("Found " + vmModels.length + " Remote Java Application's. Please select which application you want to connect the debugger to.");
+
+ viewer = new TableViewer(contents, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL
+ | SWT.V_SCROLL | SWT.BORDER);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 250;
+ viewer.getTable().setLayoutData(gd);
+
+ final Table table = viewer.getTable();
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ table.setFont(parent.getFont());
+ table.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ int selection = table.getSelectionIndex();
+ Button okButton = getButton(IDialogConstants.OK_ID);
+ if (selection < 0 || selection >= vmModels.length) {
+ okButton.setEnabled(false);
+ } else {
+ okButton.setEnabled(true);
+ }
+ }
+
+ });
+
+ viewer.setContentProvider(new RemoteApplicationContentProvider());
+
+ String[] columnHeaders = {"PID", "Port", "Class", "Arguments"};
+
+ for (int i = 0; i < columnHeaders.length; i++) {
+ TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
+ column.setLabelProvider(new RemoteApplicationLabelProvider(i));
+ column.getColumn().setText(columnHeaders[i]);
+ column.getColumn().setResizable(true);
+ column.getColumn().setMoveable(true);
+ }
+
+ ColumnLayoutData[] remoteApplicationLayouts= {
+ new ColumnWeightData(80,80),
+ new ColumnWeightData(80,80),
+ new ColumnWeightData(200,200),
+ new ColumnWeightData(200,200),
+ };
+
+ TableLayout tableLayout = new AutoResizeTableLayout(table);
+ for (int i = 0; i < remoteApplicationLayouts.length; i++) {
+ tableLayout.addColumnData(remoteApplicationLayouts[i]);
+ }
+
+ viewer.getTable().setLayout(tableLayout);
+
+ viewer.setInput(vmModels);
+
+ viewer.getTable().select(0);
+
+ Composite configurationComposite = new Composite(contents, SWT.NONE);
+ configurationComposite.setLayout(new GridLayout(2, false));
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ configurationComposite.setLayoutData(gd);
+
+ Label configurationLabel = new Label(configurationComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, false, false);
+ configurationLabel.setLayoutData(gd);
+ configurationLabel.setText("Configurations:");
+ configurationsCombo = new Combo(configurationComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ configurationsCombo.setLayoutData(gd);
+ configureCombo();
+
+ final Button autoButton = new Button(contents, SWT.CHECK);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ messageComposite.setLayoutData(gd);
+ autoButton.setText("Automatically connect if only one application found");
+ autoButton.setSelection(RemoteDebugUIActivator.getDefault().isAutoConnect());
+ autoButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ RemoteDebugUIActivator.getDefault().setAutoConnect(autoButton.getSelection());
+ }
+
+ });
+
+ return area;
+ }
+
+ private void configureCombo() {
+ String[] configurations = getConfigurations();
+ configurationsCombo.setItems(configurations);
+ configurationsCombo.select(getDefaultConfigurationIndex(configurations));
+ }
+
+ private int getDefaultConfigurationIndex(String[] configurations) {
+ if (configurations.length == 0) {
+ return 0;
+ }
+ ILaunchConfiguration defaultConfiguration = RemoteDebugActivator.getDefault().getDefaultLaunchConfiguration();
+ if (defaultConfiguration == null) {
+ return 0;
+ }
+ for (int i = 0; i < configurations.length; i++) {
+ String name = configurations[i];
+ if (name.equals(defaultConfiguration.getName())) {
+ return i;
+ }
+ }
+ return 0;
+ }
+
+ private String[] getConfigurations() {
+ ILaunchConfiguration[] configs = RemoteDebugActivator.getDefault().getLaunchConfigurations();
+ if (configs == null || configs.length == 0) {
+ try {
+ ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType type = manager.getLaunchConfigurationType(RemoteDebugActivator.REMOTE_JAVA_APPLICATION_ID);
+ ILaunchConfigurationWorkingCopy config = RemoteDebugActivator.createNewLaunchConfiguration(type);
+ return new String[] { config.getName() };
+ } catch (CoreException e) {
+ RemoteDebugUIActivator.log(e);
+ return new String[0];
+ }
+ }
+ String[] configNames = new String[configs.length];
+ for (int i = 0; i < configs.length; i++) {
+ configNames[i] = configs[i].getName();
+ }
+ return configNames;
+ }
+
+ class RemoteApplicationContentProvider implements IStructuredContentProvider {
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ return vmModels;
+ }
+
+ @Override
+ public void dispose() {
+
+ }
+
+ }
+
+ class RemoteApplicationLabelProvider extends ColumnLabelProvider {
+
+ private int columnIndex;
+
+ public RemoteApplicationLabelProvider(int i) {
+ this.columnIndex = i;
+ }
+
+ public String getText(Object element) {
+ if (element instanceof VmModel) {
+ VmModel model = (VmModel) element;
+ switch (columnIndex) {
+ case 0:
+ return model.getPid();
+ case 1:
+ return model.getPort();
+ case 2:
+ return model.getMainClass();
+ case 3:
+ return model.getMainArgs();
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ return null;
+ }
+ }
+
+ @Override
+ protected void createButtonsForButtonBar(Composite parent) {
+ createButton(parent, IDialogConstants.YES_ID, "Configure...", false);
+ super.createButtonsForButtonBar(parent);
+ Button okButton = getButton(IDialogConstants.OK_ID);
+ okButton.setText("Debug");
+ }
+
+ @Override
+ protected void okPressed() {
+ VmModel vmModel = vmModels[viewer.getTable().getSelectionIndex()];
+ String configurationName = configurationsCombo.getText();
+ ILaunchConfiguration[] configurations = RemoteDebugActivator.getDefault().getLaunchConfigurations();
+ ILaunchConfiguration selectedConfiguration = null;
+ for (ILaunchConfiguration configuration:configurations) {
+ if (configurationName.equals(configuration.getName())) {
+ selectedConfiguration = configuration;
+ } else {
+ setDefault(configuration, false);
+ }
+ }
+ if (selectedConfiguration != null) {
+ setDefault(selectedConfiguration, true);
+ }
+ super.okPressed();
+ new RemoteLaunchAction(vmModel.getPort()).run();
+ }
+
+ private void setDefault(ILaunchConfiguration configuration, boolean value) {
+ try {
+ boolean isDefault = configuration.getAttribute(RemoteDebugActivator.SET_AS_DEFAULT, false);
+ if (isDefault != value) {
+ ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
+ wc.setAttribute(RemoteDebugActivator.SET_AS_DEFAULT, value);
+ wc.doSave();
+ }
+ } catch (CoreException e) {
+ RemoteDebugUIActivator.log(e);
+ }
+ }
+
+ @Override
+ protected void buttonPressed(int buttonId) {
+ if (buttonId == IDialogConstants.YES_ID) {
+ new LaunchDialogAction().run();
+ configureCombo();
+ } else {
+ super.buttonPressed(buttonId);
+ }
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/RemoteJavaApplicationLaunchShortcut.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/RemoteJavaApplicationLaunchShortcut.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/RemoteJavaApplicationLaunchShortcut.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,217 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui.launching;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.IJobChangeListener;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.ui.ILaunchShortcut2;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.ITypeRoot;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.jdt.debug.VmModel;
+import org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator;
+import org.jboss.tools.common.jdt.debug.ui.actions.RemoteLaunchAction;
+
+/**
+ *
+ * @author snjeza
+ *
+ */
+public class RemoteJavaApplicationLaunchShortcut implements ILaunchShortcut2 {
+
+ private int retValue;
+ private boolean restarted;
+
+ /* (non-Javadoc)
+ * @see ILaunchShortcut#launch(ISelection, String)
+ */
+ public void launch(ISelection selection, final String mode) {
+ executeAction(getLaunchableResource(selection));
+ }
+
+ private void executeAction(final IResource resource) {
+ final boolean oldDiscover = RemoteDebugUIActivator.getDefault().isDiscoverRemoteApplication();
+ final IEclipsePreferences preferences = RemoteDebugUIActivator.getDefault().getPreferences();
+ preferences.putBoolean(RemoteDebugUIActivator.DISCOVER_REMOTE_APPLICATION, true);
+
+ final Job job = RemoteDebugUIActivator.getDefault().getRemoteApplicationJob();
+ while (job.getState() != Job.NONE) {
+ restarted = true;
+ MessageDialog dialog = new MessageDialog(getShell(),
+ "Remote Java Application scan already in progress",
+ null,
+ "Remote Java Application scan already in progress.\nPlease wait for it to be complete.",
+ MessageDialog.QUESTION, new String[] {"OK", "Try again"}, 0);
+ retValue = dialog.open();
+ if (retValue == 0) {
+ restarted = false;
+ return;
+ }
+ }
+ restarted = false;
+ job.addJobChangeListener(new IJobChangeListener() {
+
+ @Override
+ public void sleeping(IJobChangeEvent event) {
+ }
+
+ @Override
+ public void scheduled(IJobChangeEvent event) {
+
+ }
+
+ @Override
+ public void running(IJobChangeEvent event) {
+
+ }
+
+ @Override
+ public void done(IJobChangeEvent event) {
+ preferences.putBoolean(RemoteDebugUIActivator.DISCOVER_REMOTE_APPLICATION, oldDiscover);
+ job.removeJobChangeListener(this);
+ if (restarted) {
+ final Display display = Display.getDefault();
+ while (restarted) {
+ display.syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ });
+ }
+ if (retValue != 0) {
+ return;
+ }
+ }
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ showDialog(resource);
+ }
+
+ });
+ }
+
+ @Override
+ public void awake(IJobChangeEvent event) {
+
+ }
+
+ @Override
+ public void aboutToRun(IJobChangeEvent event) {
+
+ }
+ });
+ job.schedule();
+ }
+
+ /* (non-Javadoc)
+ * @see ILaunchShortcut#launch(IEditorPart, String)
+ */
+ public void launch(IEditorPart editor, String mode) {
+ executeAction(getLaunchableResource(editor));
+ }
+
+ public ILaunchConfiguration[] getLaunchConfigurations(ISelection selection) {
+ return new ILaunchConfiguration[0];
+ }
+
+ /* (non-Javadoc)
+ * @see ILaunchShortcut2#getLaunchConfigurations(IEditorPart)
+ */
+ public ILaunchConfiguration[] getLaunchConfigurations(IEditorPart editor) {
+ return new ILaunchConfiguration[0];
+ }
+
+ public IResource getLaunchableResource(ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ if (ss.size() == 1) {
+ Object selected = ss.getFirstElement();
+ if (!(selected instanceof IJavaElement)
+ && selected instanceof IAdaptable) {
+ selected = ((IAdaptable) selected)
+ .getAdapter(IJavaElement.class);
+ }
+ if (selected instanceof IJavaElement) {
+ return ((IJavaElement) selected).getResource();
+ }
+ }
+ }
+ return null;
+ }
+
+ public IResource getLaunchableResource(IEditorPart editor) {
+ ITypeRoot element = JavaUI.getEditorInputTypeRoot(editor
+ .getEditorInput());
+ if (element != null) {
+ try {
+ return element.getCorrespondingResource();
+ } catch (JavaModelException e) {
+ }
+ }
+ return null;
+ }
+
+ private void showDialog(IResource resource) {
+ VmModel[] vmModels = RemoteDebugUIActivator.getDefault().getCurrentDebugModels();
+ if (vmModels == null || vmModels.length == 0) {
+ boolean question = MessageDialog.openQuestion(getShell(),
+ "No remote Java ApplicationFound",
+ "Sorry, could not detect any running remote java applications.\nTry search again?");
+ if (question) {
+ executeAction(resource);
+ }
+ } else {
+ boolean autoConnect = RemoteDebugUIActivator.getDefault().isAutoConnect();
+ if (autoConnect && vmModels.length == 1) {
+ new RemoteLaunchAction(vmModels[0].getPort()).run();
+ } else {
+ Dialog dialog = new LaunchRemoteApplicationDialog(getShell());
+ dialog.open();
+ }
+ }
+ }
+
+ private static Shell getShell() {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window == null) {
+ IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
+ if (windows.length > 0) {
+ return windows[0].getShell();
+ }
+ }
+ else {
+ return window.getShell();
+ }
+ return null;
+ }
+
+}
\ No newline at end of file
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/xpl/JavaConnectTab.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/xpl/JavaConnectTab.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/launching/xpl/JavaConnectTab.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,557 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * JBoss by Red Hat
+ *******************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui.launching.xpl;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.IJobChangeListener;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.SWTFactory;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.debug.ui.IJavaDebugHelpContextIds;
+import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
+import org.eclipse.jdt.internal.debug.ui.launcher.AbstractJavaMainTab;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.launching.IVMConnector;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.jboss.tools.common.jdt.debug.RemoteDebugActivator;
+import org.jboss.tools.common.jdt.debug.VmModel;
+import org.jboss.tools.common.jdt.debug.ui.Messages;
+import org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator;
+import org.jboss.tools.common.jdt.debug.ui.preferences.RemoteDebug;
+
+/**
+ * A launch configuration tab that displays and edits the project associated
+ * with a remote connection and the connector used to connect to a remote
+ * VM.
+ * <p>
+ * This class may be instantiated.
+ * </p>
+ * @since 2.0
+ * @noextend This class is not intended to be subclassed by clients.
+ */
+public class JavaConnectTab extends AbstractJavaMainTab {
+
+ private static final String HOST_NAMES = "hostNames"; //$NON-NLS-1$
+ private static final String DEFAULT_HOST = "defaultHost"; //$NON-NLS-1$
+
+ // UI widgets
+ private Button fAllowTerminateButton;
+ private Composite fArgumentComposite;
+ private IVMConnector fConnector;
+ private Combo hostCombo;
+ private Combo portCombo;
+ private String[] items;
+ private VmModel[] models;
+ private Button defaultButton;
+ private Group messageGroup;
+
+ private void updateConnector() {
+ getSelectedConnector();
+ IDialogSettings dialogSettings = RemoteDebugUIActivator.getDefault().getDialogSettings();
+ String names = dialogSettings.get(HOST_NAMES);
+ String[] hostNames;
+ if (names == null) {
+ names = RemoteDebugActivator.LOCALHOST;
+ dialogSettings.put(HOST_NAMES, names);
+ hostNames = new String[] {names};
+ } else {
+ StringTokenizer tokenizer = new StringTokenizer(names, ","); //$NON-NLS-1$
+ Set<String> hostSets = new HashSet<String>();
+ hostSets.add(RemoteDebugActivator.LOCALHOST);
+ while (tokenizer.hasMoreTokens()) {
+ hostSets.add(tokenizer.nextToken());
+ }
+ hostNames = hostSets.toArray(new String[0]);
+ }
+ // create editors
+ // host
+ Composite hostComposite = new Composite(fArgumentComposite, SWT.NONE);
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.horizontalSpan = 2;
+ hostComposite.setLayoutData(gd);
+ hostComposite.setLayout(new GridLayout(2, false));
+ Label hostLabel = new Label(hostComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, false, false);
+ hostLabel.setLayoutData(gd);
+ hostLabel.setText(Messages.JavaConnectTab_Host);
+ // FIXME
+ hostCombo = new Combo(hostComposite, SWT.READ_ONLY);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ hostCombo.setLayoutData(gd);
+ hostCombo.setItems(hostNames);
+ String defaultHost = dialogSettings.get(DEFAULT_HOST);
+ if (defaultHost == null) {
+ defaultHost = RemoteDebugActivator.LOCALHOST;
+ dialogSettings.put(DEFAULT_HOST, defaultHost);
+ }
+ hostCombo.setText(defaultHost);
+
+ hostCombo.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateLaunchConfigurationDialog();
+ }
+
+ });
+
+ // port
+
+ Composite portComposite = new Composite(fArgumentComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.horizontalSpan = 2;
+ portComposite.setLayoutData(gd);
+ portComposite.setLayout(new GridLayout(3, false));
+ Label portLabel = new Label(portComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, false, false);
+ portLabel.setLayoutData(gd);
+ portLabel.setText(Messages.JavaConnectTab_Port);
+ // FIXME
+ portCombo = new Combo(portComposite, SWT.READ_ONLY);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ portCombo.setLayoutData(gd);
+ refresh(defaultHost, false);
+
+ portCombo.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateLaunchConfigurationDialog();
+ }
+
+ });
+
+ Button refreshButton = new Button(portComposite, SWT.PUSH);
+ gd = new GridData(SWT.FILL, SWT.FILL, false, false);
+ refreshButton.setLayoutData(gd);
+ refreshButton.setText(Messages.JavaConnectTab_Refresh);
+ refreshButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ refresh(hostCombo.getText(), true);
+ updateLaunchConfigurationDialog();
+ }
+
+ });
+ updateLaunchConfigurationDialog();
+ }
+
+ private void refresh(String defaultHost, boolean discover) {
+ if (!discover) {
+ boolean oldDiscoverPreferences = RemoteDebugUIActivator.getDefault().isDiscoverRemoteApplication();
+ RemoteDebugUIActivator.getDefault().getPreferences().putBoolean(RemoteDebugUIActivator.DISCOVER_REMOTE_APPLICATION, false);
+ models = RemoteDebugUIActivator.getDefault().getDebugModels(new NullProgressMonitor());
+ RemoteDebugUIActivator.getDefault().getPreferences().putBoolean(RemoteDebugUIActivator.DISCOVER_REMOTE_APPLICATION, oldDiscoverPreferences);
+ } else {
+ RemoteDebugUIActivator.getDefault()
+ .discoverRemoteApplication(new NullProgressMonitor());
+ models = RemoteDebugUIActivator.getDefault().getDebugModels(new NullProgressMonitor());
+ }
+ refreshCombo();
+ }
+
+ private void refreshCombo() {
+ items = new String[models.length];
+ int i = 0;
+ for (VmModel model:models) {
+ List<RemoteDebug> remoteDebugs = RemoteDebugUIActivator.getDefault()
+ .getValidRemoteDebugs();
+ RemoteDebug remoteDebug = RemoteDebugUIActivator.findRemoteDebug(remoteDebugs,
+ model.getPort());
+ String displayText;
+ if (remoteDebug != null) {
+ if (remoteDebug.isShow()) {
+ StringBuffer buffer = new StringBuffer();
+ if (remoteDebug.getDescription() != null
+ && !remoteDebug.getDescription().isEmpty()) {
+ if (buffer.length() > 0) {
+ buffer.append(","); //$NON-NLS-1$
+ }
+ buffer.append(remoteDebug.getDescription());
+ }
+ String text = model.getMainClass();
+ if (text != null
+ && !RemoteDebugActivator.UNKNOWN.equals(text)) {
+ if (buffer.length() > 0) {
+ buffer.append(",main="); //$NON-NLS-1$
+ }
+ buffer.append(text);
+ }
+ String pid = model.getPid();
+ if (pid != null) {
+ if (buffer.length() > 0) {
+ buffer.append(",pid="); //$NON-NLS-1$
+ }
+ buffer.append(pid);
+ }
+ String port = model.getPort();
+ if (port != null) {
+ if (buffer.length() > 0) {
+ buffer.append(",port="); //$NON-NLS-1$
+ }
+ buffer.append(port);
+ }
+ displayText = buffer.toString();
+ } else {
+ displayText = model.getDisplayName();
+ }
+ } else {
+ displayText = model.getDisplayName();
+ }
+ items[i++] = displayText;
+ }
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ portCombo.setItems(items);
+ if (items.length > 0) {
+ portCombo.select(0);
+ portCombo.setText(items[0]);
+ }
+ }
+ });
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ Font font = parent.getFont();
+ Composite comp = SWTFactory.createComposite(parent, font, 1, 1, GridData.FILL_BOTH);
+ GridLayout layout = new GridLayout();
+ layout.verticalSpacing = 0;
+ comp.setLayout(layout);
+ createProjectEditor(comp);
+ createVerticalSpacer(comp, 1);
+
+ //connection properties
+ Group group = SWTFactory.createGroup(comp, Messages.JavaConnectTab_Connection_Properties_1, 2, 1, GridData.FILL_HORIZONTAL);
+ Composite cgroup = SWTFactory.createComposite(group, font, 2, 1, GridData.FILL_HORIZONTAL);
+ fArgumentComposite = cgroup;
+ updateConnector();
+
+ createVerticalSpacer(comp, 2);
+ fAllowTerminateButton = createCheckButton(comp, Messages.JavaConnectTab__Allow_termination_of_remote_VM_6);
+ fAllowTerminateButton.addSelectionListener(getDefaultListener());
+
+ createVerticalSpacer(comp, 2);
+ defaultButton = createCheckButton(comp, Messages.JavaConnectTab_SetAsDefault);
+ defaultButton.addSelectionListener(getDefaultListener());
+
+ createVerticalSpacer(comp, 2);
+ messageGroup = new Group(comp, SWT.NONE);
+ messageGroup.setText(Messages.JavaConnectTab_Warning);
+ messageGroup.setLayout(new GridLayout(3, false));
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ messageGroup.setLayoutData(gd);
+
+ Label noteLabel = new Label(messageGroup,SWT.NONE);
+ gd=new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false);
+ noteLabel.setLayoutData(gd);
+ Image image = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
+ image.setBackground(noteLabel.getBackground());
+ noteLabel.setImage(image);
+
+ Text noteText = new Text(messageGroup, SWT.WRAP | SWT.READ_ONLY);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ GC gc = new GC(parent);
+ gd.heightHint = Dialog.convertHeightInCharsToPixels(gc
+ .getFontMetrics(), 3);
+ gc.dispose();
+ noteText.setLayoutData(gd);
+ noteText.setText(Messages.JavaConnectTab_JDK_Required);
+
+ messageGroup.setVisible(!RemoteDebugActivator.getDefault().isJdk());
+
+ Button addJDK = new Button(messageGroup, SWT.PUSH);
+ addJDK.setText(Messages.JavaConnectTab_Add_JDK);
+ gd=new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
+ addJDK.setLayoutData(gd);
+ addJDK.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ String preferenceId = "org.eclipse.jdt.debug.ui.preferences.VMPreferencePage"; //$NON-NLS-1$
+ PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(),preferenceId, null, null);
+ dialog.open();
+ refresh(hostCombo.getText(), false);
+ updateLaunchConfigurationDialog();
+ messageGroup.setVisible(!RemoteDebugActivator.getDefault().isJdk());
+ }
+ });
+
+
+ setControl(comp);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_CONNECT_TAB);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.debug.ui.launcher.AbstractJavaMainTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ public void initializeFrom(ILaunchConfiguration config) {
+ super.initializeFrom(config);
+ updateAllowTerminateFromConfig(config);
+ updateSetAsDefaultFromConfig(config);
+ }
+
+ private void updateSetAsDefaultFromConfig(ILaunchConfiguration config) {
+ ILaunchConfiguration[] configs = RemoteDebugActivator.getDefault().getLaunchConfigurations();
+ if (configs != null && configs.length == 1) {
+ if (config instanceof ILaunchConfigurationWorkingCopy) {
+ ILaunchConfigurationWorkingCopy wc = (ILaunchConfigurationWorkingCopy) config;
+ try {
+ boolean isDefault = config.getAttribute(RemoteDebugActivator.SET_AS_DEFAULT, false);
+ if (!isDefault) {
+ wc.setAttribute(RemoteDebugActivator.SET_AS_DEFAULT, true);
+ wc.doSave();
+ }
+ } catch (CoreException e) {
+ // ignore
+ }
+ }
+ }
+ boolean isDefault = false;
+ try {
+ isDefault = config.getAttribute(RemoteDebugActivator.SET_AS_DEFAULT, false);
+ }
+ catch (CoreException ce) {
+ JDIDebugUIPlugin.log(ce);
+ }
+ defaultButton.setSelection(isDefault);
+ }
+
+ /**
+ * Updates the state of the allow terminate check button from the specified configuration
+ * @param config the config to load from
+ */
+ private void updateAllowTerminateFromConfig(ILaunchConfiguration config) {
+ boolean allowTerminate = false;
+ try {
+ allowTerminate = config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_ALLOW_TERMINATE, false);
+ }
+ catch (CoreException ce) {JDIDebugUIPlugin.log(ce);}
+ fAllowTerminateButton.setSelection(allowTerminate);
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
+ public void performApply(ILaunchConfigurationWorkingCopy config) {
+ config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, fProjText.getText().trim());
+ config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_ALLOW_TERMINATE, fAllowTerminateButton.getSelection());
+ config.setAttribute(RemoteDebugActivator.SET_AS_DEFAULT, defaultButton.getSelection());
+ config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_CONNECTOR, getSelectedConnector().getIdentifier());
+ mapResources(config);
+ Map attrMap = new HashMap(2);
+ attrMap.put("hostname", hostCombo.getText()); //$NON-NLS-1$
+ String port = getPort();
+ if (port != null) {
+ attrMap.put("port", port); //$NON-NLS-1$
+ } else {
+ attrMap.put("port", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CONNECT_MAP, attrMap);
+ if (defaultButton.getSelection()) {
+ ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType type = manager.getLaunchConfigurationType(RemoteDebugActivator.LAUNCH_CONFIGURATION_ID);
+ ILaunchConfiguration[] configs = null;
+ try {
+ configs = manager.getLaunchConfigurations(type);
+ } catch (CoreException e) {
+ return;
+ }
+ for (ILaunchConfiguration configuration:configs) {
+ try {
+ boolean isDefault = configuration.getAttribute(RemoteDebugActivator.SET_AS_DEFAULT, false);
+ if (isDefault && !config.getName().equals(configuration.getName())) {
+ ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
+ wc.setAttribute(RemoteDebugActivator.SET_AS_DEFAULT, false);
+ wc.doSave();
+ }
+ } catch (CoreException e) {
+ RemoteDebugUIActivator.log(e);
+ }
+ }
+ }
+ }
+
+ private String getPort() {
+ int portIndex = portCombo.getSelectionIndex();
+ String port = null;
+ if (models != null && models.length > portIndex && portIndex >= 0) {
+ port = models[portIndex].getPort();
+ }
+ return port;
+ }
+
+ /**
+ * Initialize default settings for the given Java element
+ */
+ private void initializeDefaults(IJavaElement javaElement, ILaunchConfigurationWorkingCopy config) {
+ initializeJavaProject(javaElement, config);
+ //initializeName(javaElement, config);
+ initializeHardCodedDefaults(config);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
+ public void setDefaults(ILaunchConfigurationWorkingCopy config) {
+ IJavaElement javaElement = getContext();
+ if (javaElement == null) {
+ initializeHardCodedDefaults(config);
+ }
+ else {
+ initializeDefaults(javaElement, config);
+ }
+ }
+
+ /**
+ * Find the first instance of a type, compilation unit, class file or project in the
+ * specified element's parental hierarchy, and use this as the default name.
+ */
+ private void initializeName(IJavaElement javaElement, ILaunchConfigurationWorkingCopy config) {
+ String name = EMPTY_STRING;
+ try {
+ IResource resource = javaElement.getUnderlyingResource();
+ if (resource != null) {
+ name = resource.getName();
+ int index = name.lastIndexOf('.');
+ if (index > 0) {
+ name = name.substring(0, index);
+ }
+ }
+ else {
+ name= javaElement.getElementName();
+ }
+ name = getLaunchConfigurationDialog().generateName(name);
+ }
+ catch (JavaModelException jme) {JDIDebugUIPlugin.log(jme);}
+ config.rename(name);
+ }
+
+ /**
+ * Initialize those attributes whose default values are independent of any context.
+ */
+ private void initializeHardCodedDefaults(ILaunchConfigurationWorkingCopy config) {
+ config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_ALLOW_TERMINATE, false);
+ config.setAttribute(RemoteDebugActivator.SET_AS_DEFAULT, false);
+ config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_CONNECTOR, getSelectedConnector().getIdentifier());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ public boolean isValid(ILaunchConfiguration config) {
+ setErrorMessage(null);
+ setMessage(null);
+ String name = fProjText.getText().trim();
+ if (name.length() > 0) {
+ if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) {
+ setErrorMessage(Messages.JavaConnectTab_Project_does_not_exist_14);
+ return false;
+ }
+ }
+ if (hostCombo.getText().isEmpty()) {
+ setErrorMessage(Messages.JavaConnectTab_Invalid_Host);
+ return false;
+ }
+ String port = getPort();
+ if (port == null || port.isEmpty()) {
+ setErrorMessage(Messages.JavaConnectTab_Invalid_Port);
+ return false;
+ }
+ try {
+ new Integer(port);
+ } catch (NumberFormatException e) {
+ setErrorMessage(Messages.JavaConnectTab_Invalid_Port);
+ return false;
+ }
+
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
+ */
+ public String getName() {
+ return Messages.JavaConnectTab_Conn_ect_20;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getImage()
+ */
+ public Image getImage() {
+ return DebugUITools.getImage(IDebugUIConstants.IMG_LCL_DISCONNECT);
+ }
+
+ /**
+ * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
+ *
+ * @since 3.3
+ */
+ public String getId() {
+ return "org.jboss.tools.common.jdt.debug.ui.javaConnectTab"; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the selected connector
+ */
+ private IVMConnector getSelectedConnector() {
+ if (fConnector == null) {
+ fConnector = RemoteDebugActivator.getDefaultVMConnector();
+ }
+ return fConnector;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/messages.properties (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/messages.properties 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,17 @@
+RemoteDebugItems_Configure=Configure...
+JavaConnectTab_Add_JDK=Add JDK
+JavaConnectTab_Host=Host:
+JavaConnectTab_Invalid_Host=Invalid host.
+JavaConnectTab_Invalid_Port=Invalid port.
+JavaConnectTab_JDK_Required=Auto discovery of remote processes for debugging requires a JDK. You need to start Eclipse\nusing a JDK instead of a JRE or add some JDK runtime to the Installed JREs preference page.
+JavaConnectTab_Port=Port:
+JavaConnectTab_Refresh=Refresh
+JavaConnectTab_SetAsDefault=Set As Default
+JavaConnectTab_Warning=Warning
+JavaConnectTab__Allow_termination_of_remote_VM_6=&Allow termination of remote VM
+JavaConnectTab_Conn_ect_20=Connect
+JavaConnectTab_Connection_Properties_1=Conn&ection Properties:
+JavaConnectTab_Project_does_not_exist_14=Project does not exist
+Discover_Remote_Applications=Discover Remote Applications
+
+
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/AutoResizeTableLayout.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/AutoResizeTableLayout.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/AutoResizeTableLayout.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,129 @@
+/*************************************************************************************
+ * Copyright (c) 2010-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui.preferences;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ColumnLayoutData;
+import org.eclipse.jface.viewers.ColumnPixelData;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+
+public class AutoResizeTableLayout extends TableLayout implements
+ ControlListener {
+
+ private final Table table;
+ private List<ColumnLayoutData> columns = new ArrayList<ColumnLayoutData>();
+ private boolean autosizing = false;
+
+ public AutoResizeTableLayout(Table table) {
+ this.table = table;
+ table.addControlListener(this);
+ }
+
+ public void addColumnData(ColumnLayoutData data) {
+ columns.add(data);
+ super.addColumnData(data);
+ }
+
+ public void controlMoved(ControlEvent e) {
+ }
+
+ public void controlResized(ControlEvent e) {
+ if (autosizing) {
+ return;
+ }
+ autosizing = true;
+ try {
+ autoSizeColumns();
+ } finally {
+ autosizing = false;
+ }
+ }
+
+ private void autoSizeColumns() {
+ int width = table.getClientArea().width;
+ if (width <= 1) {
+ return;
+ }
+
+ TableColumn[] tableColumns = table.getColumns();
+ int size =
+ Math.min(columns.size(), tableColumns.length);
+ int[] widths = new int[size];
+ int fixedWidth = 0;
+ int numberOfWeightColumns = 0;
+ int totalWeight = 0;
+
+ // First calc space occupied by fixed columns.
+ for (int i = 0; i < size; i++) {
+ ColumnLayoutData col = (ColumnLayoutData)columns.get(i);
+ if (col instanceof ColumnPixelData) {
+ int pixels = ((ColumnPixelData)col).width;
+ widths[i] = pixels;
+ fixedWidth += pixels;
+ } else if (col instanceof ColumnWeightData) {
+ ColumnWeightData cw = (ColumnWeightData)col;
+ numberOfWeightColumns++;
+ int weight = cw.weight;
+ totalWeight += weight;
+ } else {
+ throw new IllegalStateException("Unknown column layout data");
+ }
+ }
+
+ // Do we have columns that have a weight?
+ if (numberOfWeightColumns > 0) {
+ // Now, distribute the rest
+ // to the columns with weight.
+ int rest = width - fixedWidth;
+ int totalDistributed = 0;
+ for (int i = 0; i < size; i++) {
+ ColumnLayoutData col = (ColumnLayoutData)columns.get(i);
+ if (col instanceof ColumnWeightData) {
+ ColumnWeightData cw = (ColumnWeightData)col;
+ int weight = cw.weight;
+ int pixels = totalWeight == 0 ? 0 : weight * rest / totalWeight;
+ totalDistributed += pixels;
+ widths[i] = pixels;
+ }
+ }
+
+ // Distribute any remaining pixels
+ // to columns with weight.
+ int diff = rest - totalDistributed;
+ for (int i = 0; diff > 0; i++) {
+ if (i == size) {
+ i = 0;
+ }
+ ColumnLayoutData col = (ColumnLayoutData)columns.get(i);
+ if (col instanceof ColumnWeightData) {
+ ++widths[i];
+ --diff;
+ }
+ }
+ }
+
+ for (int i = 0; i < size; i++) {
+ if (tableColumns[i].getWidth() != widths[i]) {
+ tableColumns[i].setWidth(widths[i]);
+ }
+
+ }
+
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebug.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebug.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebug.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,120 @@
+package org.jboss.tools.common.jdt.debug.ui.preferences;
+
+import org.eclipse.jface.bindings.keys.KeySequence;
+import org.eclipse.jface.bindings.keys.ParseException;
+import org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator;
+
+public class RemoteDebug {
+
+ private int id;
+ private String key;
+ private String description;
+ private String port;
+ private boolean show;
+ private String formatedKey;
+
+ public RemoteDebug(int id, String key, String description, String port, boolean show) {
+ this.id = id;
+ this.key = key;
+ this.description = description;
+ this.port = port;
+ this.show = show;
+ this.formatedKey = format(key);
+ }
+
+ private String format(String sequence) {
+ try {
+ KeySequence keySequence = KeySequence.getInstance(sequence);
+ return keySequence.format();
+ } catch (ParseException e) {
+ RemoteDebugUIActivator.log(e);
+ return sequence;
+ }
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getPort() {
+ return port;
+ }
+
+ public void setPort(String port) {
+ this.port = port;
+ }
+
+ public boolean isShow() {
+ return show;
+ }
+
+ public void setShow(boolean show) {
+ this.show = show;
+ }
+
+ public boolean isValid() {
+ int port = 0;
+ try {
+ port = new Integer(this.port);
+ } catch (NumberFormatException e) {
+ // ignore
+ }
+ return port > 0;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + id;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ RemoteDebug other = (RemoteDebug) obj;
+ if (id != other.id)
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "RemoteDebug [id=" + id + ", key=" + key + ", description="
+ + description + ", port=" + port + ", show=" + show + "]";
+ }
+
+ public String getKey(boolean formated) {
+ if (formated) {
+ return formatedKey;
+ }
+ return key;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebugEditingSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebugEditingSupport.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebugEditingSupport.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,132 @@
+/*************************************************************************************
+ * Copyright (c) 2010-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.common.jdt.debug.ui.preferences;
+
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.CheckboxCellEditor;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.EditingSupport;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TextCellEditor;
+
+/**
+ * @author snjeza
+ *
+ */
+public class RemoteDebugEditingSupport extends EditingSupport {
+
+ private CellEditor editor;
+ private int column;
+
+ public RemoteDebugEditingSupport(ColumnViewer viewer, int column) {
+ super(viewer);
+ switch (column) {
+ case 1:
+ editor = new TextCellEditor(((TableViewer) viewer).getTable());
+ break;
+ case 2:
+ editor = new TextCellEditor(((TableViewer) viewer).getTable());
+ break;
+ case 3:
+ editor = new CheckboxCellEditor(((TableViewer) viewer).getTable());
+ break;
+ default:
+ editor = new TextCellEditor(((TableViewer) viewer).getTable());
+ }
+
+ this.column = column;
+ }
+
+
+ @Override
+ protected boolean canEdit(Object element) {
+ if (this.column == 0) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ protected CellEditor getCellEditor(Object element) {
+ return editor;
+ }
+
+ @Override
+ protected Object getValue(Object element) {
+ RemoteDebug remoteDebug = (RemoteDebug) element;
+ String value = null;
+ switch (this.column) {
+ case 0:
+ value = remoteDebug.getKey(true);
+ if (value == null) {
+ value = ""; //$NON-NLS-1$
+ }
+ return value;
+ case 1:
+ value = remoteDebug.getDescription();
+ if (value == null) {
+ value = ""; //$NON-NLS-1$
+ }
+ return value;
+ case 2:
+ value = remoteDebug.getPort();
+ if (value == null) {
+ value = ""; //$NON-NLS-1$
+ }
+ return value;
+ case 3:
+ boolean show = remoteDebug.isShow();
+ return show;
+ default:
+ break;
+ }
+ return null;
+
+ }
+
+ @Override
+ protected void setValue(Object element, Object value) {
+ RemoteDebug remoteDebug = (RemoteDebug) element;
+ switch (this.column) {
+ case 1:
+ if (value != null) {
+ remoteDebug.setDescription(value.toString());
+ } else {
+ remoteDebug.setDescription(null);
+ }
+ ISelection selection = getViewer().getSelection();
+ getViewer().setSelection(null);
+ getViewer().setSelection(selection);
+ break;
+ case 2:
+ if (value != null) {
+ remoteDebug.setPort(value.toString());
+ } else {
+ remoteDebug.setPort(null);
+ }
+ selection = getViewer().getSelection();
+ getViewer().setSelection(null);
+ getViewer().setSelection(selection);
+ break;
+ case 3:
+ remoteDebug.setShow((Boolean)value);
+ break;
+
+ default:
+ break;
+ }
+
+ getViewer().update(element, null);
+
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebugPreferencePage.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebugPreferencePage.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/src/org/jboss/tools/common/jdt/debug/ui/preferences/RemoteDebugPreferencePage.java 2011-08-14 23:52:38 UTC (rev 33893)
@@ -0,0 +1,264 @@
+package org.jboss.tools.common.jdt.debug.ui.preferences;
+
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ColumnLayoutData;
+import org.eclipse.jface.viewers.ColumnViewerEditor;
+import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent;
+import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.FocusCellOwnerDrawHighlighter;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.TableViewerEditor;
+import org.eclipse.jface.viewers.TableViewerFocusCellManager;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerCell;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.jboss.tools.common.jdt.debug.ui.Messages;
+import org.jboss.tools.common.jdt.debug.ui.RemoteDebugUIActivator;
+
+public class RemoteDebugPreferencePage extends PreferencePage implements
+ IWorkbenchPreferencePage {
+
+// private Image checkboxOn;
+// private Image checkboxOff;
+// private Image errorIcon;
+// private RemoteDebug[] remoteDebugs;
+// private TableViewer viewer;
+// private Button discoverButton;
+ private Button autoConnectButton;
+
+ @Override
+ public void init(IWorkbench workbench) {
+// remoteDebugs = RemoteDebugUIActivator.getDefault().getRemoteDebugs();
+// checkboxOn = RemoteDebugUIActivator.imageDescriptorFromPlugin(RemoteDebugUIActivator.PLUGIN_ID, "/icons/xpl/complete_tsk.gif").createImage();
+// checkboxOff = RemoteDebugUIActivator.imageDescriptorFromPlugin(RemoteDebugUIActivator.PLUGIN_ID, "/icons/xpl/incomplete_tsk.gif").createImage();
+// errorIcon = RemoteDebugUIActivator.imageDescriptorFromPlugin(RemoteDebugUIActivator.PLUGIN_ID, "/icons/xpl/error_tsk.gif").createImage();
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ initializeDialogUnits(parent);
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout(1, false);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ composite.setLayout(layout);
+
+// Group group = new Group(composite, SWT.NONE);
+// GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+// group.setLayoutData(gd);
+// layout = new GridLayout(1, false);
+// group.setLayout(layout);
+// group.setText("Key Bindings");
+//
+// viewer = new TableViewer(group, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL
+// | SWT.V_SCROLL | SWT.BORDER);
+// gd = new GridData(GridData.FILL_BOTH);
+// gd.heightHint = 250;
+// viewer.getTable().setLayoutData(gd);
+//
+// Table table = viewer.getTable();
+// table.setHeaderVisible(true);
+// table.setLinesVisible(true);
+// table.setFont(parent.getFont());
+//
+// viewer.setContentProvider(new RemoteDebugContentProvider());
+//
+// String[] columnHeaders = {"Key", "Description", "Port", "Show"};
+//
+// for (int i = 0; i < columnHeaders.length; i++) {
+// TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
+// column.setLabelProvider(new RemoteDebugLabelProvider(i));
+// column.getColumn().setText(columnHeaders[i]);
+// column.getColumn().setResizable(true);
+// column.getColumn().setMoveable(true);
+// column.setEditingSupport(new RemoteDebugEditingSupport(viewer, i));
+//
+// }
+//
+// ColumnLayoutData[] remoteDebugLayouts= {
+// new ColumnWeightData(150,150),
+// new ColumnWeightData(250,250),
+// new ColumnWeightData(80,80),
+// new ColumnWeightData(60,60),
+// };
+//
+// TableLayout tableLayout = new AutoResizeTableLayout(table);
+// for (int i = 0; i < remoteDebugLayouts.length; i++) {
+// tableLayout.addColumnData(remoteDebugLayouts[i]);
+// }
+//
+// viewer.getTable().setLayout(tableLayout);
+//
+// TableViewerFocusCellManager focusCellManager = new TableViewerFocusCellManager(viewer, new FocusCellOwnerDrawHighlighter(viewer));
+//
+// ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(viewer) {
+// protected boolean isEditorActivationEvent(
+// ColumnViewerEditorActivationEvent event) {
+// ViewerCell cell = viewer.getColumnViewerEditor().getFocusCell();
+// if (cell != null && cell.getColumnIndex() == 1) {
+// return super.isEditorActivationEvent(event);
+// }
+// return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
+// || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
+// || (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.CR)
+// || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
+// }
+// };
+//
+// TableViewerEditor.create(viewer, focusCellManager, actSupport, ColumnViewerEditor.TABBING_HORIZONTAL
+// | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR
+// | ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION);
+//
+// viewer.setInput(remoteDebugs);
+//
+// discoverButton = new Button(composite, SWT.CHECK);
+// discoverButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+// discoverButton.setSelection(RemoteDebugUIActivator.getDefault().isDiscoverRemoteApplication());
+// discoverButton.setText(Messages.Discover_Remote_Applications);
+//
+// createNoteComposite(composite.getFont(), composite, "Note:",
+// "It may take some time to discover remote applications.");
+
+ autoConnectButton = new Button(composite, SWT.CHECK);
+ autoConnectButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ autoConnectButton.setSelection(RemoteDebugUIActivator.getDefault().isAutoConnect());
+ autoConnectButton.setText("Automatically connect if only one application found");
+
+ return composite;
+ }
+
+ class RemoteDebugContentProvider implements IStructuredContentProvider {
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ //return remoteDebugs;
+ return new Object[0];
+ }
+
+ @Override
+ public void dispose() {
+
+ }
+
+ }
+
+ class RemoteDebugLabelProvider extends ColumnLabelProvider {
+
+ private int columnIndex;
+
+ public RemoteDebugLabelProvider(int i) {
+ this.columnIndex = i;
+ }
+
+ public String getText(Object element) {
+ if (element instanceof RemoteDebug) {
+ RemoteDebug remoteDebug = (RemoteDebug) element;
+ switch (columnIndex) {
+ case 0:
+ return remoteDebug.getKey(true);
+ case 1:
+ return remoteDebug.getDescription();
+ case 2:
+ return remoteDebug.getPort();
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ if (element == null) {
+ return null;
+ }
+ RemoteDebug remoteDebug = (RemoteDebug) element;
+// if (columnIndex == 0) {
+// return remoteDebug.isValid() ? null : errorIcon;
+// }
+// if (columnIndex == 3) {
+// return remoteDebug.isShow() ? checkboxOn : checkboxOff;
+// }
+ return null;
+ }
+ }
+
+ @Override
+ public void dispose() {
+// if (checkboxOff != null) {
+// checkboxOff.dispose();
+// }
+// if (checkboxOn != null) {
+// checkboxOn.dispose();
+// }
+// if (errorIcon != null) {
+// errorIcon.dispose();
+// }
+ super.dispose();
+ }
+
+ @Override
+ protected void performApply() {
+ IEclipsePreferences preferences = RemoteDebugUIActivator.getDefault().getPreferences();
+// int keys = RemoteDebugUIActivator.KEYS;
+// for (int i = 0; i < keys; i++) {
+// preferences.put(RemoteDebugUIActivator.getDescriptionPreferenceName(i), remoteDebugs[i].getDescription());
+// preferences.put(RemoteDebugUIActivator.getPortPreferenceName(i), remoteDebugs[i].getPort());
+// preferences.putBoolean(RemoteDebugUIActivator.getShowPreferenceName(i), remoteDebugs[i].isShow());
+// }
+// preferences.putBoolean(RemoteDebugUIActivator.DISCOVER_REMOTE_APPLICATION, discoverButton.getSelection());
+ preferences.putBoolean(RemoteDebugUIActivator.AUTO_CONNECT, autoConnectButton.getSelection());
+ RemoteDebugUIActivator.getDefault().savePreferences();
+ }
+
+ @Override
+ protected void performDefaults() {
+ IEclipsePreferences preferences = RemoteDebugUIActivator.getDefault().getPreferences();
+
+// int keys = RemoteDebugUIActivator.KEYS;
+// for (int i = 0; i < keys; i++) {
+// preferences.put(RemoteDebugUIActivator.getDescriptionPreferenceName(i), RemoteDebugUIActivator.DEFAULT_DESCRIPTION);
+// preferences.put(RemoteDebugUIActivator.getPortPreferenceName(i), RemoteDebugUIActivator.DEFAULT_PORT);
+// preferences.putBoolean(RemoteDebugUIActivator.getShowPreferenceName(i), RemoteDebugUIActivator.DEFAULT_SHOW);
+//
+// }
+// preferences.putBoolean(RemoteDebugUIActivator.DISCOVER_REMOTE_APPLICATION, RemoteDebugUIActivator.DEFAULT_DISCOVER_REMOTE_APPLICATION);
+// RemoteDebugUIActivator.getDefault().savePreferences();
+// remoteDebugs = RemoteDebugUIActivator.getDefault().getRemoteDebugs();
+// viewer.setInput(remoteDebugs);
+// discoverButton.setSelection(RemoteDebugUIActivator.DEFAULT_DISCOVER_REMOTE_APPLICATION);
+// preferences.putBoolean(RemoteDebugUIActivator.DISCOVER_REMOTE_APPLICATION, RemoteDebugUIActivator.DEFAULT_DISCOVER_REMOTE_APPLICATION);
+
+ autoConnectButton.setSelection(RemoteDebugUIActivator.AUTO_CONNECT_DEFAULT);
+ preferences.putBoolean(RemoteDebugUIActivator.AUTO_CONNECT, RemoteDebugUIActivator.AUTO_CONNECT_DEFAULT);
+ RemoteDebugUIActivator.getDefault().savePreferences();
+ super.performDefaults();
+ }
+
+ @Override
+ public boolean performOk() {
+ performApply();
+ return super.performOk();
+ }
+
+}
14 years, 8 months
JBoss Tools SVN: r33892 - trunk/common/features.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-08-14 19:49:45 -0400 (Sun, 14 Aug 2011)
New Revision: 33892
Added:
trunk/common/features/org.jboss.tools.common.jdt.feature/
Log:
JBIDE-9545 Add remote debug attach to jboss tools
14 years, 8 months
JBoss Tools SVN: r33891 - trunk/common/plugins.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-08-14 19:48:10 -0400 (Sun, 14 Aug 2011)
New Revision: 33891
Added:
trunk/common/plugins/org.jboss.tools.common.jdt.debug.ui/
Log:
Initial import.
14 years, 8 months
JBoss Tools SVN: r33890 - trunk/common/plugins.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-08-14 19:46:48 -0400 (Sun, 14 Aug 2011)
New Revision: 33890
Added:
trunk/common/plugins/org.jboss.tools.common.jdt.debug/
Log:
JBIDE-9545 Add remote debug attach to jboss tools
14 years, 8 months
JBoss Tools SVN: r33889 - in branches/jbosstools-3.2.x/as/docs/reference/en-US: images/runtimes_servers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-08-14 18:53:04 -0400 (Sun, 14 Aug 2011)
New Revision: 33889
Modified:
branches/jbosstools-3.2.x/as/docs/reference/en-US/Book_Info.xml
branches/jbosstools-3.2.x/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers_4.png
branches/jbosstools-3.2.x/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers_6.png
branches/jbosstools-3.2.x/as/docs/reference/en-US/runtimes_servers.xml
Log:
updated for TOOLSDOC-180
Modified: branches/jbosstools-3.2.x/as/docs/reference/en-US/Book_Info.xml
===================================================================
--- branches/jbosstools-3.2.x/as/docs/reference/en-US/Book_Info.xml 2011-08-14 22:52:50 UTC (rev 33888)
+++ branches/jbosstools-3.2.x/as/docs/reference/en-US/Book_Info.xml 2011-08-14 22:53:04 UTC (rev 33889)
@@ -7,7 +7,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>4.1</productnumber>
<edition>4.1.0</edition>
- <pubsnumber>1</pubsnumber>
+ <pubsnumber>2</pubsnumber>
<abstract>
<para>The JBoss Server Manager Reference Guide explains how to use the JBoss Server Manager to configure, start, stop the server, to know deployment and archiving processes.</para>
</abstract>
Modified: branches/jbosstools-3.2.x/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers_4.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers_6.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/as/docs/reference/en-US/runtimes_servers.xml
===================================================================
--- branches/jbosstools-3.2.x/as/docs/reference/en-US/runtimes_servers.xml 2011-08-14 22:52:50 UTC (rev 33888)
+++ branches/jbosstools-3.2.x/as/docs/reference/en-US/runtimes_servers.xml 2011-08-14 22:53:04 UTC (rev 33889)
@@ -335,14 +335,14 @@
</mediaobject>
</figure>
<para>
- A server object keeps track of things like command line arguments when starting or stopping and the runtimes keep track of the location of the installation. Thus, each server instance must be backed by an appropriate runtime.
+ A server object keeps track of the command line arguments when starting or stopping and the runtimes keep track of the location of the installation. This means that each server instance must be backed by an appropriate runtime.
</para>
<para>
- The <guilabel>New server wizard</guilabel> allows you to name the server via the <guilabel>Server name</guilabel> field, or you can use a generated default name .If it is necessary to restore the default name, click the <guibutton>Reset default</guibutton> button (<inlinemediaobject> <imageobject><imagedata fileref="images/runtimes_servers/runtimes_servers_4d.png"/></imageobject></inlinemediaobject>).
+ The <guilabel>New server wizard</guilabel> allows you to name the server via the <guilabel>Server name</guilabel> field, or you can use a generated default name.
</para>
<para>
- You can select the appropriate runtime from the <guilabel>Server runtime environment</guilabel> combo box. If there is no runtime that matches your needs just press the <guilabel>Add...</guilabel> link nearby to bring up the wizard for creating a new runtime (see <xref linkend="add_runtime_figure"/>). To configure an existing runtimes you should go to server preferences by pressing the <guilabel>Configure runtime environments...</guilabel> link.
+ You can select the appropriate runtime from the <guilabel>Server runtime environment</guilabel> combo box. If there is no runtime that matches your needs, press the <guilabel>Add...</guilabel> link nearby to bring up the wizard for creating a new runtime (see <xref linkend="add_runtime_figure"/>). To configure an existing runtime, go to server preferences by pressing the <guilabel>Configure runtime environments...</guilabel> link.
</para>
<para>If the server you want to create does not have any installed runtime yet, the combobox and the links are absent.</para>
@@ -360,7 +360,7 @@
In this case the next page of the wizard which has the same form as in <link linkend="add_runtime_figure">the previous section</link> and will ask you to create the associated runtime.
</para>
<para>
- Either way, after targeting your server to a runtime, the final screen in this wizard presents a summary of the selected options, giving you a chance to verify that you have selected the appropriate runtime.
+ After targeting your server to a runtime, the final screen in this wizard presents a summary of the selected options, giving you a chance to verify that you have selected the appropriate runtime.
</para>
<figure>
@@ -375,9 +375,9 @@
<para>Click the <guibutton>Finish</guibutton> button to complete the process of the server creation.</para>
<para>Now that we have created our runtimes and servers, we can explore the services and tools provided by the JBoss Server Manager.</para>
- <para>
+ <!-- <para>
We hope this guide helped you to get started with the JBoss Tools server manager. For additional information you are welcome on <ulink url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=201">JBoss forum</ulink>.
- </para>
+ </para> -->
</section>
</section>
14 years, 8 months
JBoss Tools SVN: r33888 - in trunk/as/docs/reference/en-US: images/runtimes_servers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-08-14 18:52:50 -0400 (Sun, 14 Aug 2011)
New Revision: 33888
Modified:
trunk/as/docs/reference/en-US/Book_Info.xml
trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers_4.png
trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers_6.png
trunk/as/docs/reference/en-US/runtimes_servers.xml
Log:
updated for TOOLSDOC-180
Modified: trunk/as/docs/reference/en-US/Book_Info.xml
===================================================================
--- trunk/as/docs/reference/en-US/Book_Info.xml 2011-08-14 22:31:31 UTC (rev 33887)
+++ trunk/as/docs/reference/en-US/Book_Info.xml 2011-08-14 22:52:50 UTC (rev 33888)
@@ -7,7 +7,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>4.1</productnumber>
<edition>4.1.0</edition>
- <pubsnumber>1</pubsnumber>
+ <pubsnumber>2</pubsnumber>
<abstract>
<para>The JBoss Server Manager Reference Guide explains how to use the JBoss Server Manager to configure, start, stop the server, to know deployment and archiving processes.</para>
</abstract>
Modified: trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers_4.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers_6.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en-US/runtimes_servers.xml
===================================================================
--- trunk/as/docs/reference/en-US/runtimes_servers.xml 2011-08-14 22:31:31 UTC (rev 33887)
+++ trunk/as/docs/reference/en-US/runtimes_servers.xml 2011-08-14 22:52:50 UTC (rev 33888)
@@ -335,14 +335,14 @@
</mediaobject>
</figure>
<para>
- A server object keeps track of things like command line arguments when starting or stopping and the runtimes keep track of the location of the installation. Thus, each server instance must be backed by an appropriate runtime.
+ A server object keeps track of the command line arguments when starting or stopping and the runtimes keep track of the location of the installation. This means that each server instance must be backed by an appropriate runtime.
</para>
<para>
- The <guilabel>New server wizard</guilabel> allows you to name the server via the <guilabel>Server name</guilabel> field, or you can use a generated default name .If it is necessary to restore the default name, click the <guibutton>Reset default</guibutton> button (<inlinemediaobject> <imageobject><imagedata fileref="images/runtimes_servers/runtimes_servers_4d.png"/></imageobject></inlinemediaobject>).
+ The <guilabel>New server wizard</guilabel> allows you to name the server via the <guilabel>Server name</guilabel> field, or you can use a generated default name.
</para>
<para>
- You can select the appropriate runtime from the <guilabel>Server runtime environment</guilabel> combo box. If there is no runtime that matches your needs just press the <guilabel>Add...</guilabel> link nearby to bring up the wizard for creating a new runtime (see <xref linkend="add_runtime_figure"/>). To configure an existing runtimes you should go to server preferences by pressing the <guilabel>Configure runtime environments...</guilabel> link.
+ You can select the appropriate runtime from the <guilabel>Server runtime environment</guilabel> combo box. If there is no runtime that matches your needs, press the <guilabel>Add...</guilabel> link nearby to bring up the wizard for creating a new runtime (see <xref linkend="add_runtime_figure"/>). To configure an existing runtime, go to server preferences by pressing the <guilabel>Configure runtime environments...</guilabel> link.
</para>
<para>If the server you want to create does not have any installed runtime yet, the combobox and the links are absent.</para>
@@ -360,7 +360,7 @@
In this case the next page of the wizard which has the same form as in <link linkend="add_runtime_figure">the previous section</link> and will ask you to create the associated runtime.
</para>
<para>
- Either way, after targeting your server to a runtime, the final screen in this wizard presents a summary of the selected options, giving you a chance to verify that you have selected the appropriate runtime.
+ After targeting your server to a runtime, the final screen in this wizard presents a summary of the selected options, giving you a chance to verify that you have selected the appropriate runtime.
</para>
<figure>
@@ -375,9 +375,9 @@
<para>Click the <guibutton>Finish</guibutton> button to complete the process of the server creation.</para>
<para>Now that we have created our runtimes and servers, we can explore the services and tools provided by the JBoss Server Manager.</para>
- <para>
+ <!-- <para>
We hope this guide helped you to get started with the JBoss Tools server manager. For additional information you are welcome on <ulink url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=201">JBoss forum</ulink>.
- </para>
+ </para> -->
</section>
</section>
14 years, 8 months
JBoss Tools SVN: r33887 - in branches/jbosstools-3.2.x/as/docs/reference/en-US: images/runtimes_servers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-08-14 18:31:31 -0400 (Sun, 14 Aug 2011)
New Revision: 33887
Added:
branches/jbosstools-3.2.x/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers-detecting_new_runtime_3.png
Modified:
branches/jbosstools-3.2.x/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers-detecting_new_runtime_1.png
branches/jbosstools-3.2.x/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers-detecting_new_runtime_2.png
branches/jbosstools-3.2.x/as/docs/reference/en-US/runtimes_servers.xml
Log:
updated for TOOLSDOC-180
Modified: branches/jbosstools-3.2.x/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers-detecting_new_runtime_1.png
===================================================================
(Binary files differ)
Modified: branches/jbosstools-3.2.x/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers-detecting_new_runtime_2.png
===================================================================
(Binary files differ)
Added: branches/jbosstools-3.2.x/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers-detecting_new_runtime_3.png
===================================================================
(Binary files differ)
Property changes on: branches/jbosstools-3.2.x/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers-detecting_new_runtime_3.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: branches/jbosstools-3.2.x/as/docs/reference/en-US/runtimes_servers.xml
===================================================================
--- branches/jbosstools-3.2.x/as/docs/reference/en-US/runtimes_servers.xml 2011-08-14 22:31:10 UTC (rev 33886)
+++ branches/jbosstools-3.2.x/as/docs/reference/en-US/runtimes_servers.xml 2011-08-14 22:31:31 UTC (rev 33887)
@@ -204,11 +204,11 @@
</mediaobject>
</figure>
<para>
- The JBoss Runtimes preference page allows you to perform three different actions: <guibutton>Search</guibutton> for a JBoss runtime installation, <guibutton>Export</guibutton> a JBoss runtime configuration and <guibutton>Import</guibutton> the configuration of a JBoss runtime.
- </para>
+ The JBoss Tools Runtimes preference page is split into two different sections. One section defines <guilabel>Paths</guilabel> to be searched for installed server runtimes, the other section defines the runtime detectors available when the paths in the previous section are checked.
+ </para>
<para>
- The <guibutton>Search</guibutton> button opens a file system browser window. Select the directory where you wish JBoss Tools to begin recursively searching for JBoss runtimes and upon completion it will return all those found. From the returned list, choose the runtimes you wish to make available to your JBoss Tools instance by clicking the box beside each runtime and clicking the <guibutton>OK</guibutton> button.
- </para>
+ The <guibutton>Add</guibutton> button in the <guilabel>Paths</guilabel> section opens a file system browser window. Select the directory you wish to have recursively searched for JBoss runtimes. The directory will be searched and all found servers will be displayed as a list in the <guilabel>Searching for runtimes</guilabel> dialog. From the returned list, choose the runtimes you wish to make available by clicking the box beside each runtime and clicking the <guibutton>OK</guibutton> button.
+ </para>
<figure>
<title>JBoss Runtime search results</title>
<mediaobject>
@@ -217,7 +217,20 @@
</imageobject>
</mediaobject>
</figure>
+ <para>
+ The path you searched is now added to a list in the <guilabel>JBoss Tools Runtime Detection</guilabel> dialog <guilabel>Paths</guilabel> section. All the paths in this section will be automatically searched when a new workspace is created. If you wish for a path to be searched on startup then check the checkbox in the <guilabel>Every start</guilabel> column associated with it.
+ </para>
+ <figure>
+ <title>JBoss Runtime search results</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/runtimes_servers/runtimes_servers-detecting_new_runtime_3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
</section>
+<!-- No longer valid - cannot export or import runtime preferences
+
<section id="Exporting_and_Importing_runtime_preferences">
<title>Exporting and Importing runtime preferences</title>
<para>
@@ -253,7 +266,7 @@
</imageobject>
</mediaobject>
</figure>
- </section>
+ </section> -->
<section id="CopyRuntime">
<title>Duplicating a runtime configuration</title>
<para>
14 years, 8 months
JBoss Tools SVN: r33886 - in trunk/as/docs/reference/en-US: images/runtimes_servers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-08-14 18:31:10 -0400 (Sun, 14 Aug 2011)
New Revision: 33886
Added:
trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers-detecting_new_runtime_3.png
Modified:
trunk/as/docs/reference/en-US/Revision_History.xml
trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers-detecting_new_runtime_1.png
trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers-detecting_new_runtime_2.png
trunk/as/docs/reference/en-US/runtimes_servers.xml
Log:
updated for TOOLSDOC-180
Modified: trunk/as/docs/reference/en-US/Revision_History.xml
===================================================================
--- trunk/as/docs/reference/en-US/Revision_History.xml 2011-08-13 12:27:42 UTC (rev 33885)
+++ trunk/as/docs/reference/en-US/Revision_History.xml 2011-08-14 22:31:10 UTC (rev 33886)
@@ -6,7 +6,7 @@
<simpara>
<revhistory>
<revision>
- <revnumber>2</revnumber>
+ <revnumber>1-2</revnumber>
<date>Mon Jan 31 2011</date>
<author>
<firstname>Matthew</firstname>
@@ -20,7 +20,7 @@
</revdescription>
</revision>
<revision>
- <revnumber>1</revnumber>
+ <revnumber>1-1</revnumber>
<date>Wed Jun 09 2010</date>
<author>
<firstname>JBoss Tools</firstname>
@@ -34,7 +34,7 @@
</revdescription>
</revision>
<revision>
- <revnumber>0</revnumber>
+ <revnumber>1-0</revnumber>
<date>Fri Nov 20 2009</date>
<author>
<firstname>Isaac</firstname>
Modified: trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers-detecting_new_runtime_1.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers-detecting_new_runtime_2.png
===================================================================
(Binary files differ)
Added: trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers-detecting_new_runtime_3.png
===================================================================
(Binary files differ)
Property changes on: trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers-detecting_new_runtime_3.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/as/docs/reference/en-US/runtimes_servers.xml
===================================================================
--- trunk/as/docs/reference/en-US/runtimes_servers.xml 2011-08-13 12:27:42 UTC (rev 33885)
+++ trunk/as/docs/reference/en-US/runtimes_servers.xml 2011-08-14 22:31:10 UTC (rev 33886)
@@ -204,11 +204,11 @@
</mediaobject>
</figure>
<para>
- The JBoss Runtimes preference page allows you to perform three different actions: <guibutton>Search</guibutton> for a JBoss runtime installation, <guibutton>Export</guibutton> a JBoss runtime configuration and <guibutton>Import</guibutton> the configuration of a JBoss runtime.
- </para>
+ The JBoss Tools Runtimes preference page is split into two different sections. One section defines <guilabel>Paths</guilabel> to be searched for installed server runtimes, the other section defines the runtime detectors available when the paths in the previous section are checked.
+ </para>
<para>
- The <guibutton>Search</guibutton> button opens a file system browser window. Select the directory where you wish JBoss Tools to begin recursively searching for JBoss runtimes and upon completion it will return all those found. From the returned list, choose the runtimes you wish to make available to your JBoss Tools instance by clicking the box beside each runtime and clicking the <guibutton>OK</guibutton> button.
- </para>
+ The <guibutton>Add</guibutton> button in the <guilabel>Paths</guilabel> section opens a file system browser window. Select the directory you wish to have recursively searched for JBoss runtimes. The directory will be searched and all found servers will be displayed as a list in the <guilabel>Searching for runtimes</guilabel> dialog. From the returned list, choose the runtimes you wish to make available by clicking the box beside each runtime and clicking the <guibutton>OK</guibutton> button.
+ </para>
<figure>
<title>JBoss Runtime search results</title>
<mediaobject>
@@ -217,7 +217,20 @@
</imageobject>
</mediaobject>
</figure>
+ <para>
+ The path you searched is now added to a list in the <guilabel>JBoss Tools Runtime Detection</guilabel> dialog <guilabel>Paths</guilabel> section. All the paths in this section will be automatically searched when a new workspace is created. If you wish for a path to be searched on startup then check the checkbox in the <guilabel>Every start</guilabel> column associated with it.
+ </para>
+ <figure>
+ <title>JBoss Runtime search results</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/runtimes_servers/runtimes_servers-detecting_new_runtime_3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
</section>
+<!-- No longer valid - cannot export or import runtime preferences
+
<section id="Exporting_and_Importing_runtime_preferences">
<title>Exporting and Importing runtime preferences</title>
<para>
@@ -253,7 +266,7 @@
</imageobject>
</mediaobject>
</figure>
- </section>
+ </section> -->
<section id="CopyRuntime">
<title>Duplicating a runtime configuration</title>
<para>
14 years, 8 months