01: package org.enhydra.kelp.eclipse.ui.launcher;
02:
03: import org.eclipse.core.runtime.CoreException;
04: import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
05: import org.eclipse.jdt.debug.ui.launchConfigurations.JavaMainTab;
06: import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
07: import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
08: import org.eclipse.swt.events.ModifyEvent;
09: import org.eclipse.swt.events.ModifyListener;
10: import org.eclipse.swt.widgets.Composite;
11:
12: /**
13: * @author Administrator
14: *
15: * To change this generated comment edit the template variable "typecomment":
16: * Window>Preferences>Java>Templates.
17: * To enable and disable the creation of type comments go to
18: * Window>Preferences>Java>Code Generation.
19: */
20: public class EnhydraMainTab extends JavaMainTab {
21:
22: private static final String ENHYDRA_MAIN_CLASS = "org.apache.catalina.startup.Bootstrap";
23:
24: private EnhydraArgumentsTab eArgumentsTab = null;
25:
26: /**
27: * Constructor for EnhydraMainTab.
28: */
29: public EnhydraMainTab() {
30: super ();
31: }
32:
33: /**
34: * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy)
35: */
36: public void setDefaults(
37: ILaunchConfigurationWorkingCopy configuration) {
38: super .setDefaults(configuration);
39:
40: String mainName = "";
41:
42: try {
43: // Main class name defaults to ENHYDRA_MAIN_CLASS
44: mainName = configuration
45: .getAttribute(
46: IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
47: EMPTY_STRING);
48:
49: if (mainName.compareTo(ENHYDRA_MAIN_CLASS) != 0)
50: configuration
51: .setAttribute(
52: IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
53: ENHYDRA_MAIN_CLASS);
54:
55: configuration
56: .setAttribute(
57: IJavaLaunchConfigurationConstants.ATTR_STOP_IN_MAIN,
58: (String) null);
59: } catch (CoreException e) {
60: JDIDebugUIPlugin.log(e);
61: }
62: }
63:
64: /**
65: * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(Composite)
66: */
67: public void createControl(Composite parent) {
68: super .createControl(parent);
69: fProjText.addModifyListener(new ModifyListener() {
70: public void modifyText(ModifyEvent e) {
71: UpdateEnhydraArgumentsTab();
72: }
73: });
74: }
75:
76: /**
77: * Method UpdateEnhydraArgumentsTab.
78: */
79: private void UpdateEnhydraArgumentsTab() {
80: // Ovde bi trebalo da se ubaci promena direktorijuma
81: // u kome se startuje aplikacija, kada se promeni
82: // naziv projekta. Moguce ja da ovo i nije bitno.
83: }
84:
85: /**
86: * Sets the eArgumentsTab.
87: * @param eArgumentsTab The eArgumentsTab to set
88: */
89: public void setEArgumentsTab(EnhydraArgumentsTab eArgumentsTab) {
90: this.eArgumentsTab = eArgumentsTab;
91: }
92:
93: }
|