KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > kelp > eclipse > ui > launcher > EnhydraMainTab


1 package org.enhydra.kelp.eclipse.ui.launcher;
2
3 import org.eclipse.core.runtime.CoreException;
4 import org.eclipse.debug.core.ILaunchConfiguration;
5 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
6 import org.eclipse.jdt.core.IJavaElement;
7 import org.eclipse.jdt.debug.ui.launchConfigurations.JavaMainTab;
8 import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
9 import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
10 import org.eclipse.swt.events.ModifyEvent;
11 import org.eclipse.swt.events.ModifyListener;
12 import org.eclipse.swt.widgets.Composite;
13
14 /**
15  * @author Administrator
16  *
17  * To change this generated comment edit the template variable "typecomment":
18  * Window>Preferences>Java>Templates.
19  * To enable and disable the creation of type comments go to
20  * Window>Preferences>Java>Code Generation.
21  */

22 public class EnhydraMainTab extends JavaMainTab {
23
24     private static final String JavaDoc ENHYDRA_MAIN_CLASS = "com.lutris.multiServer.MultiServer";
25
26     private EnhydraArgumentsTab eArgumentsTab = null;
27
28     /**
29      * Constructor for EnhydraMainTab.
30      */

31     public EnhydraMainTab() {
32         super();
33     }
34
35
36
37     /**
38      * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy)
39      */

40     public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
41         super.setDefaults(configuration);
42
43         String JavaDoc mainName = "";
44
45         try {
46             // Main class name defaults to ENHYDRA_MAIN_CLASS
47
mainName = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, EMPTY_STRING);
48             if (mainName.compareTo(ENHYDRA_MAIN_CLASS) != 0)
49                 configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, ENHYDRA_MAIN_CLASS);
50         } catch (CoreException e) {
51             JDIDebugUIPlugin.log(e);
52         }
53     }
54
55     /**
56      * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(Composite)
57      */

58     public void createControl(Composite parent) {
59         super.createControl(parent);
60         fProjText.addModifyListener(new ModifyListener() {
61             public void modifyText(ModifyEvent e) {
62                 UpdateEnhydraArgumentsTab();
63             }
64         });
65     }
66
67     /**
68      * Method UpdateEnhydraArgumentsTab.
69      */

70     private void UpdateEnhydraArgumentsTab() {
71         // Ovde bi trebalo da se ubaci promena direktorijuma
72
// u kome se startuje aplikacija, kada se promeni
73
// naziv projekta. Moguce ja da ovo i nije bitno.
74
}
75
76     /**
77      * Sets the eArgumentsTab.
78      * @param eArgumentsTab The eArgumentsTab to set
79      */

80     public void setEArgumentsTab(EnhydraArgumentsTab eArgumentsTab) {
81         this.eArgumentsTab = eArgumentsTab;
82     }
83
84 }
85
Popular Tags