JBoss Tools SVN: r15951 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse: console/views and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-06-15 09:31:55 -0400 (Mon, 15 Jun 2009)
New Revision: 15951
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3785
Added project, Connection and Mode properties.
Changes in Properties view call changes in configuration.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2009-06-15 13:09:11 UTC (rev 15950)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2009-06-15 13:31:55 UTC (rev 15951)
@@ -114,6 +114,9 @@
//
public static String ConsoleConfigurationPropertySource_additional_mapping_files;
public static String ConsoleConfigurationPropertySource_config_file;
+ public static String ConsoleConfigurationPropertySource_project;
+ public static String ConsoleConfigurationPropertySource_connection;
+ public static String ConsoleConfigurationPropertySource_mode;
public static String ConsoleConfigurationPropertySource_error;
public static String ConsoleConfigurationPropertySource_name;
public static String ConsoleConfigurationPropertySource_properties_file;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2009-06-15 13:09:11 UTC (rev 15950)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2009-06-15 13:31:55 UTC (rev 15951)
@@ -109,6 +109,9 @@
ConsoleConfigurationPropertySource_config_file=Configuration file
ConsoleConfigurationPropertySource_error=Error:
ConsoleConfigurationPropertySource_name=Name
+ConsoleConfigurationPropertySource_project=Project
+ConsoleConfigurationPropertySource_connection=Connection
+ConsoleConfigurationPropertySource_mode=Mode
ConsoleConfigurationPropertySource_properties_file=Properties file
DynamicSQLPreviewView_caused_by=\nCaused by:\n
DynamicSQLPreviewView_empty_hql_query=Empty HQL query.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java 2009-06-15 13:09:11 UTC (rev 15950)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java 2009-06-15 13:31:55 UTC (rev 15951)
@@ -22,11 +22,20 @@
package org.hibernate.eclipse.console.views;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.datatools.connectivity.IConnectionProfile;
+import org.eclipse.datatools.connectivity.ProfileManager;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.views.properties.ComboBoxPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.PropertyDescriptor;
@@ -34,6 +43,7 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
+import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.LaunchHelper;
@@ -42,16 +52,34 @@
private ConsoleConfiguration cfg;
- static IPropertyDescriptor[] pd;
+ static List<IPropertyDescriptor> pd;
static {
+ ComboBoxPropertyDescriptor modeDescriptor = new ComboBoxPropertyDescriptor(
+ "mode", //$NON-NLS-1$
+ HibernateConsoleMessages.ConsoleConfigurationPropertySource_mode,
+ ConfigurationMode.values());
+ modeDescriptor.setLabelProvider(new LabelProvider(){
+
+ @Override
+ public String getText(Object element) {
+ if (ConfigurationMode.CORE.toString().equals(element)){
+ return "Core"; //$NON-NLS-1$
+ }
+ if (ConfigurationMode.ANNOTATIONS.toString().equals(element)){
+ return "Annotations"; //$NON-NLS-1$
+ }
+ return super.getText(element);
+ }
+ });
+
List<IPropertyDescriptor> l = new ArrayList<IPropertyDescriptor>();
l.add(new TextPropertyDescriptor("name", HibernateConsoleMessages.ConsoleConfigurationPropertySource_name)); //$NON-NLS-1$
+ l.add(modeDescriptor);
l.add(new PropertyDescriptor("hibernate.cfg.xml", HibernateConsoleMessages.ConsoleConfigurationPropertySource_config_file)); //$NON-NLS-1$
l.add(new PropertyDescriptor("hibernate.properties", HibernateConsoleMessages.ConsoleConfigurationPropertySource_properties_file)); //$NON-NLS-1$
l.add(new PropertyDescriptor("mapping.files", HibernateConsoleMessages.ConsoleConfigurationPropertySource_additional_mapping_files)); //$NON-NLS-1$
-
- pd = l.toArray( new IPropertyDescriptor[l.size()] );
+ pd = l;
}
public ConsoleConfigurationPropertySource(ConsoleConfiguration cfg) {
@@ -63,17 +91,69 @@
}
public IPropertyDescriptor[] getPropertyDescriptors() {
- return pd;
+ IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[pd.size() + 2];
+ pd.toArray(propertyDescriptors);
+ propertyDescriptors[propertyDescriptors.length - 2] = createProjectDescriptor();
+ propertyDescriptors[propertyDescriptors.length - 1] = createConnectionDescriptor();
+ return propertyDescriptors;
}
public Object getPropertyValue(Object id) {
try {
if("name".equals(id)) { //$NON-NLS-1$
return cfg.getName();
- }
+ }
// TODO: bring back more eclipse friendly file names
ConsoleConfigurationPreferences preferences = cfg.getPreferences();
-
+ if ("project".equals(id)){ //$NON-NLS-1$
+ try {
+ ILaunchConfiguration lc = HibernateConsolePlugin.getDefault().findLaunchConfig(cfg.getName());
+ if (lc != null){
+ String projectName = lc.getAttribute("org.eclipse.jdt.launching.PROJECT_ATTR", ""); //$NON-NLS-1$//$NON-NLS-2$
+ return Arrays.binarySearch(getSortedProjectNames(), projectName);
+ } else {
+ HibernateConsolePlugin.getDefault().log("Can't find Console Configuration \"" + cfg.getName() + "\"");//$NON-NLS-1$//$NON-NLS-2$
+ }
+ } catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().log(e);
+ }
+ }
+ if("mode".equals(id)) { //$NON-NLS-1$
+ String[] values = ConfigurationMode.values();
+ String value = preferences.getConfigurationMode().toString();
+ for (int i = 0; i < values.length; i++) {
+ if (value.equals(values[i])){
+ return i;
+ }
+ }
+ return new RuntimeException("Unknown ConsoleConfiguration mode: " + value); //$NON-NLS-1$
+ }
+ if("connection".equals(id)) { //$NON-NLS-1$
+ try {
+ ILaunchConfiguration lc = HibernateConsolePlugin.getDefault().findLaunchConfig(cfg.getName());
+ if (lc != null){
+ String connectionName = lc.getAttribute("org.hibernate.eclipse.launch.CONNECTION_PROFILE_NAME", (String)null); //$NON-NLS-1$
+ if (connectionName == null){
+ connectionName = lc.getAttribute("org.hibernate.eclipse.launch.USE_JPA_PROJECT_PROFILE", Boolean.FALSE.toString());//$NON-NLS-1$
+ if (Boolean.TRUE.toString().equalsIgnoreCase(connectionName)){
+ connectionName = HibernateConsoleMessages.ConnectionProfileCtrl_JPAConfiguredConnection;
+ } else {
+ connectionName = HibernateConsoleMessages.ConnectionProfileCtrl_HibernateConfiguredConnection;
+ }
+ }
+ String[] values = getConnectionNames();
+ for (int i = 0; i < values.length; i++) {
+ if (values[i].equals(connectionName)){
+ return i;
+ }
+ }
+ } else {
+ HibernateConsolePlugin.getDefault().log("Can't find Console Configuration \"" + cfg.getName() + "\"");//$NON-NLS-1$//$NON-NLS-2$
+ }
+ } catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().log(e);
+ }
+ }
if("hibernate.cfg.xml".equals(id)) { //$NON-NLS-1$
return preferences.getConfigXMLFile();
}
@@ -113,12 +193,127 @@
//find newly created console configuration
cfg = KnownConfigurations.getInstance().find(newName);
} else {
- HibernateConsolePlugin.getDefault().log("Can't find Console Configuration \"" + oldName + "\"");
+ HibernateConsolePlugin.getDefault().log("Can't find Console Configuration \"" + oldName + "\"");//$NON-NLS-1$//$NON-NLS-2$
}
} catch (CoreException e) {
HibernateConsolePlugin.getDefault().log(e);
}
+ } else if ("mode".equals(id) && value instanceof Integer){ //$NON-NLS-1$
+ int index = (Integer) value;
+ try {
+ ILaunchConfiguration lc = HibernateConsolePlugin.getDefault().findLaunchConfig(cfg.getName());
+ if (lc != null){
+ ILaunchConfigurationWorkingCopy wc = lc.getWorkingCopy();
+ wc.setAttribute("org.hibernate.eclipse.launch.CONFIGURATION_FACTORY", ConfigurationMode.values()[index]);////$NON-NLS-1$
+ wc.doSave();
+ } else {
+ HibernateConsolePlugin.getDefault().log("Can't find Console Configuration \"" + cfg.getName() + "\"");//$NON-NLS-1$//$NON-NLS-2$
+ }
+ } catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().log("Can't find Console Configuration \"" + cfg.getName() + "\"");//$NON-NLS-1$//$NON-NLS-2$
+ }
+ } else if ("project".equals(id) && value instanceof Integer){ //$NON-NLS-1$
+ int index = (Integer) value;
+ try {
+ ILaunchConfiguration lc = HibernateConsolePlugin.getDefault().findLaunchConfig(cfg.getName());
+ if (lc != null){
+ ILaunchConfigurationWorkingCopy wc = lc.getWorkingCopy();
+ wc.setAttribute("org.eclipse.jdt.launching.PROJECT_ATTR", getSortedProjectNames()[index]);////$NON-NLS-1$
+ wc.doSave();
+ } else {
+ HibernateConsolePlugin.getDefault().log("Can't find Console Configuration \"" + cfg.getName() + "\"");//$NON-NLS-1$//$NON-NLS-2$
+ }
+ } catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().log("Can't find Console Configuration \"" + cfg.getName() + "\"");//$NON-NLS-1$//$NON-NLS-2$
+ }
+ } else if ("connection".equals(id) && value instanceof Integer){ //$NON-NLS-1$
+ int index = (Integer) value;
+ try {
+ ILaunchConfiguration lc = HibernateConsolePlugin.getDefault().findLaunchConfig(cfg.getName());
+ if (lc != null){
+ ILaunchConfigurationWorkingCopy wc = lc.getWorkingCopy();
+ if (index == 0){//jpa
+ wc.setAttribute("org.hibernate.eclipse.launch.USE_JPA_PROJECT_PROFILE", Boolean.TRUE.toString());////$NON-NLS-1$
+ wc.removeAttribute("org.hibernate.eclipse.launch.CONNECTION_PROFILE_NAME");////$NON-NLS-1$
+ } else if (index == 1){//hibernate
+ wc.removeAttribute("org.hibernate.eclipse.launch.USE_JPA_PROJECT_PROFILE");////$NON-NLS-1$
+ wc.removeAttribute("org.hibernate.eclipse.launch.CONNECTION_PROFILE_NAME");////$NON-NLS-1$
+ } else {//connection profile
+ String[] values = getConnectionNames();
+ wc.setAttribute("org.hibernate.eclipse.launch.CONNECTION_PROFILE_NAME", values[index]);////$NON-NLS-1$
+ wc.removeAttribute("org.hibernate.eclipse.launch.USE_JPA_PROJECT_PROFILE");////$NON-NLS-1$
+ }
+ wc.doSave();
+ } else {
+ HibernateConsolePlugin.getDefault().log("Can't find Console Configuration \"" + cfg.getName() + "\"");//$NON-NLS-1$//$NON-NLS-2$
+ }
+ } catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().log("Can't find Console Configuration \"" + cfg.getName() + "\"");//$NON-NLS-1$//$NON-NLS-2$
+ }
}
}
+ private IPropertyDescriptor createProjectDescriptor(){
+ ComboBoxPropertyDescriptor projectDescriptor = new ComboBoxPropertyDescriptor(
+ "project", //$NON-NLS-1$
+ HibernateConsoleMessages.ConsoleConfigurationPropertySource_project,
+ getSortedProjectNames());
+ projectDescriptor.setValidator(new ICellEditorValidator(){
+ public String isValid(Object value) {
+ if (value instanceof Integer){
+ if (((Integer)value).intValue() < 0){
+ try {
+ ILaunchConfiguration lc = HibernateConsolePlugin.getDefault().findLaunchConfig(cfg.getName());
+ if (lc != null){
+ String projectName = lc.getAttribute("org.eclipse.jdt.launching.PROJECT_ATTR", (String)null); //$NON-NLS-1$
+ if (projectName != null){
+ return NLS.bind(HibernateConsoleMessages.ConsoleConfigurationMainTab_the_java_project_does_not_exist, projectName);
+ }
+ } else {
+ HibernateConsolePlugin.getDefault().log("Can't find Console Configuration \"" + cfg.getName() + "\"");//$NON-NLS-1$//$NON-NLS-2$
+ }
+ } catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().log(e);
+ }
+ }
+ }
+ return null;
+ }
+ });
+ return projectDescriptor;
+ }
+
+ private IPropertyDescriptor createConnectionDescriptor(){
+ ComboBoxPropertyDescriptor connectionDescriptor = new ComboBoxPropertyDescriptor(
+ "connection", //$NON-NLS-1$
+ HibernateConsoleMessages.ConsoleConfigurationPropertySource_connection,
+ getConnectionNames());
+ return connectionDescriptor;
+ }
+
+ private String[] getSortedProjectNames(){
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();//get all projects
+ String[] projectNames = new String[projects.length];
+ for (int i = 0; i < projects.length; i++ ) {
+ projectNames[i] = projects[i].getName();
+ };
+ Arrays.sort(projectNames);
+ return projectNames;
+ }
+
+ private String[] getConnectionNames(){
+ IConnectionProfile[] profiles = ProfileManager.getInstance()
+ .getProfilesByCategory("org.eclipse.datatools.connectivity.db.category"); //$NON-NLS-1$
+ String[] names = new String[profiles.length];
+ for (int i = 0; i < profiles.length; i ++){
+ names[i] = profiles[i].getName();
+ }
+ Arrays.sort(names);
+ String[] resNames = new String[names.length + 2];
+ resNames[0] = HibernateConsoleMessages.ConnectionProfileCtrl_JPAConfiguredConnection;
+ resNames[1] = HibernateConsoleMessages.ConnectionProfileCtrl_HibernateConfiguredConnection;
+ System.arraycopy(names, 0, resNames, 2, names.length);
+ return resNames;
+ }
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java 2009-06-15 13:09:11 UTC (rev 15950)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java 2009-06-15 13:31:55 UTC (rev 15951)
@@ -5,7 +5,6 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -43,7 +42,6 @@
import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
-import org.hibernate.eclipse.console.actions.AddConfigurationAction;
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.eclipse.console.utils.ProjectUtils;
15 years, 7 months
JBoss Tools SVN: r15950 - trunk/seam/plugins/org.jboss.tools.seam.pages.xml/META-INF.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-06-15 09:09:11 -0400 (Mon, 15 Jun 2009)
New Revision: 15950
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-4474
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/META-INF/MANIFEST.MF 2009-06-15 11:29:26 UTC (rev 15949)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/META-INF/MANIFEST.MF 2009-06-15 13:09:11 UTC (rev 15950)
@@ -7,30 +7,10 @@
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.jboss.tools.seam.pages.xml;singleton:=true
Bundle-Localization: plugin
-Provide-Package: org.jboss.tools.seam.pages.xml,
- org.jboss.tools.seam.pages.xml.model,
- org.jboss.tools.seam.pages.xml.model.helpers,
- org.jboss.tools.seam.pages.xml.model.handlers,
- org.jboss.tools.seam.pages.xml.model.refactoring,
- org.jboss.tools.seam.pages.xml.model.impl
Require-Bundle: org.jboss.tools.jst.web;visibility:=reexport,
- org.eclipse.ui.ide,
- org.eclipse.ui.views,
- org.eclipse.jface.text,
- org.eclipse.ui.workbench.texteditor,
- org.eclipse.ui.editors,
- org.eclipse.jdt.core,
- org.eclipse.jdt.ui,
org.eclipse.ui,
- org.eclipse.jface,
- org.eclipse.wst.sse.core,
org.eclipse.wst.common.modulecore,
- org.eclipse.ltk.core.refactoring,
- org.eclipse.ltk.ui.refactoring,
- org.eclipse.wst.xml.core,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.wst.web
+ org.eclipse.ltk.core.refactoring
Bundle-Version: 2.0.0
Export-Package: org.jboss.tools.seam.pages.xml,
org.jboss.tools.seam.pages.xml.model,
15 years, 7 months
JBoss Tools SVN: r15949 - in trunk: workingset and 41 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2009-06-15 07:29:26 -0400 (Mon, 15 Jun 2009)
New Revision: 15949
Added:
trunk/workingset/
trunk/workingset/features/
trunk/workingset/features/org.jboss.tools.workingset.feature/
trunk/workingset/features/org.jboss.tools.workingset.feature/.project
trunk/workingset/features/org.jboss.tools.workingset.feature/build.properties
trunk/workingset/features/org.jboss.tools.workingset.feature/feature.xml
trunk/workingset/plugins/
trunk/workingset/plugins/org.jboss.tools.workingset.core/
trunk/workingset/plugins/org.jboss.tools.workingset.core/.classpath
trunk/workingset/plugins/org.jboss.tools.workingset.core/.project
trunk/workingset/plugins/org.jboss.tools.workingset.core/META-INF/
trunk/workingset/plugins/org.jboss.tools.workingset.core/META-INF/MANIFEST.MF
trunk/workingset/plugins/org.jboss.tools.workingset.core/build.properties
trunk/workingset/plugins/org.jboss.tools.workingset.core/plugin.xml
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/Activator.java
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/PreferenceConstants.java
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/internal/
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/internal/core/
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/internal/core/NameToWorkingSet.java
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/internal/core/PreferenceInitializer.java
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/internal/core/StartupHook.java
trunk/workingset/plugins/org.jboss.tools.workingset.ui/
trunk/workingset/plugins/org.jboss.tools.workingset.ui/.classpath
trunk/workingset/plugins/org.jboss.tools.workingset.ui/.project
trunk/workingset/plugins/org.jboss.tools.workingset.ui/.settings/
trunk/workingset/plugins/org.jboss.tools.workingset.ui/.settings/org.eclipse.jdt.core.prefs
trunk/workingset/plugins/org.jboss.tools.workingset.ui/META-INF/
trunk/workingset/plugins/org.jboss.tools.workingset.ui/META-INF/MANIFEST.MF
trunk/workingset/plugins/org.jboss.tools.workingset.ui/build.properties
trunk/workingset/plugins/org.jboss.tools.workingset.ui/plugin.xml
trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/
trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/
trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/jboss/
trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/jboss/tools/
trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/jboss/tools/workingset/
trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/jboss/tools/workingset/internal/
trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/jboss/tools/workingset/internal/ui/
trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/jboss/tools/workingset/internal/ui/WorkingsetPreferencePage.java
trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/jboss/tools/workingset/ui/
trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/jboss/tools/workingset/ui/Activator.java
trunk/workingset/tests/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/.classpath
trunk/workingset/tests/org.jboss.tools.workingset.core.test/.project
trunk/workingset/tests/org.jboss.tools.workingset.core.test/META-INF/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/META-INF/MANIFEST.MF
trunk/workingset/tests/org.jboss.tools.workingset.core.test/bin/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/bin/org/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/bin/org/jboss/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/bin/org/jboss/tools/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/bin/org/jboss/tools/workingset/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/bin/org/jboss/tools/workingset/core/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/bin/org/jboss/tools/workingset/core/test/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/bin/org/jboss/tools/workingset/core/test/GroupingTest.class
trunk/workingset/tests/org.jboss.tools.workingset.core.test/build.properties
trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/org/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/org/jboss/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/org/jboss/tools/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/org/jboss/tools/workingset/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/org/jboss/tools/workingset/core/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/org/jboss/tools/workingset/core/test/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/org/jboss/tools/workingset/core/test/GroupingTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4483
automatic grouping of working sets
Added: trunk/workingset/features/org.jboss.tools.workingset.feature/.project
===================================================================
--- trunk/workingset/features/org.jboss.tools.workingset.feature/.project (rev 0)
+++ trunk/workingset/features/org.jboss.tools.workingset.feature/.project 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.workingset.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/workingset/features/org.jboss.tools.workingset.feature/build.properties
===================================================================
--- trunk/workingset/features/org.jboss.tools.workingset.feature/build.properties (rev 0)
+++ trunk/workingset/features/org.jboss.tools.workingset.feature/build.properties 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1 @@
+bin.includes = feature.xml
Added: trunk/workingset/features/org.jboss.tools.workingset.feature/feature.xml
===================================================================
--- trunk/workingset/features/org.jboss.tools.workingset.feature/feature.xml (rev 0)
+++ trunk/workingset/features/org.jboss.tools.workingset.feature/feature.xml 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.workingset.feature"
+ label="JBoss Tools Working Set "
+ version="1.0.0.qualifier"
+ provider-name="JBoss by Red Hat">
+
+ <description url="http://www.example.com/description">
+ [Enter Feature Description here.]
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
+ [Enter Copyright Description here.]
+ </copyright>
+
+ <license url="http://www.example.com/license">
+ [Enter License Description here.]
+ </license>
+
+ <plugin
+ id="org.jboss.tools.workingset.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.workingset.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Added: trunk/workingset/plugins/org.jboss.tools.workingset.core/.classpath
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.core/.classpath (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.core/.classpath 2009-06-15 11:29:26 UTC (rev 15949)
@@ -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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/workingset/plugins/org.jboss.tools.workingset.core/.project
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.core/.project (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.core/.project 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.workingset.core</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/workingset/plugins/org.jboss.tools.workingset.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.core/META-INF/MANIFEST.MF (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.core/META-INF/MANIFEST.MF 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Working set
+Bundle-SymbolicName: org.jboss.tools.workingset.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.workingset.core.Activator
+Bundle-Vendor: JBoss by Red Hat
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources;bundle-version="3.5.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: org.jboss.tools.workingset.core,
+ org.jboss.tools.workingset.internal.core
Added: trunk/workingset/plugins/org.jboss.tools.workingset.core/build.properties
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.core/build.properties (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.core/build.properties 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
Added: trunk/workingset/plugins/org.jboss.tools.workingset.core/plugin.xml
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.core/plugin.xml (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.core/plugin.xml 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.startup">
+ <startup
+ class="org.jboss.tools.workingset.internal.core.StartupHook">
+ </startup>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.jboss.tools.workingset.internal.core.PreferenceInitializer">
+ </initializer>
+ </extension>
+
+</plugin>
Added: trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/Activator.java
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/Activator.java (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/Activator.java 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,256 @@
+package org.jboss.tools.workingset.core;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.ui.IWorkingSet;
+import org.eclipse.ui.IWorkingSetManager;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.statushandlers.StatusManager;
+import org.jboss.tools.workingset.internal.core.NameToWorkingSet;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.workingset.core";
+
+ // The shared instance
+ private static Activator plugin;
+
+ private class ResourceChangeListener implements IResourceChangeListener {
+ public void resourceChanged(IResourceChangeEvent event) {
+ if (ntws == null || !getDefault().getPreferenceStore().getBoolean(PreferenceConstants.P_ENABLE)) {
+ return;
+ }
+
+ IResourceDelta delta = event.getDelta();
+ IResourceDelta[] affectedChildren = delta.getAffectedChildren(
+ IResourceDelta.ADDED, IResource.PROJECT);
+ if (affectedChildren.length > 0) {
+ IResource[] res = new IResource[affectedChildren.length];
+ for (int i = 0; i < affectedChildren.length; i++) {
+ res[i] = affectedChildren[i].getResource();
+ }
+ updateWorkingsets(res);
+ } /*
+ * else { Since projects can change name and we don't know the
+ * previous 'grouping' we don't update this. Maybe solvable by
+ * simply keeping track on where we put them ? affectedChildren=
+ * delta.getAffectedChildren(IResourceDelta.CHANGED,
+ * IResource.PROJECT); for (int i= 0; i < affectedChildren.length;
+ * i++) { IResourceDelta projectDelta= affectedChildren[i]; if
+ * ((projectDelta.getFlags() & IResourceDelta.DESCRIPTION) != 0) {
+ * updateWorkingsets(new IResourceDelta[] { projectDelta }); // one
+ * is enough return; } } }
+ */
+ }
+ }
+
+ private IResourceChangeListener resourceChangeListener;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ NameToWorkingSet ntws = null;
+
+ protected void updateWorkingsets() {
+ updateWorkingsets(ResourcesPlugin.getWorkspace().getRoot().getProjects());
+
+ }
+ public void updateWorkingsets(IResource[] affectedChildren) {
+ if (ntws == null) {
+ return;
+ }
+
+
+ Map<String, Set<IProject>> groupings = findGroupings(affectedChildren);
+
+ IWorkingSetManager wsManager = getWorkbench().getWorkingSetManager();
+
+ for (String name : groupings.keySet()) {
+ final IWorkingSet workingSet = wsManager.getWorkingSet(name);
+ final Set<IProject> projects = groupings.get(name);
+
+ if (workingSet != null) {
+ IAdaptable[] elements = workingSet.getElements();
+ for (int j = 0; j < elements.length; j++) {
+ IAdaptable element = elements[j];
+ if (element == null) {
+ continue;
+ }
+ IResource resource = (IResource) element
+ .getAdapter(IResource.class);
+ if (resource != null
+ && resource.getType() == IResource.PROJECT) {
+ projects.remove(resource);
+ if (projects.isEmpty()) {
+ break;
+ }
+ }
+ }
+ if (!projects.isEmpty()) {
+ System.out.println("Adding " + projects + " to "
+ + workingSet.getName());
+ SafeRunner.run(new ISafeRunnable() {
+
+ public void run() throws Exception {
+ IAdaptable[] adaptedNewElements = workingSet
+ .adaptElements(projects
+ .toArray(new IAdaptable[projects
+ .size()]));
+ if (adaptedNewElements.length > 0) {
+ IAdaptable[] elements = workingSet
+ .getElements();
+ workingSet.setElements(concat(elements,
+ adaptedNewElements));
+ }
+ }
+
+ public void handleException(Throwable exception) {
+ StatusManager.getManager().handle(
+ new Status(IStatus.WARNING, PLUGIN_ID,
+ "Problem creating workingset "
+ + exception.toString()));
+
+ }
+ });
+
+ }
+ } else {
+ System.out.println("Adding " + projects + " to new" + name);
+
+ IWorkingSet newWs = wsManager.createWorkingSet(name, projects
+ .toArray(new IProject[projects.size()]));
+ newWs.setId("org.eclipse.jdt.ui.JavaWorkingSetPage");
+ wsManager.addWorkingSet(newWs);
+ }
+ }
+ }
+
+ private Map<String, Set<IProject>> findGroupings(
+ IResource[] affectedResources) {
+ Map<String, Set<IProject>> groupings = new HashMap<String, Set<IProject>>();
+
+ for (int i = 0; i < affectedResources.length; i++) {
+
+ IProject prj = (IProject) affectedResources[i];
+
+ String projectName = prj.getName();
+ System.out.println("Examing " + projectName);
+ String[] candidates = ntws.getWorkingSetNames(projectName);
+
+ for (String candidate : candidates) {
+ Set<IProject> set = groupings.get(candidate);
+ if (set == null)
+ set = new HashSet<IProject>();
+ set.add(prj);
+ groupings.put(candidate, set);
+ }
+ }
+ return groupings;
+ }
+
+ @SuppressWarnings("unchecked")
+ static <T> T[] concat(T[] a, T[] b) {
+ final int alen = a.length;
+ final int blen = b.length;
+ final T[] result = (T[]) java.lang.reflect.Array.newInstance(a
+ .getClass().getComponentType(), alen + blen);
+ System.arraycopy(a, 0, result, 0, alen);
+ System.arraycopy(b, 0, result, alen, blen);
+ return result;
+ }
+
+ /*
+ * (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;
+
+ IPropertyChangeListener propertyListener = new IPropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent event) {
+ if(event.getProperty().equals(PreferenceConstants.P_PATTERNS)) {
+ ntws = null;
+
+ NameToWorkingSet x = new NameToWorkingSet();
+
+ String newValue = (String) event.getNewValue();
+
+ String[] lines = newValue.split(";");
+ for (int i = 0; i < lines.length; i++) {
+ String[] string = lines[i].split(",");
+ try {
+ x.add(string[0], string[1], Boolean.parseBoolean(string[2]));
+ } catch(Exception e) {
+ // ignore
+ }
+ }
+ ntws = x;
+
+ updateWorkingsets();
+ }
+
+ }
+ };
+
+ getDefault().getPreferenceStore().addPropertyChangeListener(propertyListener);
+
+ resourceChangeListener = new ResourceChangeListener();
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(
+ resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+
+
+ }
+
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+ * )
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/PreferenceConstants.java
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/PreferenceConstants.java (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/PreferenceConstants.java 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,11 @@
+package org.jboss.tools.workingset.core;
+
+/**
+ * Constant definitions for plug-in preferences
+ */
+public class PreferenceConstants {
+
+ public static final String P_ENABLE = "enable_automatic_workingsets";
+ public static final String P_PATTERNS = "workingset_patterns";
+
+}
Added: trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/internal/core/NameToWorkingSet.java
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/internal/core/NameToWorkingSet.java (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/internal/core/NameToWorkingSet.java 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,70 @@
+package org.jboss.tools.workingset.internal.core;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class NameToWorkingSet {
+
+ final private List<PatternInfo> patterns = new ArrayList<PatternInfo>();
+
+ static class PatternInfo {
+
+ PatternInfo(String patternString, String replacePattern, boolean exclusive) {
+ this.patternString = patternString;
+ this.replacePattern = replacePattern;
+ this.exclusive = exclusive;
+ this.pattern = Pattern.compile(patternString);
+ }
+
+ public String getPatternString() {
+ return patternString;
+ }
+ public String getReplacePattern() {
+ return replacePattern;
+ }
+ public boolean isExclusive() {
+ return exclusive;
+ }
+ public Pattern getPattern() {
+ return pattern;
+ }
+ String patternString;
+ String replacePattern;
+ boolean exclusive;
+ Pattern pattern;
+ }
+ public NameToWorkingSet() {
+
+ }
+
+ public void add(String pattern, String replacePattern, boolean exclusive) {
+ patterns.add(new PatternInfo(pattern, replacePattern, exclusive));
+ }
+
+ public void clear() {
+ patterns.clear();
+ }
+
+ public String[] getWorkingSetNames(String name) {
+
+ Set<String> names = new HashSet<String>();
+
+ for (PatternInfo pattern : patterns) {
+ Matcher matcher = pattern.pattern.matcher(name);
+ boolean matchFound = matcher.find();
+
+ if (matchFound) {
+ names.add(matcher.replaceFirst(pattern.replacePattern));
+ if(pattern.exclusive) { break; }
+ }
+ }
+
+ return names.toArray(new String[names.size()]);
+ }
+
+
+}
Added: trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/internal/core/PreferenceInitializer.java
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/internal/core/PreferenceInitializer.java (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/internal/core/PreferenceInitializer.java 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,34 @@
+package org.jboss.tools.workingset.internal.core;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+import org.jboss.tools.workingset.core.Activator;
+import org.jboss.tools.workingset.core.PreferenceConstants;
+
+/**
+ * Class used to initialize default preference values.
+ */
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#
+ * initializeDefaultPreferences()
+ */
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ store.setDefault(PreferenceConstants.P_ENABLE, false);
+ store
+ .setDefault(
+ PreferenceConstants.P_PATTERNS,
+ "org\\.([^\\.]+).*,$1,false" // major group, eclipse, jboss, hibernate, etc.
+ //+ ";org\\.hibernate\\.eclipse\\.([^\\.]+).*,hibernate,true" // put hibernate tools in hibernate, not needed when grouping globally
+ + ";org\\.jboss\\.ide\\.eclipse\\.([^\\.]+).*,$1,true" // put as and archives in their own group
+ //+ ";org\\.jbpm\\.gd\\.([^\\.]+).*,jbpm,true"
+ + ";org\\.jboss\\.tools\\.([^\\.]+).*,$1-jbt,true" // split out group for jboss tools
+ + ";org\\.eclipse\\.([^\\.]+).*,$1-eclipse,true"); // split out group for eclipse
+
+ }
+}
Added: trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/internal/core/StartupHook.java
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/internal/core/StartupHook.java (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/internal/core/StartupHook.java 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,12 @@
+package org.jboss.tools.workingset.internal.core;
+
+import org.eclipse.ui.IStartup;
+
+public class StartupHook implements IStartup {
+
+ public void earlyStartup() {
+ System.out.println("Started...");
+
+ }
+
+}
Added: trunk/workingset/plugins/org.jboss.tools.workingset.ui/.classpath
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.ui/.classpath (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.ui/.classpath 2009-06-15 11:29:26 UTC (rev 15949)
@@ -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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/workingset/plugins/org.jboss.tools.workingset.ui/.project
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.ui/.project (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.ui/.project 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.workingset.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/workingset/plugins/org.jboss.tools.workingset.ui/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.ui/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.ui/.settings/org.eclipse.jdt.core.prefs 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,8 @@
+#Mon Jun 15 12:39:29 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/workingset/plugins/org.jboss.tools.workingset.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.ui/META-INF/MANIFEST.MF (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.ui/META-INF/MANIFEST.MF 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Working set tools
+Bundle-SymbolicName: org.jboss.tools.workingset.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.workingset.ui.Activator
+Bundle-Vendor: JBoss by Red Hat
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.workingset.core;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
Added: trunk/workingset/plugins/org.jboss.tools.workingset.ui/build.properties
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.ui/build.properties (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.ui/build.properties 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
Added: trunk/workingset/plugins/org.jboss.tools.workingset.ui/plugin.xml
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.ui/plugin.xml (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.ui/plugin.xml 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ class="org.jboss.tools.workingset.internal.ui.WorkingsetPreferencePage"
+ id="org.jboss.tools.workingsets.internal.ui.preferences.WorkingsetPreferencePage"
+ name="Automatic WorkingSets">
+ </page>
+ </extension>
+</plugin>
Added: trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/jboss/tools/workingset/internal/ui/WorkingsetPreferencePage.java
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/jboss/tools/workingset/internal/ui/WorkingsetPreferencePage.java (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/jboss/tools/workingset/internal/ui/WorkingsetPreferencePage.java 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,96 @@
+package org.jboss.tools.workingset.internal.ui;
+
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.ListEditor;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.jboss.tools.workingset.core.PreferenceConstants;
+import org.jboss.tools.workingset.ui.Activator;
+
+public class WorkingsetPreferencePage
+ extends FieldEditorPreferencePage
+ implements IWorkbenchPreferencePage {
+
+ public WorkingsetPreferencePage() {
+ super(GRID);
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setDescription("Setup automatic grouping of projects into working sets that matches a regular expression.");
+ }
+
+ public void createFieldEditors() {
+
+ addField(new ListEditor(PreferenceConstants.P_PATTERNS,"Grouping patterns", getFieldEditorParent()) {
+
+ @Override
+ protected String[] parseString(String stringList) {
+ if(stringList.trim().length()>0) {
+ return stringList.split(";");
+ } else {
+ return new String[0];
+ }
+ }
+
+ @Override
+ protected String getNewInputObject() {
+
+ InputDialog dialog = new InputDialog(getShell(), "Add new pattern", "Syntax: <pattern>, <replace pattern>, <exclusive:true|false>", "org\\.jboss\\.tools\\.([^\\.]+).*,$1,true", new IInputValidator() {
+
+ public String isValid(String newText) {
+ String[] split = newText.split(",");
+ if(split.length!=3) {
+ return "Pattern does not consist 3 parts separated by commas";
+ }
+ try {
+ Pattern.compile(split[0]);
+ } catch(PatternSyntaxException pse) {
+ return "Pattern does not compile: " + pse.getDescription();
+ }
+ if(!split[2].equals("true") && !split[2].equals("false")) {
+ return "Exclusive needs to be true or false";
+ }
+
+ return null;
+ }
+ });
+
+ if(dialog.open()==InputDialog.OK) {
+ return dialog.getValue();
+ } else {
+ return null;
+ }
+
+ }
+
+ @Override
+ protected String createList(String[] items) {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < items.length; i++) {
+ String string = items[i];
+ sb.append(string);
+ if(i<items.length) sb.append(";");
+ }
+ return sb.toString();
+ }
+ });
+
+ addField(
+ new BooleanFieldEditor(
+ PreferenceConstants.P_ENABLE,
+ "Automatic grouping of projects",
+ getFieldEditorParent()));
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench workbench) {
+ }
+
+}
\ No newline at end of file
Added: trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/jboss/tools/workingset/ui/Activator.java
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/jboss/tools/workingset/ui/Activator.java (rev 0)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.ui/src/org/jboss/tools/workingset/ui/Activator.java 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,50 @@
+package org.jboss.tools.workingset.ui;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.workingset.ui";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: trunk/workingset/tests/org.jboss.tools.workingset.core.test/.classpath
===================================================================
--- trunk/workingset/tests/org.jboss.tools.workingset.core.test/.classpath (rev 0)
+++ trunk/workingset/tests/org.jboss.tools.workingset.core.test/.classpath 2009-06-15 11:29:26 UTC (rev 15949)
@@ -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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/workingset/tests/org.jboss.tools.workingset.core.test/.project
===================================================================
--- trunk/workingset/tests/org.jboss.tools.workingset.core.test/.project (rev 0)
+++ trunk/workingset/tests/org.jboss.tools.workingset.core.test/.project 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.workingset.core.test</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/workingset/tests/org.jboss.tools.workingset.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/workingset/tests/org.jboss.tools.workingset.core.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/workingset/tests/org.jboss.tools.workingset.core.test/META-INF/MANIFEST.MF 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Working set tests
+Bundle-SymbolicName: org.jboss.tools.workingset.core.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: JBoss by Red Hat
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.junit4;bundle-version="4.5.0",
+ org.jboss.tools.workingset.core;bundle-version="1.0.0",
+ org.jboss.tools.workingset.ui;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
Added: trunk/workingset/tests/org.jboss.tools.workingset.core.test/bin/org/jboss/tools/workingset/core/test/GroupingTest.class
===================================================================
(Binary files differ)
Property changes on: trunk/workingset/tests/org.jboss.tools.workingset.core.test/bin/org/jboss/tools/workingset/core/test/GroupingTest.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/workingset/tests/org.jboss.tools.workingset.core.test/build.properties
===================================================================
--- trunk/workingset/tests/org.jboss.tools.workingset.core.test/build.properties (rev 0)
+++ trunk/workingset/tests/org.jboss.tools.workingset.core.test/build.properties 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/org/jboss/tools/workingset/core/test/GroupingTest.java
===================================================================
--- trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/org/jboss/tools/workingset/core/test/GroupingTest.java (rev 0)
+++ trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/org/jboss/tools/workingset/core/test/GroupingTest.java 2009-06-15 11:29:26 UTC (rev 15949)
@@ -0,0 +1,63 @@
+package org.jboss.tools.workingset.core.test;
+
+import static org.junit.Assert.assertEquals;
+
+import org.jboss.tools.workingset.internal.core.NameToWorkingSet;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class GroupingTest {
+
+ static NameToWorkingSet nws = new NameToWorkingSet();
+
+ @BeforeClass
+ static public void setup() {
+
+ nws.add("org\\.jboss\\.tools\\.([^\\.]+).*", "$1", true);
+ nws.add("org\\.eclipse\\.([^\\.]+).*", "eclipse", false);
+ nws.add("org\\.eclipse\\.([^\\.]+).*", "$1", true);
+ nws.add("org\\.eclipse\\.([^\\.]+).*", "shouldnotbeseen", false);
+
+ }
+
+ @Test
+ public void testNoMatch() {
+
+ assertEquals(nws.getWorkingSetNames("org.jboss.tools").length,0);
+ String[] ws = nws.getWorkingSetNames("org.jboss.tools.vpe");
+ assertEquals(1,ws.length);
+ assertEquals("vpe",ws[0]);
+
+ }
+
+ @Test
+ public void testSingleMatch() {
+ String[] ws = nws.getWorkingSetNames("org.jboss.tools.vpe.test");
+ assertEquals(1,ws.length);
+ assertEquals("vpe",ws[0]);
+
+ ws = nws.getWorkingSetNames("org.jboss.tools.vpe.ui.test");
+ assertEquals(1,ws.length);
+ assertEquals("vpe",ws[0]);
+
+ ws = nws.getWorkingSetNames("org.jboss.tools.hibernate.ui.test");
+ assertEquals(1,ws.length);
+ assertEquals("hibernate",ws[0]);
+
+ ws = nws.getWorkingSetNames("org.eclipse.jdt");
+ assertEquals(2,ws.length);
+ assertEquals("eclipse",ws[0]);
+ assertEquals("jdt",ws[1]);
+
+ }
+
+ @Test
+ public void testMultiMatch() {
+ String[] ws = nws.getWorkingSetNames("org.eclipse.jdt.ui");
+ assertEquals(2,ws.length);
+ assertEquals("eclipse",ws[0]);
+ assertEquals("jdt",ws[1]);
+
+ }
+
+ }
15 years, 7 months
JBoss Tools SVN: r15948 - in trunk: profiler and 16 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2009-06-15 07:23:29 -0400 (Mon, 15 Jun 2009)
New Revision: 15948
Added:
trunk/profiler/
trunk/profiler/features/
trunk/profiler/features/org.jboss.tools.profiler.feature/
trunk/profiler/features/org.jboss.tools.profiler.feature/.project
trunk/profiler/features/org.jboss.tools.profiler.feature/build.properties
trunk/profiler/features/org.jboss.tools.profiler.feature/feature.xml
trunk/profiler/plugins/
trunk/profiler/plugins/org.jboss.tools.profiler.ui/
trunk/profiler/plugins/org.jboss.tools.profiler.ui/.classpath
trunk/profiler/plugins/org.jboss.tools.profiler.ui/.project
trunk/profiler/plugins/org.jboss.tools.profiler.ui/META-INF/
trunk/profiler/plugins/org.jboss.tools.profiler.ui/META-INF/MANIFEST.MF
trunk/profiler/plugins/org.jboss.tools.profiler.ui/build.properties
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/JBossORG-EULA.txt
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/README.txt
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/concurrent.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/copyright.txt
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/ejb3-persistence.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/javassist.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-common.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-ejb3x.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-ant.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-client.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-client.properties
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-connectors.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-embedded.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-plugins.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-test.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler.properties
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler.sar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-remoting.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jbossall-client.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/lgpl.html
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/log4j.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/log4j.xml
trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/servlet.jar
trunk/profiler/plugins/org.jboss.tools.profiler.ui/plugin.xml
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/JBossProfilerUiPlugin.java
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/Messages.java
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/JBossProfilerLaunchDelegate.java
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/JBossProfilerLauncherConstants.java
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/LaunchListener.java
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/LaunchTabGroupJUnit.java
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/LaunchUtils.java
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/Messages.java
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/messages.properties
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/BaseBlock.java
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/BaseLaunchConfigurationTab.java
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/JBossProfilerTab.java
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/JarBlock.java
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/LaunchTabGroup.java
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/PropertiesBlock.java
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/messages.properties
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/util/
trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/util/FileNameFilter.java
trunk/profiler/tests/
Log:
https://jira.jboss.org/jira/browse/JBIDE-249
JBoss Profiler support
Added: trunk/profiler/features/org.jboss.tools.profiler.feature/.project
===================================================================
--- trunk/profiler/features/org.jboss.tools.profiler.feature/.project (rev 0)
+++ trunk/profiler/features/org.jboss.tools.profiler.feature/.project 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.profiler.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/profiler/features/org.jboss.tools.profiler.feature/build.properties
===================================================================
--- trunk/profiler/features/org.jboss.tools.profiler.feature/build.properties (rev 0)
+++ trunk/profiler/features/org.jboss.tools.profiler.feature/build.properties 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1 @@
+bin.includes = feature.xml
Added: trunk/profiler/features/org.jboss.tools.profiler.feature/feature.xml
===================================================================
--- trunk/profiler/features/org.jboss.tools.profiler.feature/feature.xml (rev 0)
+++ trunk/profiler/features/org.jboss.tools.profiler.feature/feature.xml 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.profiler.feature"
+ label="JBoss Profiler"
+ version="1.0.0.qualifier"
+ provider-name="JBoss by Red Hat">
+
+ <description url="http://www.example.com/description">
+ [Enter Feature Description here.]
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
+ [Enter Copyright Description here.]
+ </copyright>
+
+ <license url="http://www.example.com/license">
+ [Enter License Description here.]
+ </license>
+
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.debug.ui" version="3.5.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.core.variables" version="3.2.200" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.ui.ide" version="3.5.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.core.filesystem" version="1.2.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.jdt.debug.ui" version="3.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.jdt.junit" version="3.5.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.jdt.launching" version="3.5.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.jboss.tools.profiler.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/.classpath
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/.classpath (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/.classpath 2009-06-15 11:23:29 UTC (rev 15948)
@@ -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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/.project
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/.project (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/.project 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.profiler.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/profiler/plugins/org.jboss.tools.profiler.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/META-INF/MANIFEST.MF (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/META-INF/MANIFEST.MF 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,21 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: JBoss Profiler
+Bundle-SymbolicName: org.jboss.tools.profiler.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.profiler.internal.ui.JBossProfilerUiPlugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.debug.ui;bundle-version="3.5.0",
+ org.eclipse.core.variables;bundle-version="3.2.200",
+ org.eclipse.ui.ide;bundle-version="3.5.0",
+ org.eclipse.core.filesystem;bundle-version="1.2.0",
+ org.eclipse.jdt.debug.ui;bundle-version="3.4.0",
+ org.eclipse.jdt.junit;bundle-version="3.5.0",
+ org.eclipse.jdt.launching;bundle-version="3.5.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.jboss.tools.profiler.internal.ui,
+ org.jboss.tools.profiler.internal.ui.launch,
+ org.jboss.tools.profiler.internal.ui.launchtabs,
+ org.jboss.tools.profiler.internal.ui.util
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/build.properties
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/build.properties (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/build.properties 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ embedded/
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/JBossORG-EULA.txt
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/JBossORG-EULA.txt (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/JBossORG-EULA.txt 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,107 @@
+LICENSE AGREEMENT
+JBOSS(r)
+
+This License Agreement governs the use of the Software Packages and any updates to the Software
+Packages, regardless of the delivery mechanism. Each Software Package is a collective work
+under U.S. Copyright Law. Subject to the following terms, Red Hat, Inc. ("Red Hat") grants to
+the user ("Client") a license to the applicable collective work(s) pursuant to the
+GNU Lesser General Public License v. 2.1 except for the following Software Packages:
+(a) JBoss Portal Forums and JBoss Transactions JTS, each of which is licensed pursuant to the
+GNU General Public License v.2;
+
+(b) JBoss Rules, which is licensed pursuant to the Apache License v.2.0;
+
+(c) an optional download for JBoss Cache for the Berkeley DB for Java database, which is licensed under the
+(open source) Sleepycat License (if Client does not wish to use the open source version of this database,
+it may purchase a license from Sleepycat Software);
+
+and (d) the BPEL extension for JBoss jBPM, which is licensed under the Common Public License v.1,
+and, pursuant to the OASIS BPEL4WS standard, requires parties wishing to redistribute to enter various
+royalty-free patent licenses.
+
+Each of the foregoing licenses is available at http://www.opensource.org/licenses/index.php.
+
+1. The Software. "Software Packages" refer to the various software modules that are created and made available
+for distribution by the JBoss.org open source community at http://www.jboss.org. Each of the Software Packages
+may be comprised of hundreds of software components. The end user license agreement for each component is located in
+the component's source code. With the exception of certain image files identified in Section 2 below,
+the license terms for the components permit Client to copy, modify, and redistribute the component,
+in both source code and binary code forms. This agreement does not limit Client's rights under,
+or grant Client rights that supersede, the license terms of any particular component.
+
+2. Intellectual Property Rights. The Software Packages are owned by Red Hat and others and are protected under copyright
+and other laws. Title to the Software Packages and any component, or to any copy, modification, or merged portion shall
+remain with the aforementioned, subject to the applicable license. The "JBoss" trademark, "Red Hat" trademark, the
+individual Software Package trademarks, and the "Shadowman" logo are registered trademarks of Red Hat and its affiliates
+in the U.S. and other countries. This agreement permits Client to distribute unmodified copies of the Software Packages
+using the Red Hat trademarks that Red Hat has inserted in the Software Packages on the condition that Client follows Red Hat's
+trademark guidelines for those trademarks located at http://www.redhat.com/about/corporate/trademark/. Client must abide by
+these trademark guidelines when distributing the Software Packages, regardless of whether the Software Packages have been modified.
+If Client modifies the Software Packages, then Client must replace all Red Hat trademarks and logos identified at
+http://www.jboss.com/company/logos, unless a separate agreement with Red Hat is executed or other permission granted.
+Merely deleting the files containing the Red Hat trademarks may corrupt the Software Packages.
+
+3. Limited Warranty. Except as specifically stated in this Paragraph 3 or a license for a particular
+component, to the maximum extent permitted under applicable law, the Software Packages and the
+components are provided and licensed "as is" without warranty of any kind, expressed or implied,
+including the implied warranties of merchantability, non-infringement or fitness for a particular purpose.
+Red Hat warrants that the media on which Software Packages may be furnished will be free from defects in
+materials and manufacture under normal use for a period of 30 days from the date of delivery to Client.
+Red Hat does not warrant that the functions contained in the Software Packages will meet Client's requirements
+or that the operation of the Software Packages will be entirely error free or appear precisely as described
+in the accompanying documentation. This warranty extends only to the party that purchases the Services
+pertaining to the Software Packages from Red Hat or a Red Hat authorized distributor.
+
+4. Limitation of Remedies and Liability. To the maximum extent permitted by applicable law, the remedies
+described below are accepted by Client as its only remedies. Red Hat's entire liability, and Client's
+exclusive remedies, shall be: If the Software media is defective, Client may return it within 30 days of
+delivery along with a copy of Client's payment receipt and Red Hat, at its option, will replace it or
+refund the money paid by Client for the Software. To the maximum extent permitted by applicable law,
+Red Hat or any Red Hat authorized dealer will not be liable to Client for any incidental or consequential
+damages, including lost profits or lost savings arising out of the use or inability to use the Software,
+even if Red Hat or such dealer has been advised of the possibility of such damages. In no event shall
+Red Hat's liability under this agreement exceed the amount that Client paid to Red Hat under this
+Agreement during the twelve months preceding the action.
+
+5. Export Control. As required by U.S. law, Client represents and warrants that it:
+(a) understands that the Software Packages are subject to export controls under the
+U.S. Commerce Department's Export Administration Regulations ("EAR");
+
+(b) is not located in a prohibited destination country under the EAR or U.S. sanctions regulations
+(currently Cuba, Iran, Iraq, Libya, North Korea, Sudan and Syria);
+
+(c) will not export, re-export, or transfer the Software Packages to any prohibited destination, entity,
+or individual without the necessary export license(s) or authorizations(s) from the U.S. Government;
+
+(d) will not use or transfer the Software Packages for use in any sensitive nuclear, chemical or
+biological weapons, or missile technology end-uses unless authorized by the U.S. Government by
+regulation or specific license;
+
+(e) understands and agrees that if it is in the United States and exports or transfers the Software
+Packages to eligible end users, it will, as required by EAR Section 740.17(e), submit semi-annual
+reports to the Commerce Department's Bureau of Industry & Security (BIS), which include the name and
+address (including country) of each transferee;
+
+and (f) understands that countries other than the United States may restrict the import, use, or
+export of encryption products and that it shall be solely responsible for compliance with any such
+import, use, or export restrictions.
+
+6. Third Party Programs. Red Hat may distribute third party software programs with the Software Packages
+that are not part of the Software Packages and which Client must install separately. These third party
+programs are subject to their own license terms. The license terms either accompany the programs or
+can be viewed at http://www.redhat.com/licenses/. If Client does not agree to abide by the applicable
+license terms for such programs, then Client may not install them. If Client wishes to install the programs
+on more than one system or transfer the programs to another party, then Client must contact the licensor
+of the programs.
+
+7. General. If any provision of this agreement is held to be unenforceable, that shall not affect the
+enforceability of the remaining provisions. This License Agreement shall be governed by the laws of the
+State of North Carolina and of the United States, without regard to any conflict of laws provisions,
+except that the United Nations Convention on the International Sale of Goods shall not apply.
+
+Copyright 2006 Red Hat, Inc. All rights reserved.
+"JBoss" and the JBoss logo are registered trademarks of Red Hat, Inc.
+All other trademarks are the property of their respective owners.
+
+ Page 1 of 1 18 October 2006
+
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/README.txt
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/README.txt (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/README.txt 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,84 @@
+JBoss Profiler 2
+================
+
+JBoss Profiler 2 is a 100% pure Java profiler capable of profiling
+Java Enterprise 5 applications.
+
+Overview:
+---------
+ * 100% Pure Java
+
+ * Integration with JBoss Enterprise Middleware Suite (JEMS)
+
+ * Access through multiple protocols using JBoss Remoting
+ x Socket
+ x Remote Method Invocation (RMI)
+ x Hyper Text Transport Protocol (HTTP)
+
+ * Reports
+ x Overview
+ x Packages
+ x Classes
+ x Methods
+ x Hotspots
+ x Caller
+ x Wait time
+ x PerThread
+ x PerClass
+
+ * Able to specify method visibility
+ x Global
+ x Package
+ x Class
+
+ * Component identification
+ x Plain Old Java Object (POJO)
+ x java.lang.Throwable
+ x Enterprise JavaBean: Entity
+ x Enterprise JavaBean: Session
+ x Enterprise JavaBean: Message
+ x Servlet
+ x Servlet filter
+ x JavaServer Pages
+ x JMX MBean
+ x JavaServer Faces Converter
+ x JavaServer Faces Managed Bean
+ x RMI: Remote
+ x RMI: Server
+ x CORBA: Object
+ x CORBA: Servant
+ x 3rd party plugins
+
+ * Compare snapshots
+
+ * Client
+ x Ant integration
+ x Command line
+
+
+JBoss Profiler 2 was designed to run on the JBoss Application Server 4.2 and JBoss Application Server 5.0
+releases or any other Java applications using Java Runtime Environment 5 or higher.
+
+User guide:
+-----------
+See the user's guide for more information about installation, configuration and running
+the profiler.
+
+The JBoss Profiler 2 user guide is located in JBossProfiler2-UsersGuide.pdf.
+
+Developer guide:
+----------------
+See the developer guide for more information about extending the profiler with new
+functionality.
+
+The JBoss Profiler 2 developer guide is located in JBossProfiler2-DevelopersGuide.pdf.
+
+
+Development:
+------------
+Home : http://www.jboss.org/jbossprofiler/
+Download : http://www.jboss.org/jbossprofiler/downloads/
+Forum : http://www.jboss.org/index.html?module=bb&op=viewforum&f=199
+Issue tracking: http://jira.jboss.com/jira/browse/JBPROFILER
+AnonSVN : http://anonsvn.jboss.org/repos/jbossprofiler/branches/JBossProfiler2
+Developer SVN : https://svn.jboss.org/repos/jbossprofiler/branches/JBossProfiler2
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/concurrent.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/concurrent.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/copyright.txt
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/copyright.txt (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/copyright.txt 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,4 @@
+Authors:
+--------
+Jesper Pedersen <jesper.pedersen(a)jboss.org>
+
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/ejb3-persistence.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/ejb3-persistence.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/javassist.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/javassist.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-common.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-common.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-ejb3x.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-ejb3x.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-ant.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-ant.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-client.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-client.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-client.properties
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-client.properties (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-client.properties 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,7 @@
+protocol=socket
+host=localhost
+port=5400
+threshold=1.0
+savelocation=.
+plugin.1=org.jboss.profiler.plugins.Hibernate
+plugin.2=org.jboss.profiler.plugins.Seam
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-connectors.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-connectors.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-embedded.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-embedded.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-plugins.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-plugins.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-test.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler-test.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler.properties
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler.properties (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler.properties 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,23 @@
+enable=yes
+cpu=yes
+memory=yes
+includes=org.jboss.profiler.*
+excludes=*
+visibility=private
+save=yes
+startup=yes
+repository=no
+remote=no
+store=memory
+location=.
+host=localhost
+port=5400
+ejb=yes
+servlet=yes
+jsf=yes
+jmx=yes
+rmi=yes
+corba=yes
+plugin.1=org.jboss.profiler.plugins.Hibernate
+plugin.2=org.jboss.profiler.plugins.Seam
+savelocation=C:/Users/max/runtime-New_configuration/test
\ No newline at end of file
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler.sar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-profiler.sar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-remoting.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jboss-remoting.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jbossall-client.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/jbossall-client.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/lgpl.html
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/lgpl.html (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/lgpl.html 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,350 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <title>Appendix A. GNU Lesser General Public License</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1a"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="appendix" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="lgpl"></a>GNU Lesser General Public License</h1></div><div><p class="releaseinfo">This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.</p></div><div><p class="copyright">Copyright © 1991, 1999 Free Software Foundation, Inc.</p></div><div><div class="legalnotice"><a name="gpl-legalnotice"></a><p>
+ </p><div class="address"><p>Free Software Foundation, Inc.<br>
+ <span class="street">51 Franklin Street, Fifth Floor</span>,<br>
+ <span class="city">Boston</span>,<br>
+ <span class="state">MA</span><br>
+ <span class="postcode">02110-1301</span><br>
+ <span class="country">USA</span><br>
+ </p></div><p>
+ </p><p>Everyone is permitted to copy and distribute verbatim
+ copies of this license document, but changing it is not
+ allowed.</p></div></div><div><p class="pubdate">Version 2.1, February 1999</p></div></div></div>
+<div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="lgpl-1"></a>Preamble</h2></div></div></div><p>The licenses for most software are designed to take away your
+ freedom to share and change it. By contrast, the GNU General Public
+ Licenses are intended to guarantee your freedom to share and change
+ free software--to make sure the software is free for all its users.</p><p>This license, the Lesser General Public License, applies to some
+ specially designated software packages--typically libraries--of the
+ Free Software Foundation and other authors who decide to use it. You
+ can use it too, but we suggest you first think carefully about whether
+ this license or the ordinary General Public License is the better
+ strategy to use in any particular case, based on the explanations below.</p><p>When we speak of free software, we are referring to freedom of use,
+ not price. Our General Public Licenses are designed to make sure that
+ you have the freedom to distribute copies of free software (and charge
+ for this service if you wish); that you receive source code or can get
+ it if you want it; that you can change the software and use pieces of
+ it in new free programs; and that you are informed that you can do
+ these things.</p><p>To protect your rights, we need to make restrictions that forbid
+ distributors to deny you these rights or to ask you to surrender these
+ rights. These restrictions translate to certain responsibilities for
+ you if you distribute copies of the library or if you modify it.</p><p>For example, if you distribute copies of the library, whether gratis
+ or for a fee, you must give the recipients all the rights that we gave
+ you. You must make sure that they, too, receive or can get the source
+ code. If you link other code with the library, you must provide
+ complete object files to the recipients, so that they can relink them
+ with the library after making changes to the library and recompiling
+ it. And you must show them these terms so they know their rights.</p><p>We protect your rights with a two-step method:
+ </p><div class="orderedlist"><ol type="1"><li><p>we copyright the library, and</p></li><li><p>we offer you this license, which gives you legal
+ permission to copy, distribute and/or modify the library.</p></li></ol></div><p>
+ </p><p>To protect each distributor, we want to make it very clear that
+ there is no warranty for the free library. Also, if the library is
+ modified by someone else and passed on, the recipients should know
+ that what they have is not the original version, so that the original
+ author's reputation will not be affected by problems that might be
+ introduced by others.</p><p>Finally, software patents pose a constant threat to the existence of
+ any free program. We wish to make sure that a company cannot
+ effectively restrict the users of a free program by obtaining a
+ restrictive license from a patent holder. Therefore, we insist that
+ any patent license obtained for a version of the library must be
+ consistent with the full freedom of use specified in this license.</p><p>Most GNU software, including some libraries, is covered by the
+ ordinary GNU General Public License. This license, the GNU Lesser
+ General Public License, applies to certain designated libraries, and
+ is quite different from the ordinary General Public License. We use
+ this license for certain libraries in order to permit linking those
+ libraries into non-free programs.</p><p>When a program is linked with a library, whether statically or using
+ a shared library, the combination of the two is legally speaking a
+ combined work, a derivative of the original library. The ordinary
+ General Public License therefore permits such linking only if the
+ entire combination fits its criteria of freedom. The Lesser General
+ Public License permits more lax criteria for linking other code with
+ the library.</p><p>We call this license the <span class="emphasis"><em>Lesser</em></span> General Public License because it
+ does Less to protect the user's freedom than the ordinary General
+ Public License. It also provides other free software developers Less
+ of an advantage over competing non-free programs. These disadvantages
+ are the reason we use the ordinary General Public License for many
+ libraries. However, the Lesser license provides advantages in certain
+ special circumstances.</p><p>For example, on rare occasions, there may be a special need to
+ encourage the widest possible use of a certain library, so that it becomes
+ a de-facto standard. To achieve this, non-free programs must be
+ allowed to use the library. A more frequent case is that a free
+ library does the same job as widely used non-free libraries. In this
+ case, there is little to gain by limiting the free library to free
+ software only, so we use the Lesser General Public License.</p><p>In other cases, permission to use a particular library in non-free
+ programs enables a greater number of people to use a large body of
+ free software. For example, permission to use the GNU C Library in
+ non-free programs enables many more people to use the whole GNU
+ operating system, as well as its variant, the GNU/Linux operating
+ system.</p><p>Although the Lesser General Public License is Less protective of the
+ users' freedom, it does ensure that the user of a program that is
+ linked with the Library has the freedom and the wherewithal to run
+ that program using a modified version of the Library.</p><p>The precise terms and conditions for copying, distribution and
+ modification follow. Pay close attention to the difference between a
+ “<span class="quote">work based on the library</span>” and a “<span class="quote">work that uses the library</span>”. The
+ former contains code derived from the library, whereas the latter must
+ be combined with the library in order to run.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="lgpl-2"></a>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</h2></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-0"></a>Section 0</h3></div></div></div><p>This License Agreement applies to any software library or other
+ program which contains a notice placed by the copyright holder or
+ other authorized party saying it may be distributed under the terms of
+ this Lesser General Public License (also called “<span class="quote">this License</span>”).
+ Each licensee is addressed as “<span class="quote">you</span>”.</p><p>A “<span class="quote">library</span>” means a collection of software functions and/or data
+ prepared so as to be conveniently linked with application programs
+ (which use some of those functions and data) to form executables.</p><p>The “<span class="quote">Library</span>”, below, refers to any such software library or work
+ which has been distributed under these terms. A “<span class="quote">work based on the
+ Library</span>” means either the Library or any derivative work under
+ copyright law: that is to say, a work containing the Library or a
+ portion of it, either verbatim or with modifications and/or translated
+ straightforwardly into another language. (Hereinafter, translation is
+ included without limitation in the term “<span class="quote">modification</span>”.)</p><p>“<span class="quote">Source code</span>” for a work means the preferred form of the work for
+ making modifications to it. For a library, complete source code means
+ all the source code for all modules it contains, plus any associated
+ interface definition files, plus the scripts used to control compilation
+ and installation of the library.</p><p>Activities other than copying, distribution and modification are not
+ covered by this License; they are outside its scope. The act of
+ running a program using the Library is not restricted, and output from
+ such a program is covered only if its contents constitute a work based
+ on the Library (independent of the use of the Library in a tool for
+ writing it). Whether that is true depends on what the Library does
+ and what the program that uses the Library does.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-1"></a>Section 1</h3></div></div></div><p>You may copy and distribute verbatim copies of the Library's
+ complete source code as you receive it, in any medium, provided that
+ you conspicuously and appropriately publish on each copy an
+ appropriate copyright notice and disclaimer of warranty; keep intact
+ all the notices that refer to this License and to the absence of any
+ warranty; and distribute a copy of this License along with the
+ Library.</p><p>You may charge a fee for the physical act of transferring a copy,
+ and you may at your option offer warranty protection in exchange for a
+ fee.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-2"></a>Section 2</h3></div></div></div><p>You may modify your copy or copies of the Library or any portion
+ of it, thus forming a work based on the Library, and copy and
+ distribute such modifications or work under the terms of <a href="#lgpl-2-1" title="Section 1">Section 1</a>
+ above, provided that you also meet all of these conditions:
+ </p><div class="orderedlist"><ol type="a"><li><p>The modified work must itself be a software library.</p></li><li><p>You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.</p></li><li><p>You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.</p></li><li><p><a name="lgpl-2-2-d"></a>If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.</p><p>(For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, <a href="#lgpl-2-2-d">Subsection 2d</a> requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)</p></li></ol></div><p>
+ </p><p>These requirements apply to the modified work as a whole. If
+ identifiable sections of that work are not derived from the Library,
+ and can be reasonably considered independent and separate works in
+ themselves, then this License, and its terms, do not apply to those
+ sections when you distribute them as separate works. But when you
+ distribute the same sections as part of a whole which is a work based
+ on the Library, the distribution of the whole must be on the terms of
+ this License, whose permissions for other licensees extend to the
+ entire whole, and thus to each and every part regardless of who wrote
+ it.</p><p>Thus, it is not the intent of this section to claim rights or contest
+ your rights to work written entirely by you; rather, the intent is to
+ exercise the right to control the distribution of derivative or
+ collective works based on the Library.</p><p>In addition, mere aggregation of another work not based on the Library
+ with the Library (or with a work based on the Library) on a volume of
+ a storage or distribution medium does not bring the other work under
+ the scope of this License.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-3"></a>Section 3</h3></div></div></div><p>You may opt to apply the terms of the ordinary GNU General Public
+ License instead of this License to a given copy of the Library. To do
+ this, you must alter all the notices that refer to this License, so
+ that they refer to the ordinary GNU General Public License, version 2,
+ instead of to this License. (If a newer version than version 2 of the
+ ordinary GNU General Public License has appeared, then you can specify
+ that version instead if you wish.) Do not make any other change in
+ these notices.</p><p>Once this change is made in a given copy, it is irreversible for
+ that copy, so the ordinary GNU General Public License applies to all
+ subsequent copies and derivative works made from that copy.</p><p>This option is useful when you wish to copy part of the code of
+ the Library into a program that is not a library.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-4"></a>Section 4</h3></div></div></div><p>You may copy and distribute the Library (or a portion or
+ derivative of it, under <a href="#lgpl-2-2" title="Section 2">Section 2</a>) in object code or executable form
+ under the terms of <a href="#lgpl-2-1" title="Section 1">Sections 1</a> and <a href="#lgpl-2-2" title="Section 2">2</a> above provided that you accompany
+ it with the complete corresponding machine-readable source code, which
+ must be distributed under the terms of <a href="#lgpl-2-1" title="Section 1">Sections 1</a> and <a href="#lgpl-2-2" title="Section 2">2</a> above on a
+ medium customarily used for software interchange.</p><p>If distribution of object code is made by offering access to copy
+ from a designated place, then offering equivalent access to copy the
+ source code from the same place satisfies the requirement to
+ distribute the source code, even though third parties are not
+ compelled to copy the source along with the object code.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-5"></a>Section 5</h3></div></div></div><p>A program that contains no derivative of any portion of the
+ Library, but is designed to work with the Library by being compiled or
+ linked with it, is called a “<span class="quote">work that uses the Library</span>”. Such a
+ work, in isolation, is not a derivative work of the Library, and
+ therefore falls outside the scope of this License.</p><p>However, linking a “<span class="quote">work that uses the Library</span>” with the Library
+ creates an executable that is a derivative of the Library (because it
+ contains portions of the Library), rather than a “<span class="quote">work that uses the
+ library</span>”. The executable is therefore covered by this License.
+ <a href="#lgpl-2-6" title="Section 6">Section 6</a> states terms for distribution of such executables.</p><p>When a “<span class="quote">work that uses the Library</span>” uses material from a header file
+ that is part of the Library, the object code for the work may be a
+ derivative work of the Library even though the source code is not.
+ Whether this is true is especially significant if the work can be
+ linked without the Library, or if the work is itself a library. The
+ threshold for this to be true is not precisely defined by law.</p><p>If such an object file uses only numerical parameters, data
+ structure layouts and accessors, and small macros and small inline
+ functions (ten lines or less in length), then the use of the object
+ file is unrestricted, regardless of whether it is legally a derivative
+ work. (Executables containing this object code plus portions of the
+ Library will still fall under <a href="#lgpl-2-6" title="Section 6">Section 6</a>.)</p><p>Otherwise, if the work is a derivative of the Library, you may
+ distribute the object code for the work under the terms of <a href="#lgpl-2-6" title="Section 6">Section 6</a>.
+ Any executables containing that work also fall under <a href="#lgpl-2-6" title="Section 6">Section 6</a>,
+ whether or not they are linked directly with the Library itself.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-6"></a>Section 6</h3></div></div></div><p>As an exception to the Sections above, you may also combine or
+ link a “<span class="quote">work that uses the Library</span>” with the Library to produce a
+ work containing portions of the Library, and distribute that work
+ under terms of your choice, provided that the terms permit
+ modification of the work for the customer's own use and reverse
+ engineering for debugging such modifications.</p><p>You must give prominent notice with each copy of the work that the
+ Library is used in it and that the Library and its use are covered by
+ this License. You must supply a copy of this License. If the work
+ during execution displays copyright notices, you must include the
+ copyright notice for the Library among them, as well as a reference
+ directing the user to the copy of this License. Also, you must do one
+ of these things:
+ </p><div class="orderedlist"><ol type="a"><li><p><a name="lgpl-2-6-a"></a>Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ <a href="#lgpl-2-1" title="Section 1">Sections 1</a> and <a href="#lgpl-2-2" title="Section 2">2</a> above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable “<span class="quote">work that
+ uses the Library</span>”, as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)</p></li><li><p>Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.</p></li><li><p>Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in <a href="#lgpl-2-6-a">Subsection 6a</a>, above, for a charge no more
+ than the cost of performing this distribution.</p></li><li><p>If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.</p></li><li><p>Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.</p></li></ol></div><p>
+ </p><p>For an executable, the required form of the “<span class="quote">work that uses the
+ Library</span>” must include any data and utility programs needed for
+ reproducing the executable from it. However, as a special exception,
+ the materials to be distributed need not include anything that is
+ normally distributed (in either source or binary form) with the major
+ components (compiler, kernel, and so on) of the operating system on
+ which the executable runs, unless that component itself accompanies
+ the executable.</p><p>It may happen that this requirement contradicts the license
+ restrictions of other proprietary libraries that do not normally
+ accompany the operating system. Such a contradiction means you cannot
+ use both them and the Library together in an executable that you
+ distribute.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-7"></a>Section 7</h3></div></div></div><p>You may place library facilities that are a work based on the
+ Library side-by-side in a single library together with other library
+ facilities not covered by this License, and distribute such a combined
+ library, provided that the separate distribution of the work based on
+ the Library and of the other library facilities is otherwise
+ permitted, and provided that you do these two things:
+ </p><div class="orderedlist"><ol type="a"><li><p>Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.</p></li><li><p>Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.</p></li></ol></div><p>
+ </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-8"></a>Section 8</h3></div></div></div><p>You may not copy, modify, sublicense, link with, or distribute
+ the Library except as expressly provided under this License. Any
+ attempt otherwise to copy, modify, sublicense, link with, or
+ distribute the Library is void, and will automatically terminate your
+ rights under this License. However, parties who have received copies,
+ or rights, from you under this License will not have their licenses
+ terminated so long as such parties remain in full compliance.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-9"></a>Section 9</h3></div></div></div><p>You are not required to accept this License, since you have not
+ signed it. However, nothing else grants you permission to modify or
+ distribute the Library or its derivative works. These actions are
+ prohibited by law if you do not accept this License. Therefore, by
+ modifying or distributing the Library (or any work based on the
+ Library), you indicate your acceptance of this License to do so, and
+ all its terms and conditions for copying, distributing or modifying
+ the Library or works based on it.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-10"></a>Section 10</h3></div></div></div><p>Each time you redistribute the Library (or any work based on the
+ Library), the recipient automatically receives a license from the
+ original licensor to copy, distribute, link with or modify the Library
+ subject to these terms and conditions. You may not impose any further
+ restrictions on the recipients' exercise of the rights granted herein.
+ You are not responsible for enforcing compliance by third parties with
+ this License.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-11"></a>Section 11</h3></div></div></div><p>If, as a consequence of a court judgment or allegation of patent
+ infringement or for any other reason (not limited to patent issues),
+ conditions are imposed on you (whether by court order, agreement or
+ otherwise) that contradict the conditions of this License, they do not
+ excuse you from the conditions of this License. If you cannot
+ distribute so as to satisfy simultaneously your obligations under this
+ License and any other pertinent obligations, then as a consequence you
+ may not distribute the Library at all. For example, if a patent
+ license would not permit royalty-free redistribution of the Library by
+ all those who receive copies directly or indirectly through you, then
+ the only way you could satisfy both it and this License would be to
+ refrain entirely from distribution of the Library.</p><p>If any portion of this section is held invalid or unenforceable under any
+ particular circumstance, the balance of the section is intended to apply,
+ and the section as a whole is intended to apply in other circumstances.</p><p>It is not the purpose of this section to induce you to infringe any
+ patents or other property right claims or to contest validity of any
+ such claims; this section has the sole purpose of protecting the
+ integrity of the free software distribution system which is
+ implemented by public license practices. Many people have made
+ generous contributions to the wide range of software distributed
+ through that system in reliance on consistent application of that
+ system; it is up to the author/donor to decide if he or she is willing
+ to distribute software through any other system and a licensee cannot
+ impose that choice.</p><p>This section is intended to make thoroughly clear what is believed to
+ be a consequence of the rest of this License.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-12"></a>Section 12</h3></div></div></div><p>If the distribution and/or use of the Library is restricted in
+ certain countries either by patents or by copyrighted interfaces, the
+ original copyright holder who places the Library under this License may add
+ an explicit geographical distribution limitation excluding those countries,
+ so that distribution is permitted only in or among countries not thus
+ excluded. In such case, this License incorporates the limitation as if
+ written in the body of this License.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-13"></a>Section 13</h3></div></div></div><p>The Free Software Foundation may publish revised and/or new
+ versions of the Lesser General Public License from time to time.
+ Such new versions will be similar in spirit to the present version,
+ but may differ in detail to address new problems or concerns.</p><p>Each version is given a distinguishing version number. If the Library
+ specifies a version number of this License which applies to it and
+ “<span class="quote">any later version</span>”, you have the option of following the terms and
+ conditions either of that version or of any later version published by
+ the Free Software Foundation. If the Library does not specify a
+ license version number, you may choose any version ever published by
+ the Free Software Foundation.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-14"></a>Section 14</h3></div></div></div><p>If you wish to incorporate parts of the Library into other free
+ programs whose distribution conditions are incompatible with these,
+ write to the author to ask for permission. For software which is
+ copyrighted by the Free Software Foundation, write to the Free
+ Software Foundation; we sometimes make exceptions for this. Our
+ decision will be guided by the two goals of preserving the free status
+ of all derivatives of our free software and of promoting the sharing
+ and reuse of software generally.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-15"></a>NO WARRANTY Section 15</h3></div></div></div><p>BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+ WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+ EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+ OTHER PARTIES PROVIDE THE LIBRARY “<span class="quote">AS IS</span>” WITHOUT WARRANTY OF ANY
+ KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+ LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+ THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="lgpl-2-16"></a>Section 16</h3></div></div></div><p>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+ WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+ AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+ FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+ CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+ LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+ RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ DAMAGES.</p><p>END OF TERMS AND CONDITIONS</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="lgpl-3"></a>How to Apply These Terms to Your New Libraries</h2></div></div></div><p>If you develop a new library, and you want it to be of the greatest
+ possible use to the public, we recommend making it free software that
+ everyone can redistribute and change. You can do so by permitting
+ redistribution under these terms (or, alternatively, under the terms of the
+ ordinary General Public License).</p><p>To apply these terms, attach the following notices to the library. It is
+ safest to attach them to the start of each source file to most effectively
+ convey the exclusion of warranty; and each file should have at least the
+ “<span class="quote">copyright</span>” line and a pointer to where the full notice is found.</p><p><one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author></p><p>This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.</p><p>This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.</p><p>You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</p><p>Also add information on how to contact you by electronic and paper mail.</p><p>You should also get your employer (if you work as a programmer) or your
+ school, if any, to sign a “<span class="quote">copyright disclaimer</span>” for the library, if
+ necessary. Here is a sample; alter the names:</p><p>Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.</p><p><signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice</p><p>That's all there is to it!</p></div></div></body></html>
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/log4j.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/log4j.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/log4j.xml
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/log4j.xml (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/log4j.xml 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <root>
+ <priority value ="info" />
+ <appender-ref ref="console" />
+ </root>
+
+</log4j:configuration>
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/servlet.jar
===================================================================
(Binary files differ)
Property changes on: trunk/profiler/plugins/org.jboss.tools.profiler.ui/embedded/servlet.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/plugin.xml
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/plugin.xml (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/plugin.xml 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.debug.core.launchDelegates">
+ <launchDelegate
+ delegate="org.jboss.tools.profiler.internal.ui.launch.JBossProfilerLaunchDelegate"
+ id="org.jboss.tools.profiler.core.JBossProfilerDelgate"
+ modes="profile"
+ name="JBoss Profiler"
+ type="org.eclipse.jdt.launching.localJavaApplication">
+ </launchDelegate>
+ <launchDelegate
+ delegate="org.jboss.tools.profiler.internal.ui.launch.JBossProfilerLaunchDelegate"
+ id="org.jboss.tools.profiler.core.JBossProfilerDelgateJUnit"
+ modes="profile"
+ name="JBoss Profiler"
+ type="org.eclipse.jdt.junit.launchconfig">
+ </launchDelegate>
+ </extension>
+
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTabs">
+ <tab
+ class="org.jboss.tools.profiler.internal.ui.launchtabs.JBossProfilerTab"
+ group="org.eclipse.jdt.debug.ui.launchConfigurationTabGroup.localJavaApplication"
+ id="org.jboss.tools.profiler.ui.jbossprofilertab"
+ name="JBoss Profiler">
+ <placement
+ after="org.eclipse.jdt.debug.ui.javaMainTab">
+ </placement>
+ <!--<associatedDelegate
+ delegate="org.jboss.tools.profiler.core.JBossProfilerDelgate">
+ </associatedDelegate>-->
+ </tab>
+ </extension>
+
+
+
+</plugin>
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/JBossProfilerUiPlugin.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/JBossProfilerUiPlugin.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/JBossProfilerUiPlugin.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,178 @@
+
+package org.jboss.tools.profiler.internal.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.tools.profiler.internal.ui.launch.LaunchListener;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class JBossProfilerUiPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.profiler.internal.ui"; //$NON-NLS-1$
+
+ // The shared instance
+ private static JBossProfilerUiPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public JBossProfilerUiPlugin() {
+ }
+
+
+ public static String getPluginId() {
+ return getDefault().getBundle().getSymbolicName();
+ }
+
+ // Launches listener
+ private LaunchListener launchListener;
+
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ public LaunchListener getLaunchListener() {
+ if (launchListener == null)
+ launchListener = new LaunchListener();
+ return launchListener;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ if (launchListener != null)
+ launchListener.shutdown();
+
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static JBossProfilerUiPlugin getDefault() {
+ return plugin;
+ }
+
+ public static Shell getActiveWorkbenchShell() {
+ IWorkbenchWindow window = getActiveWorkbenchWindow();
+ if (window != null) {
+ return window.getShell();
+ }
+ return null;
+ }
+
+ public static IWorkbenchWindow getActiveWorkbenchWindow() {
+ return getDefault().getWorkbench().getActiveWorkbenchWindow();
+ }
+
+ public static IWorkspace getWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+
+ /**
+ * Logs the specified status with this plug-in's log.
+ *
+ * @param status status to log
+ */
+ public void log(IStatus status) {
+ getLog().log(status);
+ }
+
+
+ /**
+ * Logs an internal info with the specified message.
+ *
+ * @param message the error message to log
+ */
+ public void log(String message) {
+ log(new Status(IStatus.INFO, getPluginId(), 0, message, null) );
+ }
+
+ /**
+ * Logs an internal error with the specified message.
+ *
+ * @param message the error message to log
+ */
+ public void logErrorMessage(String message, Throwable t) {
+ logMessage(IStatus.ERROR, message, t);
+ }
+
+ public void logMessage(int lvl, String message, Throwable t) {
+ if(t==null) {
+ log(message);
+ } else {
+ log(new MultiStatus(getPluginId(), lvl , new IStatus[] { throwableToStatus(t) }, message, null));
+ }
+ }
+
+ public static IStatus throwableToStatus(Throwable t, int code) {
+ List<IStatus> causes = new ArrayList<IStatus>();
+ Throwable temp = t;
+ while(temp!=null && temp.getCause()!=temp) {
+ causes.add(new Status(IStatus.ERROR, getPluginId(), code, temp.getMessage()==null?temp.toString() + ":" + Messages.JBossProfilerUiPlugin_no_message:temp.toString(), temp) ); //$NON-NLS-1$
+ temp = temp.getCause();
+ }
+ String msg = Messages.JBossProfilerUiPlugin_no_message;
+ if(t!=null && t.getMessage()!=null) {
+ msg = t.toString();
+ }
+
+ if(causes.isEmpty()) {
+ return new Status(IStatus.ERROR, getPluginId(), code, msg, t);
+ } else {
+ return new MultiStatus(getPluginId(), code,causes.toArray(new IStatus[causes.size()]), msg, t);
+ }
+
+ }
+
+ public static IStatus throwableToStatus(Throwable t) {
+ return throwableToStatus(t, 150);
+ }
+
+ public void logErrorMessage(String message, Throwable t[]) {
+ IStatus[] children = new IStatus[t.length];
+ for (int i = 0; i < t.length; i++) {
+ Throwable throwable = t[i];
+ children[i] = throwableToStatus(throwable);
+ }
+
+ IStatus s = new MultiStatus(getPluginId(), 0,children, message, null);
+ log(s);
+ }
+
+ /**
+ * Logs an internal error with the specified throwable
+ *
+ * @param e the exception to be logged
+ */
+ public void log(Throwable e) {
+ log(new Status(IStatus.ERROR, getPluginId(), 150, "Internal Error", e) ); //$NON-NLS-1$
+ }
+
+}
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/Messages.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/Messages.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/Messages.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,33 @@
+package org.jboss.tools.profiler.internal.ui;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.profiler.internal.ui.messages"; //$NON-NLS-1$
+ public static String BaseBlock_cannot_open_directory;
+ public static String BaseBlock_cannot_open_file;
+ public static String BaseBlock_choose_a_directory;
+ public static String BaseBlock_choose_location_relative_to_ws;
+ public static String BaseBlock_directory_not_found;
+ public static String BaseBlock_file_not_found;
+ public static String BaseBlock_filesystem;
+ public static String BaseBlock_open_directory;
+ public static String BaseBlock_open_file;
+ public static String BaseBlock_select_directory;
+ public static String BaseBlock_select_file;
+ public static String BaseBlock_select_properties_file;
+ public static String BaseBlock_the_is_not_specified;
+ public static String BaseBlock_variables;
+ public static String BaseBlock_workspace;
+ public static String JBossProfilerUiPlugin_no_message;
+ public static String LaunchUtils_probem_finding_embedded_runtime;
+ public static String LaunchUtils_problem_finding_embedded_agent_runtime;
+ public static String LaunchUtils_problem_finding_embedded_client;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/JBossProfilerLaunchDelegate.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/JBossProfilerLaunchDelegate.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/JBossProfilerLaunchDelegate.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,122 @@
+package org.jboss.tools.profiler.internal.ui.launch;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.variables.IStringVariableManager;
+import org.eclipse.core.variables.VariablesPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.IVMRunner;
+import org.eclipse.jdt.launching.JavaLaunchDelegate;
+import org.jboss.tools.profiler.internal.ui.JBossProfilerUiPlugin;
+
+public class JBossProfilerLaunchDelegate extends JavaLaunchDelegate {
+
+ IProcess profiledProcess = null;
+
+ @Override
+ public String getVMArguments(ILaunchConfiguration configuration)
+ throws CoreException {
+ String vmArguments = super.getVMArguments(configuration);
+
+ String agentJar = LaunchUtils.getAgentJar(configuration);
+
+ String propertiesFile = getPropertiesFiles(configuration);
+
+ return "-javaagent:" + agentJar + " -Djboss-profiler.properties=" + propertiesFile + " " + vmArguments;
+
+ }
+
+ private String getPropertiesFiles(ILaunchConfiguration configuration) throws CoreException {
+
+ if(configuration.getAttribute(JBossProfilerLauncherConstants.GENERATE_PROPERTIES, true)) {
+ try {
+ File temp = File.createTempFile("jboss-profiler", "properties");
+ Properties p = new Properties();
+ p.setProperty("enable", Boolean.toString(configuration.getAttribute(JBossProfilerLauncherConstants.ENABLE_ON_STARTUP, true)));
+ p.setProperty("save", Boolean.toString(configuration.getAttribute(JBossProfilerLauncherConstants.SAVE_ON_EXIT, true)));
+
+ p.setProperty("host", "localhost");
+ p.setProperty("port", "5400");
+
+ p.setProperty("savelocation",
+ LaunchUtils.getSaveLocation(configuration));
+
+ p.setProperty("remote", "no");
+
+ p.setProperty("cpu", "yes");
+ p.setProperty("memory", "yes");
+ p.setProperty("includes", "*");
+ p.setProperty("excludes", "");
+ //p.setProperty("visibility", "private");
+
+ p.setProperty("startup", "yes");
+ p.setProperty("repository", "no");
+
+ p.setProperty("store", "memory");
+ p.setProperty("location", ".");
+ p.setProperty("ejb", "yes");
+ p.setProperty("servlet", "yes");
+ p.setProperty("jsf", "yes");
+ p.setProperty("jmx", "yes");
+ p.setProperty("rmi", "yes");
+ p.setProperty("corba", "yes");
+ p.setProperty("plugin.1", "org.jboss.profiler.plugins.Hibernate");
+ p.setProperty("plugin.2", "org.jboss.profiler.plugins.Seam");
+ FileOutputStream fos = null;
+ try {
+ fos = new FileOutputStream(temp);
+ p.store(fos, "");
+ } finally {
+ if(fos!=null) {
+ fos.close();
+ }
+ }
+
+ return temp.getAbsolutePath();
+ } catch (IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, JBossProfilerUiPlugin.getPluginId(), Messages.JBossProfilerLaunchDelegate_error_writing_temporary_properties));
+ }
+ } else {
+ return getSubstitutedString(configuration.getAttribute(JBossProfilerLauncherConstants.PROPERTIES_FILE, ""));
+ }
+ }
+
+
+ private static String getSubstitutedString(String text) throws CoreException {
+ if (text == null)
+ return ""; //$NON-NLS-1$
+ IStringVariableManager mgr = VariablesPlugin.getDefault().getStringVariableManager();
+ return mgr.performStringSubstitution(text);
+ }
+
+ @Override
+ public IVMRunner getVMRunner(ILaunchConfiguration configuration, String mode)
+ throws CoreException {
+ IVMInstall vm = verifyVMInstall(configuration);
+ IVMRunner runner = vm.getVMRunner(ILaunchManager.RUN_MODE);
+ return runner;
+ }
+
+ @Override
+ public void launch(ILaunchConfiguration configuration, String mode,
+ ILaunch launch, IProgressMonitor monitor) throws CoreException {
+
+
+ JBossProfilerUiPlugin.getDefault().getLaunchListener().manage(launch);
+
+ super.launch(configuration, mode, launch, monitor);
+
+ }
+
+}
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/JBossProfilerLauncherConstants.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/JBossProfilerLauncherConstants.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/JBossProfilerLauncherConstants.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,13 @@
+package org.jboss.tools.profiler.internal.ui.launch;
+
+public interface JBossProfilerLauncherConstants {
+
+ String PROFILER_JAR = "jboss.profiler.jar";
+ String USE_EMBEDDED_JAR = "jboss.profiler.use_embedded_jar";
+ String GENERATE_PROPERTIES = "jboss.profiler.generate_properties";
+ String PROPERTIES_FILE = "jboss.profiler.properties_file";
+ String ENABLE_ON_STARTUP = "jboss.profiler.settings.enable";
+ String SAVE_ON_EXIT = "jboss.profiler.settings.save";
+ String SAVE_LOCATION = "jboss.profiler.settings.savelocation";
+
+}
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/LaunchListener.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/LaunchListener.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/LaunchListener.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,280 @@
+package org.jboss.tools.profiler.internal.ui.launch;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IDebugEventSetListener;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchListener;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.Launch;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.IVMRunner;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jdt.launching.VMRunnerConfiguration;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWebBrowser;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.jboss.tools.profiler.internal.ui.JBossProfilerUiPlugin;
+
+public class LaunchListener implements ILaunchListener, IDebugEventSetListener {
+ private List<ILaunch> managedLaunches;
+
+ public LaunchListener() {
+ managedLaunches = new ArrayList<ILaunch>();
+ }
+
+ public void manage(ILaunch launch) {
+ if (managedLaunches.size() == 0)
+ hookListener(true);
+ if (!managedLaunches.contains(launch))
+ managedLaunches.add(launch);
+ }
+
+ /**
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch)
+ */
+ public void launchRemoved(ILaunch launch) {
+ update(launch, true);
+ }
+
+ /**
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch)
+ */
+ public void launchAdded(ILaunch launch) {
+ }
+
+ /**
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch)
+ */
+ public void launchChanged(ILaunch launch) {
+ }
+
+ private void update(ILaunch launch, boolean remove) {
+ if (managedLaunches.contains(launch)) {
+ if (remove || launch.isTerminated()) {
+ managedLaunches.remove(launch);
+ if (managedLaunches.size() == 0) {
+ hookListener(false);
+ }
+ }
+ }
+ }
+
+ private void hookListener(boolean add) {
+ DebugPlugin debugPlugin = DebugPlugin.getDefault();
+ ILaunchManager launchManager = debugPlugin.getLaunchManager();
+ if (add) {
+ launchManager.addLaunchListener(this);
+ debugPlugin.addDebugEventListener(this);
+ } else {
+ launchManager.removeLaunchListener(this);
+ debugPlugin.removeDebugEventListener(this);
+ }
+ }
+
+ public void shutdown() {
+ hookListener(false);
+ }
+
+ /**
+ * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent)
+ */
+ public void handleDebugEvents(DebugEvent[] events) {
+ for (int i = 0; i < events.length; i++) {
+ DebugEvent event = events[i];
+ Object source = event.getSource();
+ if (source instanceof IProcess
+ && event.getKind() == DebugEvent.TERMINATE) {
+ IProcess process = (IProcess) source;
+ ILaunch launch = process.getLaunch();
+ if (launch != null) {
+ try {
+ launchTerminated(launch, process.getExitValue());
+ } catch (DebugException e) {
+ // ignore
+ }
+ }
+ }
+ }
+ }
+
+ private void launchTerminated(final ILaunch launch, int returnValue) {
+ if (managedLaunches.contains(launch)) {
+ update(launch, true);
+
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+
+ File log = getMostRecentLogFile(launch
+ .getLaunchConfiguration());
+ if (log != null && log.exists()) {
+
+ boolean open = MessageDialog
+ .openQuestion(
+ JBossProfilerUiPlugin
+ .getActiveWorkbenchShell(),
+ "JBoss Profiler",
+ "Launch with JBoss Profiler completed. \nDo you want to generate and open the latest snapshot generated ?");
+ if (open) {
+ File generateReport = generateReport(log, launch
+ .getLaunchConfiguration());
+ if (generateReport != null) {
+ openInEditor(new File(generateReport,
+ "index.html"));
+ } // else something went wrong generating the
+ // report. Failing gracefully
+ // and expect the error log or generation to show
+ // possible cause.
+ }
+ }
+
+ }
+
+ });
+ }
+ }
+
+ private void openInEditor(File u) {
+
+ // TODO: should put this in a job ...
+ int count = 0;
+ while (!u.exists() && count <= 10) {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ // ignore
+ }
+ }
+
+ IWorkbenchBrowserSupport support = PlatformUI.getWorkbench()
+ .getBrowserSupport();
+ IWebBrowser browser;
+ try {
+ browser = support.createBrowser(null);
+ } catch (PartInitException e) {
+ JBossProfilerUiPlugin.getDefault().logErrorMessage(
+ "Could not create browser.", e);
+ return;
+ }
+
+ try {
+ browser.openURL(u.toURL());
+ } catch (PartInitException e) {
+ JBossProfilerUiPlugin.getDefault().logErrorMessage(
+ "Could not open browser.", e);
+ } catch (MalformedURLException e) {
+ JBossProfilerUiPlugin.getDefault().logErrorMessage(
+ "Could not open browser.", e);
+ }
+ }
+
+ private File generateReport(File log, ILaunchConfiguration configuration) {
+ IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall();
+ if (vmInstall != null) {
+ IVMRunner vmRunner = vmInstall.getVMRunner(ILaunchManager.RUN_MODE);
+ if (vmRunner != null) {
+ String[] classPath = null;
+ try {
+ classPath = new String[] { LaunchUtils
+ .getProfilerClientJar(configuration) };
+
+ if (classPath != null) {
+ VMRunnerConfiguration vmConfig = new VMRunnerConfiguration(
+ "org.jboss.profiler.client.cmd.Client",
+ classPath);
+ File destDir = new File(log.getParent(), log.getName()
+ + "-report");
+ vmConfig.setProgramArguments(new String[] { "load",
+ log.getAbsolutePath(),
+ destDir.getAbsolutePath() });
+
+ ILaunch launch = new Launch(null,
+ ILaunchManager.RUN_MODE, null);
+
+ vmRunner.run(vmConfig, launch, null);
+
+ return destDir;
+ }
+ } catch (CoreException e) {
+ JBossProfilerUiPlugin.getDefault().logErrorMessage(
+ "Problem generating snapshot report", e);
+ }
+ }
+
+ }
+ return null;
+ }
+
+ /**
+ * Returns latest .jps file for Profile Launch Configuration.
+ *
+ * @returns log file or null
+ */
+ static File getMostRecentLogFile(ILaunchConfiguration configuration) {
+ File latest = null;
+ File saveLocation;
+ try {
+ saveLocation = new File(LaunchUtils.getSaveLocation(configuration));
+ } catch (CoreException e) {
+ JBossProfilerUiPlugin.getDefault().logErrorMessage(
+ "Could not get save location from "
+ + configuration.getName(), e);
+ return null;
+ }
+
+ refreshWorkspace(saveLocation);
+ File[] children = saveLocation.listFiles(new FilenameFilter() {
+
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".jps");
+ }
+ });
+ if (children != null) {
+ for (int i = 0; i < children.length; i++) {
+ if (!children[i].isDirectory()) { //$NON-NLS-1$
+ if (latest == null
+ || latest.lastModified() < children[i]
+ .lastModified())
+ latest = children[i];
+ }
+ }
+ }
+ return latest;
+ }
+
+ /**
+ * Refresh the save location to make sure it is shown in the UI.
+ *
+ * @param saveLocation
+ */
+ private static void refreshWorkspace(File saveLocation) {
+ IContainer[] findContainersForLocationURI = JBossProfilerUiPlugin
+ .getWorkspace().getRoot().findContainersForLocationURI(
+ saveLocation.toURI());
+ for (int i = 0; i < findContainersForLocationURI.length; i++) {
+ IContainer iContainer = findContainersForLocationURI[i];
+ try {
+ iContainer.refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ // ignore since the refresh is just to make sure Eclipse knows
+ // about the newly generated file.
+ }
+ }
+ }
+
+}
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/LaunchTabGroupJUnit.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/LaunchTabGroupJUnit.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/LaunchTabGroupJUnit.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,31 @@
+package org.jboss.tools.profiler.internal.ui.launch;
+
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.EnvironmentTab;
+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.JavaArgumentsTab;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab;
+import org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationTab;
+import org.jboss.tools.profiler.internal.ui.launchtabs.JBossProfilerTab;
+
+public class LaunchTabGroupJUnit extends AbstractLaunchConfigurationTabGroup {
+
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ ILaunchConfigurationTab[] tabs= new ILaunchConfigurationTab[] {
+ new JUnitLaunchConfigurationTab(),
+ new JavaArgumentsTab(),
+ new JBossProfilerTab(),
+ new JavaClasspathTab(),
+ new JavaJRETab(),
+ new SourceLookupTab(),
+ new EnvironmentTab(),
+ new CommonTab()
+ };
+ setTabs(tabs);
+ }
+
+}
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/LaunchUtils.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/LaunchUtils.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/LaunchUtils.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,65 @@
+package org.jboss.tools.profiler.internal.ui.launch;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.variables.IStringVariableManager;
+import org.eclipse.core.variables.VariablesPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.jboss.tools.profiler.internal.ui.JBossProfilerUiPlugin;
+import org.jboss.tools.profiler.internal.ui.Messages;
+
+public class LaunchUtils {
+
+ static public String getProfilerRuntime(ILaunchConfiguration configuration)
+ throws CoreException {
+ String agentJar = null;
+ if(configuration.getAttribute(JBossProfilerLauncherConstants.USE_EMBEDDED_JAR, true)) {
+ URL entry = JBossProfilerUiPlugin.getDefault().getBundle().getEntry("/embedded");
+ File urlFile = null;
+ try {
+ URL fileURL = FileLocator.toFileURL(entry);
+ urlFile = new File(fileURL.getPath());
+ } catch (IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, JBossProfilerUiPlugin.getPluginId(), Messages.LaunchUtils_probem_finding_embedded_runtime));
+ }
+ agentJar = urlFile.getAbsolutePath();
+ } else {
+ agentJar = getSubstitutedString(configuration.getAttribute(JBossProfilerLauncherConstants.PROFILER_JAR, (String)null));
+ }
+ return agentJar;
+ }
+
+ static public String getProfilerClientJar(ILaunchConfiguration configuration) throws CoreException {
+ try {
+ return new File(getProfilerRuntime(configuration), "jboss-profiler-client.jar").getAbsolutePath();
+ } catch (CoreException e) {
+ throw new CoreException(new Status(IStatus.ERROR, JBossProfilerUiPlugin.getPluginId(), Messages.LaunchUtils_problem_finding_embedded_client));
+ }
+ }
+
+ static public String getAgentJar(ILaunchConfiguration configuration) throws CoreException {
+ try {
+ return new File(getProfilerRuntime(configuration), "jboss-profiler.jar").getAbsolutePath();
+ } catch (CoreException e) {
+ throw new CoreException(new Status(IStatus.ERROR, JBossProfilerUiPlugin.getPluginId(), Messages.LaunchUtils_problem_finding_embedded_agent_runtime));
+ }
+ }
+
+ public static String getSaveLocation(ILaunchConfiguration configuration) throws CoreException {
+ return getSubstitutedString(configuration.getAttribute(JBossProfilerLauncherConstants.SAVE_LOCATION, "."));
+ }
+
+ private static String getSubstitutedString(String text) throws CoreException {
+ if (text == null)
+ return ""; //$NON-NLS-1$
+ IStringVariableManager mgr = VariablesPlugin.getDefault().getStringVariableManager();
+ return mgr.performStringSubstitution(text);
+ }
+
+}
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/Messages.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/Messages.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/Messages.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,15 @@
+package org.jboss.tools.profiler.internal.ui.launch;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.profiler.internal.ui.launch.messages"; //$NON-NLS-1$
+ public static String JBossProfilerLaunchDelegate_error_writing_temporary_properties;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/messages.properties
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/messages.properties (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launch/messages.properties 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1 @@
+JBossProfilerLaunchDelegate_error_writing_temporary_properties=Error while writing temporary jboss-profiler.properties
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/BaseBlock.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/BaseBlock.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/BaseBlock.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,395 @@
+package org.jboss.tools.profiler.internal.ui.launchtabs;
+
+import java.io.File;
+
+import org.eclipse.core.filesystem.URIUtil;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.variables.IStringVariableManager;
+import org.eclipse.core.variables.VariablesPlugin;
+import org.eclipse.debug.ui.StringVariableSelectionDialog;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.layout.PixelConverter;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.program.Program;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
+import org.eclipse.ui.dialogs.ISelectionStatusValidator;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.jboss.tools.profiler.internal.ui.JBossProfilerUiPlugin;
+import org.jboss.tools.profiler.internal.ui.Messages;
+import org.jboss.tools.profiler.internal.ui.util.FileNameFilter;
+
+public abstract class BaseBlock {
+
+ protected BaseLaunchConfigurationTab fTab;
+
+ private Button fVariablesButton;
+ private Button fFileSystemButton;
+ private Button fWorkspaceButton;
+
+ protected Text fLocationText;
+
+ protected Listener fListener = new Listener();
+
+ protected Link fLocationLink;
+
+ class Listener extends SelectionAdapter implements ModifyListener {
+ public void widgetSelected(SelectionEvent e) {
+ Object source = e.getSource();
+ if (source == fFileSystemButton) {
+ handleBrowseFileSystem();
+ } else if (source == fWorkspaceButton) {
+ handleBrowseWorkspace();
+ } else if (source == fVariablesButton) {
+ handleInsertVariable();
+ } else {
+ fTab.updateLaunchConfigurationDialog();
+ }
+ }
+
+ public void modifyText(ModifyEvent e) {
+ fTab.updateLaunchConfigurationDialog();
+ }
+ }
+
+ public BaseBlock(BaseLaunchConfigurationTab tab) {
+ fTab = tab;
+ }
+
+ protected void createText(Composite parent, String text, int indent) {
+ fLocationLink = new Link(parent, SWT.NONE);
+ fLocationLink.setText("<a>" + text + "</a>"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (indent > 0) {
+ GridData gd = new GridData();
+ gd.horizontalIndent = indent;
+ fLocationLink.setLayoutData(gd);
+ }
+
+ fLocationText = new Text(parent, SWT.SINGLE | SWT.BORDER);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.widthHint = 400;
+ fLocationText.setLayoutData(gd);
+ fLocationText.addModifyListener(fListener);
+
+ fLocationLink.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ String path = VariablesPlugin.getDefault()
+ .getStringVariableManager()
+ .performStringSubstitution(getLocation(), false);
+ File f = new File(path);
+ if (f.exists())
+ Program.launch(f.getCanonicalPath());
+ else
+ MessageDialog.openWarning(JBossProfilerUiPlugin
+ .getActiveWorkbenchShell(),
+ isFile() ? Messages.BaseBlock_open_file : Messages.BaseBlock_open_directory,
+ isFile() ? Messages.BaseBlock_file_not_found
+ : Messages.BaseBlock_directory_not_found);
+ } catch (Exception ex) {
+ MessageDialog
+ .openWarning(
+ JBossProfilerUiPlugin
+ .getActiveWorkbenchShell(),
+ isFile() ? Messages.BaseBlock_open_file : Messages.BaseBlock_open_directory,
+ isFile() ? Messages.BaseBlock_cannot_open_file
+ : Messages.BaseBlock_cannot_open_directory);
+ }
+ }
+ });
+
+ }
+
+ /**
+ * Sets width and height hint for the button control. <b>Note:</b> This is a
+ * NOP if the button's layout data is not an instance of
+ * <code>GridData</code>.
+ *
+ * @param the
+ * button for which to set the dimension hint
+ */
+ public static void setButtonDimensionHint(Button button) {
+ Dialog.applyDialogFont(button);
+ Assert.isNotNull(button);
+ Object gd = button.getLayoutData();
+ if (gd instanceof GridData) {
+ ((GridData) gd).widthHint = getButtonWidthHint(button);
+ }
+ }
+
+ /**
+ * Returns a width hint for a button control.
+ */
+ public static int getButtonWidthHint(Button button) {
+ if (button.getFont().equals(JFaceResources.getDefaultFont()))
+ button.setFont(JFaceResources.getDialogFont());
+ PixelConverter converter = new PixelConverter(button);
+ int widthHint = converter
+ .convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
+ return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT,
+ true).x);
+ }
+
+ protected void createButtons(Composite parent, String[] buttonLabels) {
+ fWorkspaceButton = createButton(parent, buttonLabels[0]);
+ fFileSystemButton = createButton(parent, buttonLabels[1]);
+ fVariablesButton = createButton(parent, buttonLabels[2]);
+ }
+
+ protected Button createButton(Composite parent, String text) {
+ Button button = new Button(parent, SWT.PUSH);
+ button.setText(text);
+ button.setLayoutData(new GridData());
+ button.addSelectionListener(fListener);
+ setButtonDimensionHint(button);
+ return button;
+ }
+
+ protected String[] getFileFilter() {
+ return new String[] { "*.*" };
+ }
+
+ protected void handleBrowseFileSystem() {
+ if (isFile()) {
+ FileDialog dialog = new FileDialog(fTab.getControl().getShell());
+ dialog.setFilterExtensions(getFileFilter()); //$NON-NLS-1$
+ dialog.setFilterPath(getLocation());
+ dialog.setText(Messages.BaseBlock_select_properties_file);
+ String res = dialog.open();
+ if (res != null) {
+ fLocationText.setText(res);
+ }
+ } else {
+ DirectoryDialog dialog = new DirectoryDialog(fTab.getControl()
+ .getShell());
+ dialog.setFilterPath(getLocation());
+ dialog.setText(Messages.BaseBlock_select_directory);
+ dialog.setMessage(Messages.BaseBlock_choose_a_directory);
+ String result = dialog.open();
+ if (result != null)
+ fLocationText.setText(result);
+ }
+ }
+
+ protected IFile getFile() {
+ if (!isFile())
+ return null;
+
+ String path = getLocation();
+ if (path.length() > 0) {
+ IResource res = null;
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ if (path.startsWith("${workspace_loc:")) { //$NON-NLS-1$
+ IStringVariableManager manager = VariablesPlugin.getDefault()
+ .getStringVariableManager();
+ try {
+ path = manager.performStringSubstitution(path, false);
+ IPath uriPath = new Path(path).makeAbsolute();
+ IFile[] containers = root.findFilesForLocationURI(URIUtil
+ .toURI(uriPath));
+ if (containers.length > 0)
+ res = containers[0];
+ } catch (CoreException e) {
+ // ignore
+ }
+ } else {
+ res = root.findMember(path);
+ }
+ if (res instanceof IFile) {
+ return (IFile) res;
+ }
+ }
+ return null;
+ }
+
+ protected void handleBrowseWorkspace() {
+ if (isFile()) {
+ ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
+ fTab.getControl().getShell(), new WorkbenchLabelProvider(),
+ new WorkbenchContentProvider());
+
+ IFile file = getFile();
+ if (file != null)
+ dialog.setInitialSelection(file);
+ dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
+ dialog.addFilter(new FileNameFilter(getFileFilter())); //$NON-NLS-1$
+ dialog.setAllowMultiple(false);
+ dialog.setTitle(Messages.BaseBlock_select_file);
+ dialog.setMessage("");
+ dialog.setValidator(new ISelectionStatusValidator() {
+ public IStatus validate(Object[] selection) {
+ if (selection.length > 0 && selection[0] instanceof IFile)
+ return new Status(IStatus.OK, JBossProfilerUiPlugin
+ .getPluginId(), IStatus.OK, "", null); //$NON-NLS-1$
+
+ return new Status(IStatus.ERROR, JBossProfilerUiPlugin
+ .getPluginId(), IStatus.ERROR, "", null); //$NON-NLS-1$
+ }
+ });
+ if (dialog.open() == Window.OK) {
+ file = (IFile) dialog.getFirstResult();
+ fLocationText
+ .setText("${workspace_loc:" + file.getFullPath().makeRelative() + "}"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ } else {
+ ContainerSelectionDialog dialog = new ContainerSelectionDialog(fTab
+ .getControl().getShell(), getContainer(), true,
+ Messages.BaseBlock_choose_location_relative_to_ws);
+ if (dialog.open() == Window.OK) {
+ Object[] result = dialog.getResult();
+ if (result.length == 0)
+ return;
+ IPath path = (IPath) result[0];
+ fLocationText
+ .setText("${workspace_loc:" + path.makeRelative().toString() + "}"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+
+ /**
+ * Returns the selected workspace container,or <code>null</code>
+ */
+ protected IContainer getContainer() {
+ String path = getLocation();
+ if (path.length() > 0) {
+ IResource res = null;
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ if (path.startsWith("${workspace_loc:")) { //$NON-NLS-1$
+ IStringVariableManager manager = VariablesPlugin.getDefault()
+ .getStringVariableManager();
+ try {
+ path = manager.performStringSubstitution(path, false);
+ IPath uriPath = new Path(path).makeAbsolute();
+ IContainer[] containers = root
+ .findContainersForLocationURI(URIUtil
+ .toURI(uriPath));
+ if (containers.length > 0) {
+ res = containers[0];
+ }
+ } catch (CoreException e) {
+ // ignore
+ }
+ } else {
+ res = root.findMember(path);
+ }
+ if (res instanceof IContainer) {
+ return (IContainer) res;
+ }
+ }
+ return ResourcesPlugin.getWorkspace().getRoot();
+ }
+
+ private void handleInsertVariable() {
+ StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(
+ fTab.getControl().getShell());
+ if (dialog.open() == Window.OK)
+ fLocationText.insert(dialog.getVariableExpression());
+ }
+
+ protected String getLocation() {
+ return fLocationText.getText().trim();
+ }
+
+ protected void setLocation(String t) {
+ fLocationText.setText(t);
+ }
+
+ public String validate() {
+ return (fLocationText == null || (fLocationText.isEnabled() && getLocation()
+ .length() == 0)) ? NLS.bind(Messages.BaseBlock_the_is_not_specified,
+ getName()) : null;
+ }
+
+ protected abstract String getName();
+
+ /**
+ * @return true if the block edits a file, false otherwise (i.e. directory)
+ */
+ protected abstract boolean isFile();
+
+ int count;
+ protected void enableBrowseSection(boolean enabled) {
+ System.out.println("enableBS: " + enabled + " " + count++ + "th time"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ fLocationLink.setEnabled(enabled);
+ fLocationText.setEnabled(enabled);
+ fFileSystemButton.setEnabled(enabled);
+ fWorkspaceButton.setEnabled(enabled);
+ fVariablesButton.setEnabled(enabled);
+ }
+
+ public void createControl(Composite parent) {
+
+ Composite group = createComposite(parent, parent.getFont(), 3, 3, GridData.FILL_HORIZONTAL, 0, 0);
+
+ createText(group, getName(), 0);
+
+ //new Label(group, SWT.None);
+ //new Label(group, SWT.None);
+
+ Composite comp = createComposite(group, parent.getFont(), 4, 3, GridData.FILL_BOTH, 0, 0);
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ new Label(comp, SWT.NONE).setLayoutData(gd);
+ // buttons
+ createButtons(comp, new String[] {Messages.BaseBlock_workspace, Messages.BaseBlock_filesystem, Messages.BaseBlock_variables});
+
+ }
+
+ public static Composite createComposite(Composite parent, Font font,
+ int columns, int hspan, int fill, int marginwidth, int marginheight) {
+ Composite g = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout(columns, false);
+
+ layout.marginWidth = marginwidth;
+ layout.marginHeight = marginheight;
+ g.setLayout(layout);
+ g.setFont(font);
+ GridData gd = new GridData(fill);
+ gd.horizontalSpan = hspan;
+ g.setLayoutData(gd);
+ return g;
+ }
+
+ public static Text createSingleText(Composite parent, int hspan) {
+ Text t = new Text(parent, SWT.SINGLE | SWT.BORDER);
+ t.setFont(parent.getFont());
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = hspan;
+ t.setLayoutData(gd);
+ return t;
+ }
+
+
+
+}
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/BaseLaunchConfigurationTab.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/BaseLaunchConfigurationTab.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/BaseLaunchConfigurationTab.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,11 @@
+package org.jboss.tools.profiler.internal.ui.launchtabs;
+
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+
+public abstract class BaseLaunchConfigurationTab extends AbstractLaunchConfigurationTab {
+
+ @Override
+ public void updateLaunchConfigurationDialog() {
+ super.updateLaunchConfigurationDialog();
+ }
+}
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/JBossProfilerTab.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/JBossProfilerTab.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/JBossProfilerTab.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,92 @@
+package org.jboss.tools.profiler.internal.ui.launchtabs;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.jboss.tools.profiler.internal.ui.JBossProfilerUiPlugin;
+
+public class JBossProfilerTab extends BaseLaunchConfigurationTab {
+
+ private JarBlock jarBlock;
+ private PropertiesBlock propertiesBlock;
+
+ public void createControl(Composite parent) {
+
+ // initializeDialogUnits(parent);
+ final ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL
+ | SWT.V_SCROLL);
+ sc.setExpandHorizontal(true);
+ sc.setExpandVertical(true);
+
+ setControl(sc);
+ Composite container = new Composite(sc, SWT.NULL);
+ sc.setContent(container);
+ GridLayout layout = new GridLayout();
+
+ container.setLayout(layout);
+ layout.numColumns = 1;
+ layout.verticalSpacing = 10;
+
+ propertiesBlock = new PropertiesBlock(this);
+ propertiesBlock.createControl(container);
+
+ jarBlock = new JarBlock(this);
+ jarBlock.createControl(container);
+
+
+ }
+
+
+ public String getName() {
+ return "JBoss Profiler";
+ }
+
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ try {
+ jarBlock.initializeFrom(configuration);
+ propertiesBlock.initializeFrom(configuration);
+
+ } catch (CoreException e) {
+ JBossProfilerUiPlugin.getDefault().logErrorMessage("Error while initializing from " + configuration.getName(), e);
+ }
+ }
+
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ jarBlock.performApply(configuration);
+ propertiesBlock.performApply(configuration);
+ }
+
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ jarBlock.setDefaults(configuration);
+ propertiesBlock.setDefaults(configuration);
+ }
+
+
+ @Override
+ public boolean isValid(ILaunchConfiguration configuration) {
+ //System.out.println("isValid");
+ propertiesBlock.validate();
+ jarBlock.validate();
+ return super.isValid(configuration);
+ }
+
+ public static Group createGroup(Composite parent, String text, int columns,
+ int hspan, int fill) {
+ Group g = new Group(parent, SWT.NONE);
+ g.setLayout(new GridLayout(columns, false));
+ g.setText(text);
+ g.setFont(parent.getFont());
+ GridData gd = new GridData(fill);
+ gd.horizontalSpan = hspan;
+ g.setLayoutData(gd);
+ return g;
+ }
+
+
+}
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/JarBlock.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/JarBlock.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/JarBlock.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,104 @@
+package org.jboss.tools.profiler.internal.ui.launchtabs;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.swt.SWT;
+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.jboss.tools.profiler.internal.ui.launch.JBossProfilerLauncherConstants;
+
+public class JarBlock extends BaseBlock {
+
+ private Button fUseDefaultDirButton;
+ private Button fUseOtherDirButton;
+
+ public JarBlock(BaseLaunchConfigurationTab tab) {
+ super(tab);
+ }
+
+ public void createControl(Composite parent) {
+
+ Group group = new Group(parent, SWT.NONE);
+ group.setText(getName());
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
+ group.setLayout(layout);
+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ // default choice
+
+ fUseDefaultDirButton = new Button(group, SWT.RADIO);
+ fUseDefaultDirButton.setText("Default:");
+ fUseDefaultDirButton.addSelectionListener(fListener);
+
+ Text fWorkingDirText = createSingleText(group, 2);
+ fWorkingDirText.addModifyListener(fListener);
+ fWorkingDirText.setEnabled(false);
+ fWorkingDirText.setText("<embedded JBoss Profiler>");
+
+ // user enter choice
+ fUseOtherDirButton = new Button(group, SWT.RADIO);
+ fUseOtherDirButton.setText("Other:");
+ fUseOtherDirButton.addSelectionListener(fListener);
+
+ createText(group, "Location:", 0);
+
+ //new Label(group, SWT.None);
+ //new Label(group, SWT.None);
+
+ Composite comp = createComposite(group, parent.getFont(), 4, 3, GridData.FILL_BOTH, 0, 0);
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 1;
+ new Label(comp, SWT.NONE).setLayoutData(gd);
+ // buttons
+ createButtons(comp, new String[] {"Workspace...", "Filesystem...", "Variables..."});
+
+ }
+
+ public void performApply(ILaunchConfigurationWorkingCopy config) {
+ config.setAttribute(JBossProfilerLauncherConstants.PROFILER_JAR, getLocation());
+ config.setAttribute(JBossProfilerLauncherConstants.USE_EMBEDDED_JAR, fUseDefaultDirButton.getSelection());
+
+ }
+
+ public void initializeFrom(ILaunchConfiguration configuration) throws CoreException {
+ fLocationText.setText(configuration.getAttribute(JBossProfilerLauncherConstants.PROFILER_JAR, ""));
+ boolean useEmbedded = configuration.getAttribute(JBossProfilerLauncherConstants.USE_EMBEDDED_JAR, true);
+ fUseDefaultDirButton.setSelection(useEmbedded);
+ fUseOtherDirButton.setSelection(!useEmbedded);
+
+ }
+
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+
+ }
+
+ protected String getName() {
+ return "JBoss Profiler runtime";
+ }
+
+ @Override
+ protected String[] getFileFilter() {
+ return new String[] { "*.jar" };
+ }
+
+ protected boolean isFile() {
+ return false;
+ }
+
+
+ @Override
+ public String validate() {
+ if(fUseDefaultDirButton.getSelection()) {
+ return null;
+ }
+ return super.validate();
+ }
+}
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/LaunchTabGroup.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/LaunchTabGroup.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/LaunchTabGroup.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,31 @@
+package org.jboss.tools.profiler.internal.ui.launchtabs;
+
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.EnvironmentTab;
+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.JavaArgumentsTab;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaMainTab;
+
+public class LaunchTabGroup extends AbstractLaunchConfigurationTabGroup {
+
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
+ new JavaMainTab(),
+ new JavaArgumentsTab(),
+ new JBossProfilerTab(),
+ new JavaJRETab(),
+ new JavaClasspathTab(),
+ new SourceLookupTab(),
+ new EnvironmentTab(),
+ new CommonTab()
+ };
+ setTabs(tabs);
+
+ }
+
+}
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/PropertiesBlock.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/PropertiesBlock.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/launchtabs/PropertiesBlock.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,183 @@
+package org.jboss.tools.profiler.internal.ui.launchtabs;
+
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.variables.IStringVariableManager;
+import org.eclipse.core.variables.VariablesPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+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.jboss.tools.profiler.internal.ui.launch.JBossProfilerLauncherConstants;
+
+public class PropertiesBlock extends BaseBlock {
+
+ private Button fGenerateFileButton;
+ private Button fUseTemplateButton;
+ private Button saveOnExit;
+ private Button enable;
+ private BaseBlock saveLocation;
+
+ public PropertiesBlock(BaseLaunchConfigurationTab tab) {
+ super(tab);
+ }
+
+ public void createControl(Composite parent) {
+ Group group = new Group(parent, SWT.NONE);
+ group.setText("Configuration File");
+ group.setLayout(new GridLayout(2, false));
+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ fGenerateFileButton = new Button(group, SWT.RADIO);
+ fGenerateFileButton.setText("Generate a configuration file with the following settings:");
+ GridData gd = new GridData();
+ gd.horizontalSpan = 2;
+ fGenerateFileButton.setLayoutData(gd);
+ fGenerateFileButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateGenerateSettings(fGenerateFileButton.getSelection());
+ fTab.updateLaunchConfigurationDialog();
+ }
+ });
+
+ Composite c = new Composite(group, SWT.None);
+ GridLayout layout = new GridLayout(3,false);
+ c.setLayout(layout);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 2;
+ c.setLayoutData(gd);
+
+ enable = new Button(c, SWT.CHECK);
+ enable.setText("Enable profiler on start");
+ gd = new GridData();
+ gd.horizontalSpan = 3;
+ enable.setLayoutData(gd);
+
+ saveOnExit = new Button(c, SWT.CHECK);
+ saveOnExit.setText("Save snapshot on exit");
+ gd = new GridData();
+ gd.horizontalSpan = 3;
+ saveOnExit.setLayoutData(gd);
+
+ saveLocation = new BaseBlock(fTab) {
+ @Override
+ protected String getName() {
+ return "Save snapshot location:";
+ }
+
+
+
+ @Override
+ protected boolean isFile() {
+ return false;
+ }
+ };
+
+ saveLocation.createControl(c);
+
+ fUseTemplateButton = new Button(group, SWT.RADIO);
+ fUseTemplateButton.setText("Use an existing jboss-profiler.properties");
+ fUseTemplateButton.addSelectionListener(fListener);
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ fUseTemplateButton.setLayoutData(gd);
+
+ createText(group, "Location:", 20);
+
+ Composite buttons = new Composite(group, SWT.NONE);
+ layout = new GridLayout(4, false);
+ layout.marginHeight = layout.marginWidth = 0;
+ buttons.setLayout(layout);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ buttons.setLayoutData(gd);
+
+ Label label = new Label(buttons, SWT.NONE);
+ label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ createButtons(buttons, new String[] {"Workspace...","File system...","Variables..."});
+
+ }
+
+ public void initializeFrom(ILaunchConfiguration configuration) throws CoreException {
+ boolean generateDefault = configuration.getAttribute(JBossProfilerLauncherConstants.GENERATE_PROPERTIES, true);
+ fGenerateFileButton.setSelection(generateDefault);
+
+ updateGenerateSettings(generateDefault);
+
+ fUseTemplateButton.setSelection(!generateDefault);
+ fLocationText.setText(configuration.getAttribute(JBossProfilerLauncherConstants.PROPERTIES_FILE, ""));
+ enableBrowseSection(!generateDefault);
+
+ enable.setSelection(configuration.getAttribute(JBossProfilerLauncherConstants.ENABLE_ON_STARTUP, true));
+ saveOnExit.setSelection(configuration.getAttribute(JBossProfilerLauncherConstants.SAVE_ON_EXIT, true));
+
+ saveLocation.setLocation(configuration.getAttribute(JBossProfilerLauncherConstants.SAVE_LOCATION, "."));
+
+ }
+
+ private void updateGenerateSettings(boolean generateEnabled) {
+ enable.setEnabled(generateEnabled);
+ saveOnExit.setEnabled(generateEnabled);
+ saveLocation.enableBrowseSection(generateEnabled);
+ }
+
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ configuration.setAttribute(JBossProfilerLauncherConstants.GENERATE_PROPERTIES, fGenerateFileButton.getSelection());
+ configuration.setAttribute(JBossProfilerLauncherConstants.ENABLE_ON_STARTUP, enable.getSelection());
+ configuration.setAttribute(JBossProfilerLauncherConstants.SAVE_ON_EXIT, saveOnExit.getSelection());
+ configuration.setAttribute(JBossProfilerLauncherConstants.SAVE_LOCATION, saveLocation.getLocation());
+ configuration.setAttribute(JBossProfilerLauncherConstants.PROPERTIES_FILE, getLocation()==""?null:getLocation());
+
+ }
+
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ configuration.setAttribute(JBossProfilerLauncherConstants.GENERATE_PROPERTIES, true);
+ configuration.setAttribute(JBossProfilerLauncherConstants.PROPERTIES_FILE, (String)null);
+
+
+
+ }
+
+ protected String getName() {
+ return "Properties";
+ }
+
+ protected boolean isFile() {
+ return true;
+ }
+
+
+
+ @Override
+ protected String[] getFileFilter() {
+ return new String[] {"*.properties"};
+ }
+
+ protected String getLocation() {
+ String path = fLocationText.getText().trim();
+ IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
+ try {
+ return manager.performStringSubstitution(path, false);
+ } catch (CoreException e) {
+ return path;
+ }
+ }
+
+
+ public String validate() {
+
+ if (fGenerateFileButton.getSelection())
+ return null;
+ return super.validate();
+ }
+
+}
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/messages.properties
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/messages.properties (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/messages.properties 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,19 @@
+BaseBlock_cannot_open_directory=The specified directory could not be opened
+BaseBlock_cannot_open_file=The specified file could not be opened
+BaseBlock_choose_a_directory=Choose a directory
+BaseBlock_choose_location_relative_to_ws=Choose a location relative to the workspace:
+BaseBlock_directory_not_found=Directory not found
+BaseBlock_file_not_found=File not found
+BaseBlock_filesystem=Filesystem...
+BaseBlock_open_directory=Open directory
+BaseBlock_open_file=Open file
+BaseBlock_select_directory=Select directory
+BaseBlock_select_file=Select File
+BaseBlock_select_properties_file=Select properties file for JBoss Profiler
+BaseBlock_the_is_not_specified=The {0} is not specified
+BaseBlock_variables=Variables...
+BaseBlock_workspace=Workspace...
+JBossProfilerUiPlugin_no_message=<No Message>
+LaunchUtils_probem_finding_embedded_runtime=Problem finding embedded runtime
+LaunchUtils_problem_finding_embedded_agent_runtime=Problem finding embedded agent runtime
+LaunchUtils_problem_finding_embedded_client=Problem finding embedded client runtime
Added: trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/util/FileNameFilter.java
===================================================================
--- trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/util/FileNameFilter.java (rev 0)
+++ trunk/profiler/plugins/org.jboss.tools.profiler.ui/src/org/jboss/tools/profiler/internal/ui/util/FileNameFilter.java 2009-06-15 11:23:29 UTC (rev 15948)
@@ -0,0 +1,45 @@
+package org.jboss.tools.profiler.internal.ui.util;
+
+import org.eclipse.core.resources.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+public class FileNameFilter extends ViewerFilter {
+
+ private String[] validFilters;
+
+ public FileNameFilter(String[] strings) {
+ validFilters = strings;
+ }
+
+ public boolean select(Viewer viewer, Object parent, Object element) {
+ if (element instanceof IFile) {
+ String name = ((IFile) element).getName();
+ for (String filter : validFilters) {
+ if(filter.contains("*.")) {
+ return name.endsWith(filter.substring(filter.indexOf("*.")+1));
+ } else {
+ return validFilters.equals(name);
+ }
+ }
+ }
+
+ if (element instanceof IProject && !((IProject) element).isOpen())
+ return false;
+
+ if (element instanceof IContainer) { // i.e. IProject, IFolder
+ try {
+ IResource[] resources = ((IContainer) element).members();
+ for (int i = 0; i < resources.length; i++) {
+ if (select(viewer, parent, resources[i]))
+ return true;
+ }
+ } catch (CoreException e) {
+ //ignore
+ }
+ }
+ return false;
+ }
+
+}
15 years, 7 months
JBoss Tools SVN: r15947 - trunk/esb/docs/esb_ref_guide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-06-15 07:02:34 -0400 (Mon, 15 Jun 2009)
New Revision: 15947
Modified:
trunk/esb/docs/esb_ref_guide/en/modules/esb_editor.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-363 - XML editor description updated
Modified: trunk/esb/docs/esb_ref_guide/en/modules/esb_editor.xml
===================================================================
--- trunk/esb/docs/esb_ref_guide/en/modules/esb_editor.xml 2009-06-15 10:06:02 UTC (rev 15946)
+++ trunk/esb/docs/esb_ref_guide/en/modules/esb_editor.xml 2009-06-15 11:02:34 UTC (rev 15947)
@@ -181,6 +181,7 @@
with feedback and contextual error checking as you type. In the Source viewer, if at
any point a tag is incorrect or incomplete, an error will be indicated next to the
line and also in the <property>Problems view</property> below.</para>
+
</section>
<section id="ESBSupportXMLSchema">
@@ -188,6 +189,7 @@
<para>JBoss ESB Framework fully <link linkend="sourceView">supports XML files based on
schemas as well as DTDs</link>.</para>
+ <para>The schema checks the child elements of any kind of provider element; the ESB generates errors on startup if you attempt to define an incorrect combination (e.g.: a jms-bus inside an ftp-provider).</para>
<note><title>Note:</title>
<para>The schema used behind ESB editor now uses the latest version available (from SOA-P 4.3). This removes the errors/warnings some users have reported seeing when using SOA-P specific esb.xml files.</para> </note>
15 years, 7 months
JBoss Tools SVN: r15946 - trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-06-15 06:06:02 -0400 (Mon, 15 Jun 2009)
New Revision: 15946
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/EarModuleDependenciesPropertyPage.java
Log:
Committing update in case eclipse guys check it out today.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java 2009-06-15 09:07:32 UTC (rev 15945)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java 2009-06-15 10:06:02 UTC (rev 15946)
@@ -36,33 +36,27 @@
import org.eclipse.jdt.ui.wizards.BuildPathDialogAccess;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TextCellEditor;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.window.Window;
-import org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseApplicationDataModelProvider;
-import org.eclipse.jst.j2ee.application.internal.operations.RemoveComponentFromEnterpriseApplicationDataModelProvider;
import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualArchiveComponent;
-import org.eclipse.jst.j2ee.internal.AvailableJ2EEComponentsForEARContentProvider;
import org.eclipse.jst.j2ee.internal.IJ2EEDependenciesControl;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
import org.eclipse.jst.j2ee.internal.ManifestUIResourceHandler;
-import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil;
import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants;
import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
import org.eclipse.jst.j2ee.project.facet.IJavaProjectMigrationDataModelProperties;
import org.eclipse.jst.j2ee.project.facet.JavaProjectMigrationDataModelProvider;
import org.eclipse.swt.SWT;
@@ -104,16 +98,13 @@
IJ2EEDependenciesControl {
protected final String PATH_SEPARATOR = ComponentDependencyContentProvider.PATH_SEPARATOR;
- protected boolean showRuntimePath;
protected final IProject project;
protected final J2EEDependenciesPage propPage;
protected IVirtualComponent rootComponent = null;
protected Text componentNameText;
protected Label availableModules;
- protected CheckboxTableViewer availableComponentsViewer;
- protected Button selectAllButton;
- protected Button deselectAllButton;
- protected Button projectButton;
+ protected TableViewer availableComponentsViewer;
+ protected Button projectButton, removeButton;
protected Button projectJarButton;
protected Button externalJarButton;
protected Button addVariableButton;
@@ -124,8 +115,7 @@
protected HashMap<IVirtualComponent, String> oldComponentToRuntimePath = new HashMap<IVirtualComponent, String>();
- // This should keep a list of all elements currently in the list, even if
- // unchecked
+ // This should keep a list of all elements currently in the list (not removed)
protected HashMap<Object, String> objectToRuntimePath = new HashMap<Object, String>();
// [Bug 238264] the cached list elements that are new and need to be
@@ -141,17 +131,8 @@
this.project = project;
this.propPage = page;
rootComponent = ComponentCore.createComponent(project);
- this.showRuntimePath = true;
}
- protected boolean getShowRuntimePath() {
- return this.showRuntimePath;
- }
-
- protected void setShowRuntimePath(boolean bool) {
- this.showRuntimePath = bool;
- }
-
/*
* UI Creation Methods
*/
@@ -215,13 +196,7 @@
createPushButtons();
}
- // TODO add a project button here
protected void createPushButtons() {
- String SELECT_ALL_BUTTON = ManifestUIResourceHandler.Select_All_3;
- String DE_SELECT_ALL_BUTTON = ManifestUIResourceHandler.Deselect_All_4;
-
- selectAllButton = createPushButton(SELECT_ALL_BUTTON);
- deselectAllButton = createPushButton(DE_SELECT_ALL_BUTTON);
projectButton = createPushButton("Add Project...");
projectJarButton = createPushButton(J2EEUIMessages
.getResourceString(J2EEUIMessages.PROJECT_JAR));
@@ -229,6 +204,7 @@
.getResourceString(J2EEUIMessages.EXTERNAL_JAR));
addVariableButton = createPushButton(J2EEUIMessages
.getResourceString(J2EEUIMessages.ADDVARIABLE));
+ removeButton = createPushButton("Remove selected...");
}
protected Button createPushButton(String label) {
@@ -267,8 +243,6 @@
provider.setRuntimePaths(objectToRuntimePath);
availableComponentsViewer.setContentProvider(provider);
availableComponentsViewer.setLabelProvider(provider);
- availableComponentsViewer
- .setFilters(new ViewerFilter[] { provider });
addTableListeners();
}
}
@@ -277,9 +251,7 @@
* Subclasses should over-ride this and extend the class
*/
protected ComponentDependencyContentProvider createProvider() {
- int j2eeVersion = J2EEVersionUtil
- .convertVersionStringToInt(rootComponent);
- return new ComponentDependencyContentProvider(rootComponent);
+ return new ComponentDependencyContentProvider();
}
/*
@@ -287,9 +259,9 @@
*/
protected void addTableListeners() {
- addCheckStateListener();
addHoverHelpListeners();
addDoubleClickListener();
+ addSelectionListener();
}
protected void addHoverHelpListeners() {
@@ -343,9 +315,7 @@
}
case SWT.MouseHover: {
TableItem item = table.getItem(new Point(event.x, event.y));
- if (item != null) {
- if (!item.getGrayed())
- return;
+ if (item != null && item.getData() != null && !canEdit(item.getData())) {
if (tip != null && !tip.isDisposed())
tip.dispose();
tip = new Shell(PlatformUI.getWorkbench()
@@ -362,8 +332,7 @@
label.setBackground(Display.getDefault()
.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
label.setData("_TABLEITEM", item); //$NON-NLS-1$
- label
- .setText(J2EEUIMessages
+ label.setText(J2EEUIMessages
.getResourceString(J2EEUIMessages.HOVER_HELP_FOR_DISABLED_LIBS));
label.addListener(SWT.MouseExit, labelListener);
label.addListener(SWT.MouseDown, labelListener);
@@ -379,6 +348,11 @@
};
}
+ protected boolean canEdit(Object data) {
+ return !(data != null && data instanceof VirtualArchiveComponent
+ && isPhysicallyAdded((VirtualArchiveComponent)data));
+ }
+
protected void addDoubleClickListener() {
availableComponentsViewer.setColumnProperties(new String[] { "a", "b",
"c" });
@@ -390,6 +364,24 @@
.setCellModifier(new RuntimePathCellModifier());
}
+ protected void addSelectionListener() {
+ availableComponentsViewer.addSelectionChangedListener(
+ new ISelectionChangedListener(){
+ public void selectionChanged(SelectionChangedEvent event) {
+ viewerSelectionChanged();
+ }
+ });
+ }
+
+ protected void viewerSelectionChanged() {
+ removeButton.setEnabled(getSelectedObject() != null && canEdit(getSelectedObject()));
+ }
+
+ protected Object getSelectedObject() {
+ IStructuredSelection sel = (IStructuredSelection)availableComponentsViewer.getSelection();
+ return sel.getFirstElement();
+ }
+
private class RuntimePathCellModifier implements ICellModifier {
public boolean canModify(Object element, String property) {
@@ -431,11 +423,7 @@
}
public void handleEvent(Event event) {
- if (event.widget == selectAllButton)
- handleSelectAllButtonPressed();
- else if (event.widget == deselectAllButton)
- handleDeselectAllButtonPressed();
- else if (event.widget == projectButton)
+ if (event.widget == projectButton)
handleSelectProjectButton();
else if (event.widget == projectJarButton)
handleSelectProjectJarButton();
@@ -443,26 +431,10 @@
handleSelectExternalJarButton();
else if (event.widget == addVariableButton)
handleSelectVariableButton();
+ else if( event.widget == removeButton )
+ handleRemoveSelectedButton();
}
- private void handleSelectAllButtonPressed() {
- TableItem[] children = availableComponentsViewer.getTable().getItems();
- for (int i = 0; i < children.length; i++) {
- TableItem item = children[i];
- if (!item.getGrayed())
- item.setChecked(true);
- }
- }
-
- private void handleDeselectAllButtonPressed() {
- TableItem[] children = availableComponentsViewer.getTable().getItems();
- for (int i = 0; i < children.length; i++) {
- TableItem item = children[i];
- if (!item.getGrayed())
- item.setChecked(false);
- }
- }
-
private void handleSelectProjectButton() {
SelectProjectDialog d = new SelectProjectDialog(new Shell(),
getProjectLabelProvider(), getProjectContentProvider());
@@ -637,35 +609,26 @@
}
}
- // TODO FIX THIS
- protected void addCheckStateListener() {
- availableComponentsViewer
- .addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- CheckboxTableViewer vr = (CheckboxTableViewer) event
- .getSource();
- Object element = event.getElement();
- if (vr.getGrayed(element))
- vr.setChecked(element, !vr.getChecked(element));
- Object o = event.getSource();
-
- // TODO : check for conflict + dependency res
- }
- });
+ protected void handleRemoveSelectedButton() {
+ ISelection sel = availableComponentsViewer.getSelection();
+ if( sel instanceof IStructuredSelection ) {
+ Object o = ((IStructuredSelection)sel).getFirstElement();
+ objectToRuntimePath.remove(o);
+ refresh();
+ }
}
- public CheckboxTableViewer createAvailableComponentsViewer(Composite parent) {
- int flags = SWT.CHECK | SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI;
+ public TableViewer createAvailableComponentsViewer(Composite parent) {
+ int flags = SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI;
Table table = new Table(parent, flags);
- availableComponentsViewer = new CheckboxTableViewer(table);
+ availableComponentsViewer = new TableViewer(table);
// set up table layout
TableLayout tableLayout = new org.eclipse.jface.viewers.TableLayout();
tableLayout.addColumnData(new ColumnWeightData(300, true));
tableLayout.addColumnData(new ColumnWeightData(300, true));
- if (showRuntimePath)
- tableLayout.addColumnData(new ColumnWeightData(200, true));
+ tableLayout.addColumnData(new ColumnWeightData(200, true));
table.setLayout(tableLayout);
table.setHeaderVisible(true);
table.setLinesVisible(true);
@@ -680,11 +643,9 @@
projectColumn.setText(ManifestUIResourceHandler.Project_UI_);
projectColumn.setResizable(true);
- if (showRuntimePath) {
- TableColumn bndColumn = new TableColumn(table, SWT.NONE, 2);
- bndColumn.setText(ManifestUIResourceHandler.Packed_In_Lib_UI_);
- bndColumn.setResizable(true);
- }
+ TableColumn bndColumn = new TableColumn(table, SWT.NONE, 2);
+ bndColumn.setText(ManifestUIResourceHandler.Packed_In_Lib_UI_);
+ bndColumn.setResizable(true);
tableLayout.layout(table, true);
return availableComponentsViewer;
@@ -701,62 +662,6 @@
}
}
- private boolean secondShouldBeDisabled(IVirtualComponent component) {
- if (component.isBinary())
- return false;
- if (JavaEEProjectUtilities.isApplicationClientComponent(component))
- return true;
- if (JavaEEProjectUtilities.isEARProject(component.getProject())
- && component.isBinary())
- return false;
- if (JavaEEProjectUtilities.isEJBComponent(component))
- return true;
- if (JavaEEProjectUtilities.isDynamicWebComponent(component))
- return true;
- if (JavaEEProjectUtilities.isJCAComponent(component))
- return true;
- if (JavaEEProjectUtilities.isStaticWebProject(component.getProject()))
- return true;
- if (JavaEEProjectUtilities.isProjectOfType(component.getProject(),
- IJ2EEFacetConstants.JAVA))
- return false;
- return false;
- }
-
- private boolean isInLibDir(VirtualArchiveComponent comp) {
- IPath p = comp.getProjectRelativePath();
- if (p.segmentCount() == 2)
- return false;
- return true;
- }
-
- private boolean isConflict(Object lib) {
- IProject libProj = (lib instanceof IProject) ? (IProject) lib
- : ((IVirtualComponent) lib).getProject();
- IProject earProject = rootComponent.getProject();
- try {
- IVirtualComponent cmp = ComponentCore.createComponent(earProject);
- IProject[] earRefProjects = earProject.getReferencedProjects();
- for (int i = 0; i < earRefProjects.length; i++) {
- if (!J2EEProjectUtilities.isEARProject(earRefProjects[i])
- && !earRefProjects[i].equals(libProj)) {
- IVirtualComponent cmp1 = ComponentCore
- .createComponent(earRefProjects[i]);
- IVirtualReference[] refs = cmp1.getReferences();
- for (int j = 0; j < refs.length; j++) {
- if (refs[j].getReferencedComponent().getProject()
- .equals(libProj))
- return true;
- }
- }
- }
- return false;
- } catch (CoreException ce) {
- J2EEUIPlugin.logError(ce);
- }
- return false;
- }
-
private void handleSelectProjectJarButton() {
IPath[] selected = BuildPathDialogAccess.chooseJAREntries(propPage
.getShell(), project.getLocation(), new IPath[0]);
@@ -787,39 +692,14 @@
* tasks
*/
public void refresh() {
- TableItem[] items = availableComponentsViewer.getTable().getItems();
- HashMap<Object, Boolean> checked = cacheChecked();
resetTableUI();
if (!hasInitialized) {
initialize();
resetTableUI();
}
- /*
- * Re-check any added elements that were checked but now lost their
- * check
- */
- TableItem[] newItems = availableComponentsViewer.getTable().getItems();
- for (int i = 0; i < newItems.length; i++) {
- if (checked.containsKey(newItems[i].getData()))
- newItems[i].setChecked(checked.get(newItems[i].getData()));
- }
}
- protected HashMap<Object, Boolean> cacheChecked() {
- // preserve selections / check / etc of new (added) entities
- TableItem[] items = availableComponentsViewer.getTable().getItems();
- HashMap<Object, Boolean> checked = new HashMap<Object, Boolean>();
- if (addedElements != null) {
- int j = 0;
- for (int i = 0; i < items.length; i++) {
- if (addedElements.contains(items[i].getData()))
- checked.put(items[i].getData(), items[i].getChecked());
- }
- }
- return checked;
- }
-
protected void resetTableUI() {
IWorkspaceRoot input = ResourcesPlugin.getWorkspace().getRoot();
availableComponentsViewer.setInput(input);
@@ -832,91 +712,20 @@
GridData btndata = new GridData(GridData.HORIZONTAL_ALIGN_FILL
| GridData.VERTICAL_ALIGN_BEGINNING);
buttonColumn.setLayoutData(btndata);
-
- // [Bug 238264] for all the jars in the cache temparaly list them in the
- // grid
- TableItem[] items = availableComponentsViewer.getTable().getItems();
- for (Object addedElement : this.addedElements) {
- boolean found = false;
- for (int i = 0; i < items.length; i++) {
- if (items[i].getData().equals(addedElement))
- found = true;
- }
- if (!found)
- availableComponentsViewer.add(addedElement);
- }
}
protected void initialize() {
- TableItem[] items = availableComponentsViewer.getTable().getItems();
-
- // First initialize the paths
- Object data;
- for (int i = 0; i < items.length; i++) {
- data = items[i].getData();
- if (data instanceof IVirtualComponent) {
- IVirtualReference ref = rootComponent
- .getReference(((IVirtualComponent) data).getName());
- String val = ref == null ? new Path(PATH_SEPARATOR).toString()
- : ref.getRuntimePath().toString();
- objectToRuntimePath.put(data, val);
- oldComponentToRuntimePath.put((IVirtualComponent) data, val);
- }
+ IVirtualReference[] refs = rootComponent.getReferences();
+ IVirtualComponent comp;
+ for( int i = 0; i < refs.length; i++ ) {
+ comp = refs[i].getReferencedComponent();
+ String val = refs[i].getRuntimePath().toString();
+ objectToRuntimePath.put(comp, val);
+ oldComponentToRuntimePath.put((IVirtualComponent) comp, val);
}
-
- // Then initialize the UI
- List forceCheck = new ArrayList();
- forceCheck.addAll(getChildrenComponents());
- forceCheck.addAll(getCPComponents());
- for (int i = 0; i < items.length; i++) {
- if (forceCheck.contains(items[i].getData()))
- items[i].setChecked(true);
-
- if (items[i].getData() instanceof VirtualArchiveComponent)
- items[i]
- .setGrayed(isPhysicallyAdded(((VirtualArchiveComponent) items[i]
- .getData())));
- }
hasInitialized = true;
}
- protected List getChildrenComponents() {
- List list = new ArrayList();
- IVirtualReference refs[] = rootComponent.getReferences();
- for (int i = 0; i < refs.length; i++) {
- if (isChildComponent(refs[i]))
- list.add(refs[i].getReferencedComponent());
- }
- return list;
- }
-
- protected boolean isChildComponent(IVirtualReference ref) {
- // if ((ref.getRuntimePath().isRoot() && !inLibFolder) ||
- // (!ref.getRuntimePath().isRoot() && inLibFolder) ||
- // !isVersion5) {
- return true;
- }
-
- protected List getCPComponents() {
- List list = new ArrayList();
- Map pathToComp = new HashMap();
- IVirtualReference refs[] = rootComponent.getReferences();
- for (int i = 0; i < refs.length; i++) {
- if (isChildComponent(refs[i])) {
- IVirtualComponent comp = refs[i].getReferencedComponent();
- addClasspathComponentDependencies(list, pathToComp, comp);
- }
- }
- return list;
- }
-
- protected void addClasspathComponentDependencies(final List componentList,
- final Map pathToComp, final IVirtualComponent referencedComponent) {
- AvailableJ2EEComponentsForEARContentProvider
- .addClasspathComponentDependencies(componentList, pathToComp,
- referencedComponent);
- }
-
/*
* Clean-up methods are below. These include performCancel, performDefaults,
* performOK, and any other methods that are called *only* by this one.
@@ -961,8 +770,7 @@
ArrayList<Object> checked = new ArrayList<Object>();
TableItem[] items = availableComponentsViewer.getTable().getItems();
for (int i = 0; i < items.length; i++)
- if (items[i].getChecked())
- checked.add(items[i].getData());
+ checked.add(items[i].getData());
// Fill our delta lists
ArrayList<Object> added = new ArrayList<Object>();
@@ -974,7 +782,7 @@
while (j.hasNext()) {
key = j.next();
val = oldComponentToRuntimePath.get(key);
- if (!checked.contains(key))
+ if( !objectToRuntimePath.containsKey(key))
removed.add((IVirtualComponent)key);
else if (!val.equals(objectToRuntimePath.get(key)))
changed.add((IVirtualComponent)key);
@@ -993,8 +801,24 @@
return false;
handleDeltas(removed, changed, added);
-
subResult &= postHandleChanges(monitor);
+
+ // Now update the variables
+ oldComponentToRuntimePath.clear();
+ ArrayList keys = new ArrayList();
+ keys.addAll(objectToRuntimePath.keySet());
+ Iterator i = keys.iterator();
+ while(i.hasNext()) {
+ Object component = i.next();
+ IVirtualComponent vc = component instanceof IVirtualComponent ? (IVirtualComponent)component : null;
+ String path = objectToRuntimePath.get(component);
+ if( component instanceof IProject ) {
+ objectToRuntimePath.remove(component);
+ vc = ComponentCore.createComponent((IProject)component);
+ objectToRuntimePath.put(vc, path);
+ }
+ oldComponentToRuntimePath.put(vc, path);
+ }
return subResult;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java 2009-06-15 09:07:32 UTC (rev 15945)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java 2009-06-15 10:06:02 UTC (rev 15946)
@@ -11,9 +11,7 @@
*******************************************************************************/
package org.jboss.ide.eclipse.as.wtp.override.ui.propertypage;
-import java.util.ArrayList;
import java.util.HashMap;
-import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
@@ -22,137 +20,50 @@
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jst.j2ee.application.internal.operations.ClassPathSelection;
-import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
-import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
-import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-public class ComponentDependencyContentProvider extends ViewerFilter implements IStructuredContentProvider, ITableLabelProvider {
+
+/*
+ * The only valid elements this content provider (should) provide
+ * are IProject or IVirtualComponent objects. The runtime paths portion is
+ * shared with the preference page itself where they can both modify the data.
+ *
+ * The pref page should initialize its data first so that this provider can
+ * spit out the proper information.
+ */
+public class ComponentDependencyContentProvider extends LabelProvider implements IStructuredContentProvider, ITableLabelProvider {
final static String PATH_SEPARATOR = String.valueOf(IPath.SEPARATOR);
- private IVirtualComponent rootComponent;
private HashMap<Object, String> runtimePaths;
- public ComponentDependencyContentProvider(IVirtualComponent rootComponent) {
+ public ComponentDependencyContentProvider() {
super();
- this.rootComponent = rootComponent;
}
public void setRuntimePaths(HashMap<Object, String> paths) {
this.runtimePaths = paths;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
public Object[] getElements(Object inputElement) {
- if( rootComponent == null )
- return new Object[]{};
-
Object[] empty = new Object[0];
- if (!(inputElement instanceof IWorkspaceRoot))
+ if( !(inputElement instanceof IWorkspaceRoot))
return empty;
- IProject[] projects = ((IWorkspaceRoot) inputElement).getProjects();
- if (projects == null || projects.length == 0)
- return empty;
- List validCompList = new ArrayList();
- HashMap pathToComp = new HashMap();
- for (int i = 0; i < projects.length; i++) {
- // get flexible project
- IProject project = projects[i];
- if(ModuleCoreNature.isFlexibleProject(project)){
- IVirtualComponent component = ComponentCore.createComponent(project);
- if( !component.equals(rootComponent))
- validCompList.add(component);
- else {
- IVirtualReference[] newrefs = component.getReferences();
- for( int k=0; k< newrefs.length; k++ ){
- IVirtualReference tmpref = newrefs[k];
- IVirtualComponent referencedcomp = tmpref.getReferencedComponent();
- boolean isBinary = referencedcomp.isBinary();
- if( isBinary ){
- validCompList.add(referencedcomp);
- } else {
- addClasspathComponentDependencies(validCompList,pathToComp, referencedcomp);
- }
- }
- }
- } else if (project.exists() && project.isAccessible() ){
- if( !project.getName().startsWith(".") ) //$NON-NLS-1$
- validCompList.add(project);
- }
- }
- return validCompList.toArray();
+ return runtimePaths.keySet().toArray();
}
- public static void addClasspathComponentDependencies(final List componentList, HashMap pathToComp, final IVirtualComponent referencedComponent) {
- if (referencedComponent instanceof J2EEModuleVirtualComponent) {
- J2EEModuleVirtualComponent j2eeComp = (J2EEModuleVirtualComponent) referencedComponent;
- IVirtualReference[] cpRefs = j2eeComp.getJavaClasspathReferences();
- for (int j=0; j < cpRefs.length; j++) {
- String unresolvedURI = null;
- // only ../ mappings supported at this level
- if (!cpRefs[j].getRuntimePath().equals(IClasspathDependencyConstants.RUNTIME_MAPPING_INTO_CONTAINER_PATH)) {
- continue;
- }
- // if the absolute path for this component already has a mapping, skip (the comp might be contributed by more than
- // one child module)
- final IPath path = ClasspathDependencyUtil.getClasspathVirtualReferenceLocation(cpRefs[j]);
- final IVirtualComponent comp = (IVirtualComponent) pathToComp.get(path);
- if (comp != null) {
- // replace with a temp VirtualArchiveComponent whose IProject is set to a new pseudo name that is
- // the concatenation of all project contributions for that archive
- if (comp instanceof VirtualArchiveComponent) {
- final VirtualArchiveComponent oldComp = (VirtualArchiveComponent) comp;
- componentList.remove(comp);
- final VirtualArchiveComponent newComponent = ClassPathSelection.updateDisplayVirtualArchiveComponent(oldComp, cpRefs[j]);
- pathToComp.put(path, newComponent);
- componentList.add(newComponent);
- }
- continue;
- } else {
- pathToComp.put(path, cpRefs[j].getReferencedComponent());
- }
- componentList.add(cpRefs[j].getReferencedComponent());
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
- */
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
- /*
- * Because the Dependency page modifies the rows by hand,
- * and also because there's a Cell modifier used, we need
- * to know the most recent change, so we reference runtimePaths
- */
public String getColumnText(Object element, int columnIndex) {
if (element instanceof IVirtualComponent) {
IVirtualComponent comp = (IVirtualComponent)element;
- String name = ""; //$NON-NLS-1$
if( columnIndex == 0 ){
- if (ClasspathDependencyUtil.isClasspathComponentDependency(comp)) {
- return ClasspathDependencyUtil.getClasspathComponentDependencyDisplayString(comp);
- }
- name = comp.getName();
- return name;
+ return comp.getName();
} else if (columnIndex == 1) {
return comp.getProject().getName();
} else if (columnIndex == 2) {
@@ -174,28 +85,6 @@
return null;
}
- /*
- * Do we want this element to be shown or not?
- */
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- return true;
- }
-
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
-
- public void dispose() {
- }
-
- public void addListener(ILabelProviderListener listener) {
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- }
-
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/EarModuleDependenciesPropertyPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/EarModuleDependenciesPropertyPage.java 2009-06-15 09:07:32 UTC (rev 15945)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/EarModuleDependenciesPropertyPage.java 2009-06-15 10:06:02 UTC (rev 15946)
@@ -1,7 +1,6 @@
package org.jboss.ide.eclipse.as.wtp.override.ui.propertypage;
import java.util.ArrayList;
-import java.util.List;
import java.util.Set;
import org.eclipse.core.commands.ExecutionException;
@@ -13,7 +12,6 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseApplicationDataModelProvider;
import org.eclipse.jst.j2ee.application.internal.operations.RemoveComponentFromEnterpriseApplicationDataModelProvider;
import org.eclipse.jst.j2ee.internal.J2EEConstants;
@@ -81,10 +79,6 @@
}
}
}
-
- protected ComponentDependencyContentProvider createProvider() {
- return new EarComponentDependencyContentProvider(rootComponent);
- }
protected void createPushButtons() {
super.createPushButtons();
@@ -199,24 +193,4 @@
protected IDataModelProvider getAddReferenceDataModelProvider(IVirtualComponent component) {
return new AddComponentToEnterpriseApplicationDataModelProvider();
}
-
-
- public class EarComponentDependencyContentProvider
- extends ComponentDependencyContentProvider {
-
- public EarComponentDependencyContentProvider(
- IVirtualComponent rootComponent) {
- super(rootComponent);
- }
-
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- List forceCheck = new ArrayList();
- forceCheck.addAll(getChildrenComponents());
- forceCheck.addAll(getCPComponents());
- if( forceCheck.contains(element) || addedElements.contains(element))
- return true;
- return false;
- }
- }
-
}
15 years, 7 months
JBoss Tools SVN: r15945 - trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-06-15 05:07:32 -0400 (Mon, 15 Jun 2009)
New Revision: 15945
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java
Log:
JBIDE-4482: java.lang.NullPointerException at org.eclipse.jface.viewers.ColumnViewer$2.getCellEditor(ColumnViewer.java:239) when click the propertyid of a correlation
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java 2009-06-15 09:06:49 UTC (rev 15944)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java 2009-06-15 09:07:32 UTC (rev 15945)
@@ -100,7 +100,11 @@
// Update the UnusedPropertyFilter with the proper contents.
propertyFilter.setCandidates(((CorrelationSet)getInput()).getProperties(),
Collections.singletonList(element));
- return true;
+
+ // change true to false by Grid.Qian
+ // because the cell editor is null, if the column can be modified,
+ // when the system will active the cell editor, will get a null exception
+ return false;
}
public Object getValue(Object element, String property) {
return element;
15 years, 7 months
JBoss Tools SVN: r15944 - trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-06-15 05:06:49 -0400 (Mon, 15 Jun 2009)
New Revision: 15944
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java
Log:
JBIDE-4482: java.lang.NullPointerException at org.eclipse.jface.viewers.ColumnViewer$2.getCellEditor(ColumnViewer.java:239) when click the propertyid of a correlation
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java 2009-06-15 09:05:46 UTC (rev 15943)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java 2009-06-15 09:06:49 UTC (rev 15944)
@@ -100,7 +100,6 @@
// Update the UnusedPropertyFilter with the proper contents.
propertyFilter.setCandidates(((CorrelationSet)getInput()).getProperties(),
Collections.singletonList(element));
-
return true;
}
public Object getValue(Object element, String property) {
15 years, 7 months
JBoss Tools SVN: r15943 - trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-06-15 05:05:46 -0400 (Mon, 15 Jun 2009)
New Revision: 15943
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java
Log:
JBIDE-4482: java.lang.NullPointerException at org.eclipse.jface.viewers.ColumnViewer$2.getCellEditor(ColumnViewer.java:239) when click the propertyid of a correlation
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java 2009-06-15 09:02:07 UTC (rev 15942)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java 2009-06-15 09:05:46 UTC (rev 15943)
@@ -101,10 +101,7 @@
propertyFilter.setCandidates(((CorrelationSet)getInput()).getProperties(),
Collections.singletonList(element));
- // change true to false by Grid.Qian
- // because the cell editor is null, if the column can be modified,
- // when the system will active the cell editor, will get a null exception
- return false;
+ return true;
}
public Object getValue(Object element, String property) {
return element;
15 years, 7 months
JBoss Tools SVN: r15942 - trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-06-15 05:02:07 -0400 (Mon, 15 Jun 2009)
New Revision: 15942
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java
Log:
JBIDE-4482: java.lang.NullPointerException at org.eclipse.jface.viewers.ColumnViewer$2.getCellEditor(ColumnViewer.java:239) when click the propertyid of a correlation
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java 2009-06-15 02:35:37 UTC (rev 15941)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/CorrSetImplSection.java 2009-06-15 09:02:07 UTC (rev 15942)
@@ -100,7 +100,11 @@
// Update the UnusedPropertyFilter with the proper contents.
propertyFilter.setCandidates(((CorrelationSet)getInput()).getProperties(),
Collections.singletonList(element));
- return true;
+
+ // change true to false by Grid.Qian
+ // because the cell editor is null, if the column can be modified,
+ // when the system will active the cell editor, will get a null exception
+ return false;
}
public Object getValue(Object element, String property) {
return element;
@@ -148,8 +152,8 @@
@Override
protected void addAllAdapters() {
super.addAllAdapters();
- List corrList = ((CorrelationSet)getInput()).getProperties();
- for (Iterator it = corrList.iterator(); it.hasNext(); ) {
+ List<Property> corrList = ((CorrelationSet)getInput()).getProperties();
+ for (Iterator<Property> it = corrList.iterator(); it.hasNext(); ) {
Property property = (Property)it.next();
fAdapters[1].addToObject(property);
}
15 years, 7 months