[jboss-cvs] jbosside/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/config ...

Robert Stryker rawblem at gmail.com
Thu Jul 27 02:34:01 EDT 2006


  User: rawb    
  Date: 06/07/27 02:34:01

  Modified:    as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/config 
                        JBossLaunchConfigurationTabGroup.java
  Log:
  Implemented xpath editor in properties view. Other changes made to fascilitate this implementation (added to DescriptorModel, etc). Also fixed bugs, re-added classpath to server configuration so user can customize.
  
  Revision  Changes    Path
  1.5       +93 -8     jbosside/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/config/JBossLaunchConfigurationTabGroup.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JBossLaunchConfigurationTabGroup.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/config/JBossLaunchConfigurationTabGroup.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- JBossLaunchConfigurationTabGroup.java	10 Jul 2006 15:51:55 -0000	1.4
  +++ JBossLaunchConfigurationTabGroup.java	27 Jul 2006 06:34:01 -0000	1.5
  @@ -21,22 +21,53 @@
    */
   package org.jboss.ide.eclipse.as.ui.config;
   
  +import java.util.ArrayList;
  +import java.util.List;
  +
   import org.eclipse.core.runtime.CoreException;
   import org.eclipse.core.runtime.NullProgressMonitor;
   import org.eclipse.debug.core.ILaunchConfiguration;
   import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
   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.internal.debug.ui.actions.AddAdvancedAction;
  +import org.eclipse.jdt.internal.debug.ui.actions.AddExternalFolderAction;
  +import org.eclipse.jdt.internal.debug.ui.actions.AddExternalJarAction;
  +import org.eclipse.jdt.internal.debug.ui.actions.AddFolderAction;
  +import org.eclipse.jdt.internal.debug.ui.actions.AddJarAction;
  +import org.eclipse.jdt.internal.debug.ui.actions.AddLibraryAction;
  +import org.eclipse.jdt.internal.debug.ui.actions.AddProjectAction;
  +import org.eclipse.jdt.internal.debug.ui.actions.AddVariableAction;
  +import org.eclipse.jdt.internal.debug.ui.actions.AttachSourceAction;
  +import org.eclipse.jdt.internal.debug.ui.actions.EditClasspathEntryAction;
  +import org.eclipse.jdt.internal.debug.ui.actions.MoveDownAction;
  +import org.eclipse.jdt.internal.debug.ui.actions.MoveUpAction;
  +import org.eclipse.jdt.internal.debug.ui.actions.RemoveAction;
  +import org.eclipse.jdt.internal.debug.ui.actions.RestoreDefaultEntriesAction;
  +import org.eclipse.jdt.internal.debug.ui.actions.RuntimeClasspathAction;
  +import org.eclipse.jdt.internal.debug.ui.launcher.IClasspathViewer;
   import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
  +import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
  +import org.eclipse.jdt.launching.JavaRuntime;
  +import org.eclipse.jface.action.IAction;
  +import org.eclipse.jface.viewers.IStructuredSelection;
  +import org.eclipse.swt.SWT;
  +import org.eclipse.swt.widgets.Composite;
   import org.eclipse.wst.server.core.IServer;
   import org.eclipse.wst.server.core.ServerUtil;
   import org.jboss.ide.eclipse.as.core.server.JBossServer;
   import org.jboss.ide.eclipse.as.core.server.JBossServerBehavior;
   import org.jboss.ide.eclipse.as.core.server.ServerAttributeHelper;
  +import org.jboss.ide.eclipse.as.core.server.runtime.IJBossServerRuntimeDelegate;
   import org.jboss.ide.eclipse.as.core.server.runtime.JBossServerRuntime;
  +import org.jboss.ide.eclipse.as.core.util.ASDebug;
   import org.jboss.ide.eclipse.as.core.util.RuntimeConfigUtil;
   
   
  @@ -58,16 +89,16 @@
   		int i = 0;
   		tabs[i] = new JavaArgumentsTab2();
   		tabs[i++].setLaunchConfigurationDialog(dialog);
  -//		tabs[i] = new JavaClasspathTab();
  -//		tabs[i++].setLaunchConfigurationDialog(dialog);
  +		tabs[i] = new JavaClasspathTab2();
  +		tabs[i++].setLaunchConfigurationDialog(dialog);
   		tabs[i] = new SourceLookupTab();
   		tabs[i++].setLaunchConfigurationDialog(dialog);
  -//		tabs[i] = new EnvironmentTab();
  -//		tabs[i++].setLaunchConfigurationDialog(dialog);
  -//		tabs[i] = new JavaJRETab();
  -//		tabs[i++].setLaunchConfigurationDialog(dialog);	 
  -//		tabs[i] = new CommonTab();
  -//		tabs[i++].setLaunchConfigurationDialog(dialog);
  +		tabs[i] = new EnvironmentTab();
  +		tabs[i++].setLaunchConfigurationDialog(dialog);
  +		tabs[i] = new JavaJRETab();
  +		tabs[i++].setLaunchConfigurationDialog(dialog);	 
  +		tabs[i] = new CommonTab();
  +		tabs[i++].setLaunchConfigurationDialog(dialog);
   
   		
   		ILaunchConfigurationTab[] tabs2 = new ILaunchConfigurationTab[i];
  @@ -162,4 +193,58 @@
   	}
   
   
  +	public class JavaClasspathTab2 extends JavaClasspathTab {
  +		public void performApply(ILaunchConfigurationWorkingCopy configuration) {
  +			super.performApply(configuration);
  +			try {
  +				
  +				server = ServerUtil.getServer(configuration);
  +				jbServer = (JBossServer)server.getAdapter(JBossServer.class);
  +				if (jbServer == null) {
  +					jbServer = (JBossServer) server.loadAdapter(JBossServer.class, new NullProgressMonitor());
  +				}
  +				jbServerBehavior = (JBossServerBehavior) server.getAdapter(JBossServerBehavior.class);
  +				jbRuntime = jbServer.getJBossRuntime();
  +				
  +				
  +				if( configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, (List)null) == null ) {
  +					// back to default. Now set our default.
  +					List classpath = jbRuntime.getVersionDelegate().getRuntimeClasspath(jbServer, IJBossServerRuntimeDelegate.ACTION_START);
  +					configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
  +					configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classpath);
  +					configuration.setAttribute(JBossServerBehavior.LAUNCH_CONFIG_DEFAULT_CLASSPATH, true);
  +				} else {
  +					// its not default... so set our string as no
  +					configuration.setAttribute(JBossServerBehavior.LAUNCH_CONFIG_DEFAULT_CLASSPATH, false);
  +				}
  +			} catch( CoreException ce ) {
  +				ce.printStackTrace();
  +			}
  +		}
  +		
  +		public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
  +			ASDebug.p("Setting defaults", this);
  +			try {
  +				if( jbRuntime == null ) {
  +					server = ServerUtil.getServer(configuration);
  +					jbServer = (JBossServer)server.getAdapter(JBossServer.class);
  +					if (jbServer == null) {
  +						jbServer = (JBossServer) server.loadAdapter(JBossServer.class, new NullProgressMonitor());
  +					}
  +					jbServerBehavior = (JBossServerBehavior) server.getAdapter(JBossServerBehavior.class);
  +					jbRuntime = jbServer.getJBossRuntime();
  +				}
  +	
  +				List classpath = jbRuntime.getVersionDelegate().getRuntimeClasspath(jbServer, IJBossServerRuntimeDelegate.ACTION_START);
  +				configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
  +				configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classpath);
  +			} catch ( CoreException ce ) {
  +				ce.printStackTrace();
  +			}
  +		}
  +		
  +
  +	}
  +
  +
   }
  
  
  



More information about the jboss-cvs-commits mailing list