Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

align to code conventions and minor java5 updates, also added more lo…

…gging of exceptions
  • Loading branch information...
commit a2c6f0ebb0cd89d08257ad0fcd6a77b7e068706c 1 parent 25630f9
@jmcc0nn3ll jmcc0nn3ll authored
Showing with 332 additions and 325 deletions.
  1. +6 −6 org.eclipse.jst.server.jetty.core/src/org/eclipse/jst/server/jetty/core/IJettyConfiguration.java
  2. +4 −4 ...clipse.jst.server.jetty.core/src/org/eclipse/jst/server/jetty/core/internal/jetty7/Jetty7Configuration.java
  3. +13 −13 org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/ContextIds.java
  4. +2 −3 ...ipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/JettyLaunchConfigurationTabGroup.java
  5. +97 −97 org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/JettyRuntimeComposite.java
  6. +7 −5 org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/JettyRuntimeWizardFragment.java
  7. +22 −22 org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/JettyUIPlugin.java
  8. +1 −1  org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/Messages.java
  9. +8 −4 org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/SWTUtil.java
  10. +1 −1  org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/Trace.java
  11. +38 −37 ...jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/editor/ConfigurationPortEditorSection.java
  12. +89 −88 ...t.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/editor/ConfigurationWebModuleEditorPart.java
  13. +44 −44 org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/editor/WebModuleDialog.java
View
12 org.eclipse.jst.server.jetty.core/src/org/eclipse/jst/server/jetty/core/IJettyConfiguration.java
@@ -26,13 +26,13 @@
public interface IJettyConfiguration
{
- public static final String NAME_PROPERTY = "name";
- public static final String PORT_PROPERTY = "port";
- public static final String MODIFY_PORT_PROPERTY = "modifyPort";
+ public static final String __NAME_PROPERTY = "name";
+ public static final String __PORT_PROPERTY = "port";
+ public static final String __MODIFY_PORT_PROPERTY = "modifyPort";
- public static final String MODIFY_WEB_MODULE_PROPERTY = "modifyWebModule";
- public static final String ADD_WEB_MODULE_PROPERTY = "addWebModule";
- public static final String REMOVE_WEB_MODULE_PROPERTY = "removeWebModule";
+ public static final String __MODIFY_WEB_MODULE_PROPERTY = "modifyWebModule";
+ public static final String __ADD_WEB_MODULE_PROPERTY = "addWebModule";
+ public static final String __REMOVE_WEB_MODULE_PROPERTY = "removeWebModule";
/**
* Returns a list of ServerPorts that this configuration uses.
View
8 ...pse.jst.server.jetty.core/src/org/eclipse/jst/server/jetty/core/internal/jetty7/Jetty7Configuration.java
@@ -228,7 +228,7 @@ public void addWebModule(int i, IJettyWebModule module)
// module.getMemento().length() > 0)
// context.setSource(module.getMemento());
_isServerDirty = true;
- firePropertyChangeEvent(ADD_WEB_MODULE_PROPERTY,null,module);
+ firePropertyChangeEvent(__ADD_WEB_MODULE_PROPERTY,null,module);
}
}
catch (Exception e)
@@ -250,7 +250,7 @@ public void removeWebModule(int index)
{
_serverInstance.removeContext(index);
_isServerDirty = true;
- firePropertyChangeEvent(REMOVE_WEB_MODULE_PROPERTY,null,index);
+ firePropertyChangeEvent(__REMOVE_WEB_MODULE_PROPERTY,null,index);
}
catch (Exception e)
{
@@ -613,7 +613,7 @@ public void modifyServerPort(String id, int port)
{
_serverInstance.setPort(port + "");
_isServerDirty = true;
- firePropertyChangeEvent(MODIFY_PORT_PROPERTY,id, Integer.valueOf(port));
+ firePropertyChangeEvent(__MODIFY_PORT_PROPERTY,id, Integer.valueOf(port));
return;
}
@@ -671,7 +671,7 @@ public void modifyWebModule(int index, String docBase, String path, boolean relo
context.save();
_isServerDirty = true;
WebModule module = new WebModule(path,docBase,null,reloadable);
- firePropertyChangeEvent(MODIFY_WEB_MODULE_PROPERTY, Integer.valueOf(index),module);
+ firePropertyChangeEvent(__MODIFY_WEB_MODULE_PROPERTY, Integer.valueOf(index),module);
}
}
catch (Exception e)
View
26 org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/ContextIds.java
@@ -13,20 +13,20 @@
public interface ContextIds
{
- public static final String RUNTIME_COMPOSITE = JettyUIPlugin.PLUGIN_ID + ".twnr0000";
+ public static final String RUNTIME_COMPOSITE = JettyUIPlugin.__PLUGIN_ID + ".twnr0000";
- public static final String CONFIGURATION_EDITOR_PORTS = JettyUIPlugin.PLUGIN_ID + ".tecp0000";
- public static final String CONFIGURATION_EDITOR_PORTS_LIST = JettyUIPlugin.PLUGIN_ID + ".tecp0002";
+ public static final String CONFIGURATION_EDITOR_PORTS = JettyUIPlugin.__PLUGIN_ID + ".tecp0000";
+ public static final String CONFIGURATION_EDITOR_PORTS_LIST = JettyUIPlugin.__PLUGIN_ID + ".tecp0002";
- public static final String CONFIGURATION_EDITOR_WEBMODULES = JettyUIPlugin.PLUGIN_ID + ".tecw0000";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_LIST = JettyUIPlugin.PLUGIN_ID + ".tecw0002";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_ADD_PROJECT = JettyUIPlugin.PLUGIN_ID + ".tecw0004";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_ADD_EXTERNAL = JettyUIPlugin.PLUGIN_ID + ".tecw0006";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_EDIT = JettyUIPlugin.PLUGIN_ID + ".tecw0008";
- public static final String CONFIGURATION_EDITOR_WEBMODULES_REMOVE = JettyUIPlugin.PLUGIN_ID + ".tecw0010";
+ public static final String CONFIGURATION_EDITOR_WEBMODULES = JettyUIPlugin.__PLUGIN_ID + ".tecw0000";
+ public static final String CONFIGURATION_EDITOR_WEBMODULES_LIST = JettyUIPlugin.__PLUGIN_ID + ".tecw0002";
+ public static final String CONFIGURATION_EDITOR_WEBMODULES_ADD_PROJECT = JettyUIPlugin.__PLUGIN_ID + ".tecw0004";
+ public static final String CONFIGURATION_EDITOR_WEBMODULES_ADD_EXTERNAL = JettyUIPlugin.__PLUGIN_ID + ".tecw0006";
+ public static final String CONFIGURATION_EDITOR_WEBMODULES_EDIT = JettyUIPlugin.__PLUGIN_ID + ".tecw0008";
+ public static final String CONFIGURATION_EDITOR_WEBMODULES_REMOVE = JettyUIPlugin.__PLUGIN_ID + ".tecw0010";
- public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG = JettyUIPlugin.PLUGIN_ID + ".tdwm0000";
- public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PROJECT = JettyUIPlugin.PLUGIN_ID + ".tdpr0002";
- public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PATH = JettyUIPlugin.PLUGIN_ID + ".tdpr0004";
- public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG_DOCBASE = JettyUIPlugin.PLUGIN_ID + ".tdpr0006";
+ public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG = JettyUIPlugin.__PLUGIN_ID + ".tdwm0000";
+ public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PROJECT = JettyUIPlugin.__PLUGIN_ID + ".tdpr0002";
+ public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PATH = JettyUIPlugin.__PLUGIN_ID + ".tdpr0004";
+ public static final String CONFIGURATION_EDITOR_WEBMODULE_DIALOG_DOCBASE = JettyUIPlugin.__PLUGIN_ID + ".tdpr0006";
}
View
5 ...e.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/JettyLaunchConfigurationTabGroup.java
@@ -27,8 +27,7 @@
public class JettyLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup
{
- private static final String[] SERVER_TYPE_IDS = new String[]
- { "org.eclipse.jst.server.jetty" };
+ private static final String[] __SERVER_TYPE_IDS = new String[]{ "org.eclipse.jst.server.jetty" };
/*
* @see ILaunchConfigurationTabGroup#createTabs(ILaunchConfigurationDialog, String)
@@ -36,7 +35,7 @@
public void createTabs(ILaunchConfigurationDialog dialog, String mode)
{
ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[6];
- tabs[0] = new ServerLaunchConfigurationTab(SERVER_TYPE_IDS);
+ tabs[0] = new ServerLaunchConfigurationTab(__SERVER_TYPE_IDS);
tabs[0].setLaunchConfigurationDialog(dialog);
tabs[1] = new JavaArgumentsTab();
tabs[1].setLaunchConfigurationDialog(dialog);
View
194 org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/JettyRuntimeComposite.java
@@ -66,21 +66,21 @@
*/
public class JettyRuntimeComposite extends Composite
{
- protected IRuntimeWorkingCopy runtimeWC;
- protected IJettyRuntimeWorkingCopy runtime;
-
- protected IWizardHandle wizard;
-
- protected Text installDir;
- protected Text name;
- protected Combo combo;
- protected List<IVMInstall> installedJREs;
- protected String[] jreNames;
- protected IInstallableRuntime ir;
- protected Job installRuntimeJob;
- protected IJobChangeListener jobListener;
- protected Label installLabel;
- protected Button install;
+ protected IRuntimeWorkingCopy _runtimeWC;
+ protected IJettyRuntimeWorkingCopy _jettyRuntimeWC;
+
+ protected IWizardHandle _wizard;
+
+ protected Text _installDir;
+ protected Text _name;
+ protected Combo _combo;
+ protected List<IVMInstall> _installedJREs;
+ protected String[] _jreNames;
+ protected IInstallableRuntime _ir;
+ protected Job _installRuntimeJob;
+ protected IJobChangeListener _jobListener;
+ protected Label _installLabel;
+ protected Button _installButton;
/**
* JettyRuntimeWizardPage constructor comment.
@@ -93,11 +93,11 @@
protected JettyRuntimeComposite(Composite parent, IWizardHandle wizard)
{
super(parent,SWT.NONE);
- this.wizard = wizard;
+ this._wizard = wizard;
wizard.setTitle(Messages.wizardTitle);
wizard.setDescription(Messages.wizardDescription);
- wizard.setImageDescriptor(JettyUIPlugin.getImageDescriptor(JettyUIPlugin.IMG_WIZ_JETTY));
+ wizard.setImageDescriptor(JettyUIPlugin.getImageDescriptor(JettyUIPlugin.__IMG_WIZ_JETTY));
createControl();
}
@@ -106,28 +106,28 @@ protected void setRuntime(IRuntimeWorkingCopy newRuntime)
{
if (newRuntime == null)
{
- runtimeWC = null;
- runtime = null;
+ _runtimeWC = null;
+ _jettyRuntimeWC = null;
}
else
{
- runtimeWC = newRuntime;
- runtime = (IJettyRuntimeWorkingCopy)newRuntime.loadAdapter(IJettyRuntimeWorkingCopy.class,null);
+ _runtimeWC = newRuntime;
+ _jettyRuntimeWC = (IJettyRuntimeWorkingCopy)newRuntime.loadAdapter(IJettyRuntimeWorkingCopy.class,null);
}
- if (runtimeWC == null)
+ if (_runtimeWC == null)
{
- ir = null;
- install.setEnabled(false);
- installLabel.setText("");
+ _ir = null;
+ _installButton.setEnabled(false);
+ _installLabel.setText("");
}
else
{
- ir = ServerPlugin.findInstallableRuntime(runtimeWC.getRuntimeType().getId());
- if (ir != null)
+ _ir = ServerPlugin.findInstallableRuntime(_runtimeWC.getRuntimeType().getId());
+ if (_ir != null)
{
- install.setEnabled(true);
- installLabel.setText(ir.getName());
+ _installButton.setEnabled(true);
+ _installLabel.setText(_ir.getName());
}
}
@@ -138,9 +138,9 @@ protected void setRuntime(IRuntimeWorkingCopy newRuntime)
public void dispose()
{
super.dispose();
- if (installRuntimeJob != null)
+ if (_installRuntimeJob != null)
{
- installRuntimeJob.removeJobChangeListener(jobListener);
+ _installRuntimeJob.removeJobChangeListener(_jobListener);
}
}
@@ -161,14 +161,14 @@ protected void createControl()
data.horizontalSpan = 2;
label.setLayoutData(data);
- name = new Text(this,SWT.BORDER);
+ _name = new Text(this,SWT.BORDER);
data = new GridData(GridData.FILL_HORIZONTAL);
- name.setLayoutData(data);
- name.addModifyListener(new ModifyListener()
+ _name.setLayoutData(data);
+ _name.addModifyListener(new ModifyListener()
{
public void modifyText(ModifyEvent e)
{
- runtimeWC.setName(name.getText());
+ _runtimeWC.setName(_name.getText());
validate();
}
});
@@ -179,14 +179,14 @@ public void modifyText(ModifyEvent e)
data.horizontalSpan = 2;
label.setLayoutData(data);
- installDir = new Text(this,SWT.BORDER);
+ _installDir = new Text(this,SWT.BORDER);
data = new GridData(GridData.FILL_HORIZONTAL);
- installDir.setLayoutData(data);
- installDir.addModifyListener(new ModifyListener()
+ _installDir.setLayoutData(data);
+ _installDir.addModifyListener(new ModifyListener()
{
public void modifyText(ModifyEvent e)
{
- runtimeWC.setLocation(new Path(installDir.getText()));
+ _runtimeWC.setLocation(new Path(_installDir.getText()));
validate();
}
});
@@ -198,28 +198,28 @@ public void widgetSelected(SelectionEvent se)
{
DirectoryDialog dialog = new DirectoryDialog(JettyRuntimeComposite.this.getShell());
dialog.setMessage(Messages.selectInstallDir);
- dialog.setFilterPath(installDir.getText());
+ dialog.setFilterPath(_installDir.getText());
String selectedDirectory = dialog.open();
if (selectedDirectory != null)
- installDir.setText(selectedDirectory);
+ _installDir.setText(selectedDirectory);
}
});
- installLabel = new Label(this,SWT.RIGHT);
+ _installLabel = new Label(this,SWT.RIGHT);
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalIndent = 10;
- installLabel.setLayoutData(data);
+ _installLabel.setLayoutData(data);
- install = SWTUtil.createButton(this,Messages.install);
- install.setEnabled(false);
- install.addSelectionListener(new SelectionAdapter()
+ _installButton = SWTUtil.createButton(this,Messages.install);
+ _installButton.setEnabled(false);
+ _installButton.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected(SelectionEvent se)
{
String license = null;
try
{
- license = ir.getLicense(new NullProgressMonitor());
+ license = _ir.getLicense(new NullProgressMonitor());
}
catch (CoreException e)
{
@@ -241,13 +241,13 @@ protected void createChildFragments(List list)
DirectoryDialog dialog = new DirectoryDialog(JettyRuntimeComposite.this.getShell());
dialog.setMessage(Messages.selectInstallDir);
- dialog.setFilterPath(installDir.getText());
+ dialog.setFilterPath(_installDir.getText());
String selectedDirectory = dialog.open();
if (selectedDirectory != null)
{
// ir.install(new Path(selectedDirectory));
final IPath installPath = new Path(selectedDirectory);
- installRuntimeJob = new Job("Installing server runtime environment")
+ _installRuntimeJob = new Job("Installing server runtime environment")
{
public boolean belongsTo(Object family)
{
@@ -258,7 +258,7 @@ protected IStatus run(IProgressMonitor monitor)
{
try
{
- ir.install(installPath,monitor);
+ _ir.install(installPath,monitor);
}
catch (CoreException ce)
{
@@ -269,13 +269,13 @@ protected IStatus run(IProgressMonitor monitor)
}
};
- installDir.setText(selectedDirectory);
- jobListener = new JobChangeAdapter()
+ _installDir.setText(selectedDirectory);
+ _jobListener = new JobChangeAdapter()
{
public void done(IJobChangeEvent event)
{
- installRuntimeJob.removeJobChangeListener(this);
- installRuntimeJob = null;
+ _installRuntimeJob.removeJobChangeListener(this);
+ _installRuntimeJob = null;
Display.getDefault().asyncExec(new Runnable()
{
public void run()
@@ -288,8 +288,8 @@ public void run()
});
}
};
- installRuntimeJob.addJobChangeListener(jobListener);
- installRuntimeJob.schedule();
+ _installRuntimeJob.addJobChangeListener(_jobListener);
+ _installRuntimeJob.schedule();
}
}
});
@@ -303,21 +303,21 @@ public void run()
data.horizontalSpan = 2;
label.setLayoutData(data);
- combo = new Combo(this,SWT.DROP_DOWN | SWT.READ_ONLY);
- combo.setItems(jreNames);
+ _combo = new Combo(this,SWT.DROP_DOWN | SWT.READ_ONLY);
+ _combo.setItems(_jreNames);
data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- combo.setLayoutData(data);
+ _combo.setLayoutData(data);
- combo.addSelectionListener(new SelectionListener()
+ _combo.addSelectionListener(new SelectionListener()
{
public void widgetSelected(SelectionEvent e)
{
- int sel = combo.getSelectionIndex();
+ int sel = _combo.getSelectionIndex();
IVMInstall vmInstall = null;
if (sel > 0)
- vmInstall = (IVMInstall)installedJREs.get(sel - 1);
+ vmInstall = (IVMInstall)_installedJREs.get(sel - 1);
- runtime.setVMInstall(vmInstall);
+ _jettyRuntimeWC.setVMInstall(vmInstall);
validate();
}
@@ -332,14 +332,14 @@ public void widgetDefaultSelected(SelectionEvent e)
{
public void widgetSelected(SelectionEvent e)
{
- String currentVM = combo.getText();
+ String currentVM = _combo.getText();
if (showPreferencePage())
{
updateJREs();
- combo.setItems(jreNames);
- combo.setText(currentVM);
- if (combo.getSelectionIndex() == -1)
- combo.select(0);
+ _combo.setItems(_jreNames);
+ _combo.setText(currentVM);
+ if (_combo.getSelectionIndex() == -1)
+ _combo.select(0);
validate();
}
}
@@ -350,13 +350,13 @@ public void widgetSelected(SelectionEvent e)
Dialog.applyDialogFont(this);
- name.forceFocus();
+ _name.forceFocus();
}
protected void updateJREs()
{
// get all installed JVMs
- installedJREs = new ArrayList<IVMInstall>();
+ _installedJREs = new ArrayList<IVMInstall>();
IVMInstallType[] vmInstallTypes = JavaRuntime.getVMInstallTypes();
int size = vmInstallTypes.length;
for (int i = 0; i < size; i++)
@@ -365,18 +365,18 @@ protected void updateJREs()
int size2 = vmInstalls.length;
for (int j = 0; j < size2; j++)
{
- installedJREs.add(vmInstalls[j]);
+ _installedJREs.add(vmInstalls[j]);
}
}
// get names
- size = installedJREs.size();
- jreNames = new String[size + 1];
- jreNames[0] = Messages.runtimeDefaultJRE;
+ size = _installedJREs.size();
+ _jreNames = new String[size + 1];
+ _jreNames[0] = Messages.runtimeDefaultJRE;
for (int i = 0; i < size; i++)
{
- IVMInstall vmInstall = (IVMInstall)installedJREs.get(i);
- jreNames[i + 1] = vmInstall.getName();
+ IVMInstall vmInstall = (IVMInstall)_installedJREs.get(i);
+ _jreNames[i + 1] = vmInstall.getName();
}
}
@@ -403,55 +403,55 @@ protected boolean showPreferencePage()
protected void init()
{
- if (name == null || runtime == null)
+ if (_name == null || _jettyRuntimeWC == null)
return;
- if (runtimeWC.getName() != null)
- name.setText(runtimeWC.getName());
+ if (_runtimeWC.getName() != null)
+ _name.setText(_runtimeWC.getName());
else
- name.setText("");
+ _name.setText("");
- if (runtimeWC.getLocation() != null)
- installDir.setText(runtimeWC.getLocation().toOSString());
+ if (_runtimeWC.getLocation() != null)
+ _installDir.setText(_runtimeWC.getLocation().toOSString());
else
- installDir.setText("");
+ _installDir.setText("");
// set selection
- if (runtime.isUsingDefaultJRE())
- combo.select(0);
+ if (_jettyRuntimeWC.isUsingDefaultJRE())
+ _combo.select(0);
else
{
boolean found = false;
- int size = installedJREs.size();
+ int size = _installedJREs.size();
for (int i = 0; i < size; i++)
{
- IVMInstall vmInstall = (IVMInstall)installedJREs.get(i);
- if (vmInstall.equals(runtime.getVMInstall()))
+ IVMInstall vmInstall = (IVMInstall)_installedJREs.get(i);
+ if (vmInstall.equals(_jettyRuntimeWC.getVMInstall()))
{
- combo.select(i + 1);
+ _combo.select(i + 1);
found = true;
}
}
if (!found)
- combo.select(0);
+ _combo.select(0);
}
}
protected void validate()
{
- if (runtime == null)
+ if (_jettyRuntimeWC == null)
{
- wizard.setMessage("",IMessageProvider.ERROR);
+ _wizard.setMessage("",IMessageProvider.ERROR);
return;
}
- IStatus status = runtimeWC.validate(null);
+ IStatus status = _runtimeWC.validate(null);
if (status == null || status.isOK())
- wizard.setMessage(null,IMessageProvider.NONE);
+ _wizard.setMessage(null,IMessageProvider.NONE);
else if (status.getSeverity() == IStatus.WARNING)
- wizard.setMessage(status.getMessage(),IMessageProvider.WARNING);
+ _wizard.setMessage(status.getMessage(),IMessageProvider.WARNING);
else
- wizard.setMessage(status.getMessage(),IMessageProvider.ERROR);
- wizard.update();
+ _wizard.setMessage(status.getMessage(),IMessageProvider.ERROR);
+ _wizard.update();
}
}
View
12 ...eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/JettyRuntimeWizardFragment.java
@@ -25,7 +25,7 @@
*/
public class JettyRuntimeWizardFragment extends WizardFragment
{
- protected JettyRuntimeComposite comp;
+ protected JettyRuntimeComposite _runtimeComposite;
public JettyRuntimeWizardFragment()
{
@@ -54,16 +54,16 @@ public boolean isComplete()
*/
public Composite createComposite(Composite parent, IWizardHandle wizard)
{
- comp = new JettyRuntimeComposite(parent,wizard);
- return comp;
+ _runtimeComposite = new JettyRuntimeComposite(parent,wizard);
+ return _runtimeComposite;
}
public void enter()
{
- if (comp != null)
+ if (_runtimeComposite != null)
{
IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy)getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- comp.setRuntime(runtime);
+ _runtimeComposite.setRuntime(runtime);
}
}
@@ -72,6 +72,8 @@ public void exit()
IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy)getTaskModel().getObject(TaskModel.TASK_RUNTIME);
IPath path = runtime.getLocation();
if (runtime.validate(null).getSeverity() != IStatus.ERROR)
+ {
JettyPlugin.setPreference("location" + runtime.getRuntimeType().getId(),path.toString());
+ }
}
}
View
44 org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/JettyUIPlugin.java
@@ -27,22 +27,22 @@
{
// The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jst.server.jetty.ui"; //$NON-NLS-1$
+ public static final String __PLUGIN_ID = "org.eclipse.jst.server.jetty.ui"; //$NON-NLS-1$
// base url for icons
- private static URL ICON_BASE_URL;
- private static final String URL_OBJ = "obj16/";
- private static final String URL_WIZBAN = "wizban/";
- public static final String IMG_WIZ_JETTY = "wizJetty";
+ private static URL __ICON_BASE_URL;
+ private static final String __URL_OBJ = "obj16/";
+ private static final String __URL_WIZBAN = "wizban/";
+ public static final String __IMG_WIZ_JETTY = "wizJetty";
- public static final String IMG_WEB_MODULE = "webModule";
- public static final String IMG_PORT = "port";
- public static final String IMG_PROJECT_MISSING = "projectMissing";
+ public static final String __IMG_WEB_MODULE = "webModule";
+ public static final String __IMG_PORT = "port";
+ public static final String __IMG_PROJECT_MISSING = "projectMissing";
// The shared instance
- private static JettyUIPlugin plugin;
+ private static JettyUIPlugin _plugin;
- protected Map<String, ImageDescriptor> imageDescriptors = new HashMap<String, ImageDescriptor>();
+ protected Map<String, ImageDescriptor> _imageDescriptors = new HashMap<String, ImageDescriptor>();
/**
* The constructor
@@ -59,7 +59,7 @@ public JettyUIPlugin()
public void start(BundleContext context) throws Exception
{
super.start(context);
- plugin = this;
+ _plugin = this;
}
/*
@@ -69,7 +69,7 @@ public void start(BundleContext context) throws Exception
*/
public void stop(BundleContext context) throws Exception
{
- plugin = null;
+ _plugin = null;
super.stop(context);
}
@@ -80,7 +80,7 @@ public void stop(BundleContext context) throws Exception
*/
public static JettyUIPlugin getDefault()
{
- return plugin;
+ return _plugin;
}
@Override
@@ -88,15 +88,15 @@ protected ImageRegistry createImageRegistry()
{
ImageRegistry registry = new ImageRegistry();
- registerImage(registry,IMG_WIZ_JETTY,URL_WIZBAN + "jetty_wiz.png");
+ registerImage(registry,__IMG_WIZ_JETTY,__URL_WIZBAN + "jetty_wiz.png");
- registerImage(registry,IMG_WEB_MODULE,URL_OBJ + "web_module.gif");
- registerImage(registry,IMG_PORT,URL_OBJ + "port.gif");
+ registerImage(registry,__IMG_WEB_MODULE,__URL_OBJ + "web_module.gif");
+ registerImage(registry,__IMG_PORT,__URL_OBJ + "port.gif");
// registerImage(registry, IMG_WEB_MODULE, URL_OBJ + "web_module.gif");
// registerImage(registry, IMG_MIME_MAPPING, URL_OBJ + "mime_mapping.gif");
// registerImage(registry, IMG_MIME_EXTENSION, URL_OBJ + "mime_extension.gif");
// registerImage(registry, IMG_PORT, URL_OBJ + "port.gif");
- registerImage(registry,IMG_PROJECT_MISSING,URL_OBJ + "project_missing.gif");
+ registerImage(registry,__IMG_PROJECT_MISSING,__URL_OBJ + "project_missing.gif");
return registry;
}
@@ -125,7 +125,7 @@ public static ImageDescriptor getImageDescriptor(String key)
try
{
getDefault().getImageRegistry();
- return (ImageDescriptor)getDefault().imageDescriptors.get(key);
+ return (ImageDescriptor)getDefault()._imageDescriptors.get(key);
}
catch (Exception e)
{
@@ -143,17 +143,17 @@ public static ImageDescriptor getImageDescriptor(String key)
*/
private void registerImage(ImageRegistry registry, String key, String partialURL)
{
- if (ICON_BASE_URL == null)
+ if (__ICON_BASE_URL == null)
{
String pathSuffix = "icons/";
- ICON_BASE_URL = getDefault().getBundle().getEntry(pathSuffix);
+ __ICON_BASE_URL = getDefault().getBundle().getEntry(pathSuffix);
}
try
{
- ImageDescriptor id = ImageDescriptor.createFromURL(new URL(ICON_BASE_URL,partialURL));
+ ImageDescriptor id = ImageDescriptor.createFromURL(new URL(__ICON_BASE_URL,partialURL));
registry.put(key,id);
- imageDescriptors.put(key,id);
+ _imageDescriptors.put(key,id);
}
catch (Exception e)
{
View
2  org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/Messages.java
@@ -53,6 +53,6 @@
static
{
- NLS.initializeMessages(JettyUIPlugin.PLUGIN_ID + ".internal.Messages",Messages.class);
+ NLS.initializeMessages(JettyUIPlugin.__PLUGIN_ID + ".internal.Messages",Messages.class);
}
}
View
12 org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/SWTUtil.java
@@ -27,14 +27,14 @@
*/
public class SWTUtil
{
- private static FontMetrics fontMetrics;
+ private static FontMetrics _fontMetrics;
protected static void initializeDialogUnits(Control testControl)
{
// Compute and store a font metric
GC gc = new GC(testControl);
gc.setFont(JFaceResources.getDialogFont());
- fontMetrics = gc.getFontMetrics();
+ _fontMetrics = gc.getFontMetrics();
gc.dispose();
}
@@ -43,7 +43,7 @@ protected static void initializeDialogUnits(Control testControl)
*/
protected static int getButtonWidthHint(Button button)
{
- int widthHint = Dialog.convertHorizontalDLUsToPixels(fontMetrics,IDialogConstants.BUTTON_WIDTH);
+ int widthHint = Dialog.convertHorizontalDLUsToPixels(_fontMetrics,IDialogConstants.BUTTON_WIDTH);
return Math.max(widthHint,button.computeSize(SWT.DEFAULT,SWT.DEFAULT,true).x);
}
@@ -60,8 +60,12 @@ public static Button createButton(Composite comp, String label)
{
Button b = new Button(comp,SWT.PUSH);
b.setText(label);
- if (fontMetrics == null)
+
+ if (_fontMetrics == null)
+ {
initializeDialogUnits(comp);
+ }
+
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
data.widthHint = getButtonWidthHint(b);
b.setLayoutData(data);
View
2  org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/Trace.java
@@ -58,7 +58,7 @@ public static void trace(byte level, String s, Throwable t)
if (!JettyUIPlugin.getDefault().isDebugging())
return;
- System.out.println(JettyUIPlugin.PLUGIN_ID + " " + s);
+ System.out.println(JettyUIPlugin.__PLUGIN_ID + " " + s);
if (t != null)
t.printStackTrace();
}
View
75 ....server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/editor/ConfigurationPortEditorSection.java
@@ -53,14 +53,14 @@
*/
public class ConfigurationPortEditorSection extends ServerEditorSection
{
- protected IJettyConfigurationWorkingCopy jettyConfiguration;
+ protected IJettyConfigurationWorkingCopy _jettyConfiguration;
- protected boolean updating;
+ protected boolean _updating;
- protected Table ports;
- protected TableViewer viewer;
+ protected Table _ports;
+ protected TableViewer _viewer;
- protected PropertyChangeListener listener;
+ protected PropertyChangeListener _listener;
/**
* ConfigurationPortEditorSection constructor comment.
@@ -75,11 +75,11 @@ public ConfigurationPortEditorSection()
*/
protected void addChangeListener()
{
- listener = new PropertyChangeListener()
+ _listener = new PropertyChangeListener()
{
public void propertyChange(PropertyChangeEvent event)
{
- if (IJettyConfiguration.MODIFY_PORT_PROPERTY.equals(event.getPropertyName()))
+ if (IJettyConfiguration.__MODIFY_PORT_PROPERTY.equals(event.getPropertyName()))
{
String id = (String)event.getOldValue();
Integer i = (Integer)event.getNewValue();
@@ -87,7 +87,7 @@ public void propertyChange(PropertyChangeEvent event)
}
}
};
- jettyConfiguration.addPropertyChangeListener(listener);
+ _jettyConfiguration.addPropertyChangeListener(_listener);
}
/**
@@ -99,7 +99,7 @@ public void propertyChange(PropertyChangeEvent event)
*/
protected void changePortNumber(String id, int port)
{
- TableItem[] items = ports.getItems();
+ TableItem[] items = _ports.getItems();
int size = items.length;
for (int i = 0; i < size; i++)
{
@@ -145,19 +145,19 @@ public void createSection(Composite parent)
toolkit.paintBordersFor(composite);
section.setClient(composite);
- ports = toolkit.createTable(composite,SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION);
- ports.setHeaderVisible(true);
- ports.setLinesVisible(true);
- whs.setHelp(ports,ContextIds.CONFIGURATION_EDITOR_PORTS_LIST);
+ _ports = toolkit.createTable(composite,SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION);
+ _ports.setHeaderVisible(true);
+ _ports.setLinesVisible(true);
+ whs.setHelp(_ports,ContextIds.CONFIGURATION_EDITOR_PORTS_LIST);
TableLayout tableLayout = new TableLayout();
- TableColumn col = new TableColumn(ports,SWT.NONE);
+ TableColumn col = new TableColumn(_ports,SWT.NONE);
col.setText(Messages.configurationEditorPortNameColumn);
ColumnWeightData colData = new ColumnWeightData(15,150,true);
tableLayout.addColumnData(colData);
- col = new TableColumn(ports,SWT.NONE);
+ col = new TableColumn(_ports,SWT.NONE);
col.setText(Messages.configurationEditorPortValueColumn);
colData = new ColumnWeightData(8,80,true);
tableLayout.addColumnData(colData);
@@ -165,11 +165,11 @@ public void createSection(Composite parent)
GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
data.widthHint = 230;
data.heightHint = 100;
- ports.setLayoutData(data);
- ports.setLayout(tableLayout);
+ _ports.setLayoutData(data);
+ _ports.setLayout(tableLayout);
- viewer = new TableViewer(ports);
- viewer.setColumnProperties(new String[]
+ _viewer = new TableViewer(_ports);
+ _viewer.setColumnProperties(new String[]
{ "name", "port" });
initialize();
@@ -177,8 +177,8 @@ public void createSection(Composite parent)
protected void setupPortEditors()
{
- viewer.setCellEditors(new CellEditor[]
- { null, new TextCellEditor(ports) });
+ _viewer.setCellEditors(new CellEditor[]
+ { null, new TextCellEditor(_ports) });
ICellModifier cellModifier = new ICellModifier()
{
@@ -205,7 +205,7 @@ public void modify(Object element, String property, Object value)
Item item = (Item)element;
ServerPort sp = (ServerPort)item.getData();
int port = Integer.parseInt((String)value);
- execute(new ModifyPortCommand(jettyConfiguration,sp.getId(),port));
+ execute(new ModifyPortCommand(_jettyConfiguration,sp.getId(),port));
}
catch (Exception ex)
{
@@ -213,20 +213,20 @@ public void modify(Object element, String property, Object value)
}
}
};
- viewer.setCellModifier(cellModifier);
+ _viewer.setCellModifier(cellModifier);
// preselect second column (Windows-only)
String os = System.getProperty("os.name");
if (os != null && os.toLowerCase().indexOf("win") >= 0)
{
- ports.addSelectionListener(new SelectionAdapter()
+ _ports.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected(SelectionEvent event)
{
try
{
- int n = ports.getSelectionIndex();
- viewer.editElement(ports.getItem(n).getData(),1);
+ int n = _ports.getSelectionIndex();
+ _viewer.editElement(_ports.getItem(n).getData(),1);
}
catch (Exception e)
{
@@ -239,8 +239,8 @@ public void widgetSelected(SelectionEvent event)
public void dispose()
{
- if (jettyConfiguration != null)
- jettyConfiguration.removePropertyChangeListener(listener);
+ if (_jettyConfiguration != null)
+ _jettyConfiguration.removePropertyChangeListener(_listener);
}
/*
@@ -257,7 +257,7 @@ public void init(IEditorSite site, IEditorInput input)
{
ts = (IJettyServer)server.loadAdapter(IJettyServer.class,null);
}
- jettyConfiguration = (IJettyConfigurationWorkingCopy)ts.getJettyConfiguration();
+ _jettyConfiguration = (IJettyConfigurationWorkingCopy)ts.getJettyConfiguration();
}
catch (Exception e)
{
@@ -272,31 +272,32 @@ public void init(IEditorSite site, IEditorInput input)
*/
protected void initialize()
{
- if (ports == null)
+ if (_ports == null)
return;
- ports.removeAll();
+ _ports.removeAll();
- Iterator iterator = jettyConfiguration.getServerPorts().iterator();
+ Iterator<ServerPort> iterator = _jettyConfiguration.getServerPorts().iterator();
+
while (iterator.hasNext())
{
- ServerPort port = (ServerPort)iterator.next();
- TableItem item = new TableItem(ports,SWT.NONE);
+ ServerPort port = iterator.next();
+ TableItem item = new TableItem(_ports,SWT.NONE);
String portStr = "-";
if (port.getPort() >= 0)
portStr = port.getPort() + "";
String[] s = new String[]
{ port.getName(), portStr };
item.setText(s);
- item.setImage(JettyUIPlugin.getImage(JettyUIPlugin.IMG_PORT));
+ item.setImage(JettyUIPlugin.getImage(JettyUIPlugin.__IMG_PORT));
item.setData(port);
}
if (readOnly)
{
- viewer.setCellEditors(new CellEditor[]
+ _viewer.setCellEditors(new CellEditor[]
{ null, null });
- viewer.setCellModifier(null);
+ _viewer.setCellModifier(null);
}
else
{
View
177 ...erver.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/editor/ConfigurationWebModuleEditorPart.java
@@ -67,17 +67,17 @@
*/
public class ConfigurationWebModuleEditorPart extends ServerEditorPart
{
- protected IJettyServerWorkingCopy server2;
- protected IJettyConfigurationWorkingCopy configuration;
+ protected IJettyServerWorkingCopy _server2;
+ protected IJettyConfigurationWorkingCopy _configuration;
- protected Table webAppTable;
- protected int selection = -1;
- protected Button addProject;
- protected Button addExtProject;
- protected Button remove;
- protected Button edit;
+ protected Table _webAppTable;
+ protected int _selection = -1;
+ protected Button _addProjectButton;
+ protected Button _addExtProjectButton;
+ protected Button _removeButton;
+ protected Button _editButton;
- protected PropertyChangeListener listener;
+ protected PropertyChangeListener _listener;
/**
* ConfigurationWebModuleEditorPart constructor comment.
@@ -92,25 +92,25 @@ public ConfigurationWebModuleEditorPart()
*/
protected void addChangeListener()
{
- listener = new PropertyChangeListener()
+ _listener = new PropertyChangeListener()
{
public void propertyChange(PropertyChangeEvent event)
{
- if (IJettyConfiguration.MODIFY_WEB_MODULE_PROPERTY.equals(event.getPropertyName()))
+ if (IJettyConfiguration.__MODIFY_WEB_MODULE_PROPERTY.equals(event.getPropertyName()))
{
initialize();
}
- else if (IJettyConfiguration.ADD_WEB_MODULE_PROPERTY.equals(event.getPropertyName()))
+ else if (IJettyConfiguration.__ADD_WEB_MODULE_PROPERTY.equals(event.getPropertyName()))
{
initialize();
}
- else if (IJettyConfiguration.REMOVE_WEB_MODULE_PROPERTY.equals(event.getPropertyName()))
+ else if (IJettyConfiguration.__REMOVE_WEB_MODULE_PROPERTY.equals(event.getPropertyName()))
{
initialize();
}
}
};
- configuration.addPropertyChangeListener(listener);
+ _configuration.addPropertyChangeListener(_listener);
}
/**
@@ -123,7 +123,7 @@ public void createPartControl(Composite parent)
ScrolledForm form = toolkit.createScrolledForm(parent);
toolkit.decorateFormHeading(form.getForm());
form.setText(Messages.configurationEditorWebModulesPageTitle);
- form.setImage(JettyUIPlugin.getImage(JettyUIPlugin.IMG_WEB_MODULE));
+ form.setImage(JettyUIPlugin.getImage(JettyUIPlugin.__IMG_WEB_MODULE));
GridLayout layout = new GridLayout();
layout.marginTop = 6;
layout.marginLeft = 6;
@@ -148,25 +148,25 @@ public void createPartControl(Composite parent)
toolkit.paintBordersFor(composite);
section.setClient(composite);
- webAppTable = toolkit.createTable(composite,SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
- webAppTable.setHeaderVisible(true);
- webAppTable.setLinesVisible(true);
- whs.setHelp(webAppTable,ContextIds.CONFIGURATION_EDITOR_WEBMODULES_LIST);
+ _webAppTable = toolkit.createTable(composite,SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
+ _webAppTable.setHeaderVisible(true);
+ _webAppTable.setLinesVisible(true);
+ whs.setHelp(_webAppTable,ContextIds.CONFIGURATION_EDITOR_WEBMODULES_LIST);
// toolkit.paintBordersFor(webAppTable);
TableLayout tableLayout = new TableLayout();
- TableColumn col = new TableColumn(webAppTable,SWT.NONE);
+ TableColumn col = new TableColumn(_webAppTable,SWT.NONE);
col.setText(Messages.configurationEditorPathColumn);
ColumnWeightData colData = new ColumnWeightData(8,85,true);
tableLayout.addColumnData(colData);
- TableColumn col2 = new TableColumn(webAppTable,SWT.NONE);
+ TableColumn col2 = new TableColumn(_webAppTable,SWT.NONE);
col2.setText(Messages.configurationEditorDocBaseColumn);
colData = new ColumnWeightData(13,135,true);
tableLayout.addColumnData(colData);
- TableColumn col3 = new TableColumn(webAppTable,SWT.NONE);
+ TableColumn col3 = new TableColumn(_webAppTable,SWT.NONE);
col3.setText(Messages.configurationEditorProjectColumn);
colData = new ColumnWeightData(8,85,true);
tableLayout.addColumnData(colData);
@@ -176,13 +176,13 @@ public void createPartControl(Composite parent)
// colData = new ColumnWeightData(7, 75, true);
// tableLayout.addColumnData(colData);
- webAppTable.setLayout(tableLayout);
+ _webAppTable.setLayout(tableLayout);
GridData data = new GridData(GridData.FILL_HORIZONTAL);
data.widthHint = 450;
data.heightHint = 120;
- webAppTable.setLayoutData(data);
- webAppTable.addSelectionListener(new SelectionAdapter()
+ _webAppTable.setLayoutData(data);
+ _webAppTable.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected(SelectionEvent e)
{
@@ -201,80 +201,80 @@ public void widgetSelected(SelectionEvent e)
// buttons still to add:
// add project, add external module, remove module
- addProject = toolkit.createButton(rightPanel,Messages.configurationEditorAddProjectModule,SWT.PUSH);
+ _addProjectButton = toolkit.createButton(rightPanel,Messages.configurationEditorAddProjectModule,SWT.PUSH);
data = new GridData(GridData.FILL_HORIZONTAL);
- addProject.setLayoutData(data);
- whs.setHelp(addProject,ContextIds.CONFIGURATION_EDITOR_WEBMODULES_ADD_PROJECT);
+ _addProjectButton.setLayoutData(data);
+ whs.setHelp(_addProjectButton,ContextIds.CONFIGURATION_EDITOR_WEBMODULES_ADD_PROJECT);
// disable the add project module button if there are no
// web projects in the workbench
if (!canAddWebModule())
- addProject.setEnabled(false);
+ _addProjectButton.setEnabled(false);
else
{
- addProject.addSelectionListener(new SelectionAdapter()
+ _addProjectButton.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected(SelectionEvent e)
{
- WebModuleDialog dialog = new WebModuleDialog(getEditorSite().getShell(),getServer(),server2,configuration,true);
+ WebModuleDialog dialog = new WebModuleDialog(getEditorSite().getShell(),getServer(),_server2,_configuration,true);
dialog.open();
if (dialog.getReturnCode() == IDialogConstants.OK_ID)
{
- execute(new AddModuleCommand(getServer(),dialog.module4));
+ execute(new AddModuleCommand(getServer(),dialog._module4));
}
}
});
}
- addExtProject = toolkit.createButton(rightPanel,Messages.configurationEditorAddExternalModule,SWT.PUSH);
+ _addExtProjectButton = toolkit.createButton(rightPanel,Messages.configurationEditorAddExternalModule,SWT.PUSH);
data = new GridData(GridData.FILL_HORIZONTAL);
- addExtProject.setLayoutData(data);
- addExtProject.addSelectionListener(new SelectionAdapter()
+ _addExtProjectButton.setLayoutData(data);
+ _addExtProjectButton.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected(SelectionEvent e)
{
- WebModuleDialog dialog = new WebModuleDialog(getEditorSite().getShell(),getServer(),server2,configuration,false);
+ WebModuleDialog dialog = new WebModuleDialog(getEditorSite().getShell(),getServer(),_server2,_configuration,false);
dialog.open();
if (dialog.getReturnCode() == IDialogConstants.OK_ID)
{
- execute(new AddWebModuleCommand(configuration,dialog.getWebModule()));
+ execute(new AddWebModuleCommand(_configuration,dialog.getWebModule()));
}
}
});
- whs.setHelp(addExtProject,ContextIds.CONFIGURATION_EDITOR_WEBMODULES_ADD_EXTERNAL);
+ whs.setHelp(_addExtProjectButton,ContextIds.CONFIGURATION_EDITOR_WEBMODULES_ADD_EXTERNAL);
- edit = toolkit.createButton(rightPanel,Messages.editorEdit,SWT.PUSH);
+ _editButton = toolkit.createButton(rightPanel,Messages.editorEdit,SWT.PUSH);
data = new GridData(GridData.FILL_HORIZONTAL);
- edit.setLayoutData(data);
- edit.setEnabled(false);
- edit.addSelectionListener(new SelectionAdapter()
+ _editButton.setLayoutData(data);
+ _editButton.setEnabled(false);
+ _editButton.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected(SelectionEvent e)
{
- if (selection < 0)
+ if (_selection < 0)
return;
- WebModule module = (WebModule)configuration.getWebModules().get(selection);
- WebModuleDialog dialog = new WebModuleDialog(getEditorSite().getShell(),getServer(),server2,configuration,module);
+ WebModule module = (WebModule)_configuration.getWebModules().get(_selection);
+ WebModuleDialog dialog = new WebModuleDialog(getEditorSite().getShell(),getServer(),_server2,_configuration,module);
dialog.open();
if (dialog.getReturnCode() == IDialogConstants.OK_ID)
{
- execute(new ModifyWebModuleCommand(configuration,selection,dialog.getWebModule()));
+ execute(new ModifyWebModuleCommand(_configuration,_selection,dialog.getWebModule()));
}
}
});
- whs.setHelp(edit,ContextIds.CONFIGURATION_EDITOR_WEBMODULES_EDIT);
+ whs.setHelp(_editButton,ContextIds.CONFIGURATION_EDITOR_WEBMODULES_EDIT);
- remove = toolkit.createButton(rightPanel,Messages.editorRemove,SWT.PUSH);
+ _removeButton = toolkit.createButton(rightPanel,Messages.editorRemove,SWT.PUSH);
data = new GridData(GridData.FILL_HORIZONTAL);
- remove.setLayoutData(data);
- remove.setEnabled(false);
- remove.addSelectionListener(new SelectionAdapter()
+ _removeButton.setLayoutData(data);
+ _removeButton.setEnabled(false);
+ _removeButton.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected(SelectionEvent e)
{
- if (selection < 0)
+ if (_selection < 0)
return;
- TableItem item = webAppTable.getItem(selection);
+ TableItem item = _webAppTable.getItem(_selection);
if (item.getData() != null)
{
IModule module = (IModule)item.getData();
@@ -282,14 +282,14 @@ public void widgetSelected(SelectionEvent e)
}
else
{
- execute(new RemoveWebModuleCommand(configuration,selection));
+ execute(new RemoveWebModuleCommand(_configuration,_selection));
}
- remove.setEnabled(false);
- edit.setEnabled(false);
- selection = -1;
+ _removeButton.setEnabled(false);
+ _editButton.setEnabled(false);
+ _selection = -1;
}
});
- whs.setHelp(remove,ContextIds.CONFIGURATION_EDITOR_WEBMODULES_REMOVE);
+ whs.setHelp(_removeButton,ContextIds.CONFIGURATION_EDITOR_WEBMODULES_REMOVE);
form.setContent(section);
form.reflow(true);
@@ -322,8 +322,8 @@ public void dispose()
{
super.dispose();
- if (configuration != null)
- configuration.removePropertyChangeListener(listener);
+ if (_configuration != null)
+ _configuration.removePropertyChangeListener(_listener);
}
/*
@@ -336,17 +336,17 @@ public void init(IEditorSite site, IEditorInput input)
IJettyServer ts = (IJettyServer)server.loadAdapter(IJettyServer.class,null);
try
{
- configuration = (IJettyConfigurationWorkingCopy)ts.getJettyConfiguration();
+ _configuration = (IJettyConfigurationWorkingCopy)ts.getJettyConfiguration();
}
catch (Exception e)
{
// ignore
}
- if (configuration != null)
+ if (_configuration != null)
addChangeListener();
if (server != null)
- server2 = (IJettyServerWorkingCopy)server.loadAdapter(IJettyServerWorkingCopy.class,null);
+ _server2 = (IJettyServerWorkingCopy)server.loadAdapter(IJettyServerWorkingCopy.class,null);
initialize();
}
@@ -356,19 +356,20 @@ public void init(IEditorSite site, IEditorInput input)
*/
protected void initialize()
{
- if (webAppTable == null)
+ if (_webAppTable == null)
return;
- webAppTable.removeAll();
+ _webAppTable.removeAll();
setErrorMessage(null);
ILabelProvider labelProvider = ServerUICore.getLabelProvider();
- List list = configuration.getWebModules();
- Iterator iterator = list.iterator();
+ List<WebModule> list = _configuration.getWebModules();
+ Iterator<WebModule> iterator = list.iterator();
+
while (iterator.hasNext())
{
- WebModule module = (WebModule)iterator.next();
- TableItem item = new TableItem(webAppTable,SWT.NONE);
+ WebModule module = iterator.next();
+ TableItem item = new TableItem(_webAppTable,SWT.NONE);
String memento = module.getMemento();
String projectName = "";
@@ -377,7 +378,7 @@ protected void initialize()
{
projectName = NLS.bind(Messages.configurationEditorProjectMissing,new String[]
{ memento });
- projectImage = JettyUIPlugin.getImage(JettyUIPlugin.IMG_PROJECT_MISSING);
+ projectImage = JettyUIPlugin.getImage(JettyUIPlugin.__IMG_PROJECT_MISSING);
IModule module2 = ServerUtil.getModule(memento);
if (module2 != null)
{
@@ -391,13 +392,13 @@ protected void initialize()
String[] s = new String[]
{ module.getPath(), module.getDocumentBase(), projectName, reload };
item.setText(s);
- item.setImage(0,JettyUIPlugin.getImage(JettyUIPlugin.IMG_WEB_MODULE));
+ item.setImage(0,JettyUIPlugin.getImage(JettyUIPlugin.__IMG_WEB_MODULE));
if (projectImage != null)
item.setImage(2,projectImage);
if (!isDocumentBaseValid(module.getDocumentBase()))
{
- item.setImage(1,JettyUIPlugin.getImage(JettyUIPlugin.IMG_PROJECT_MISSING));
+ item.setImage(1,JettyUIPlugin.getImage(JettyUIPlugin.__IMG_PROJECT_MISSING));
setErrorMessage(NLS.bind(Messages.errorMissingWebModule,module.getDocumentBase()));
}
}
@@ -405,15 +406,15 @@ protected void initialize()
if (readOnly)
{
- addProject.setEnabled(false);
- addExtProject.setEnabled(false);
- edit.setEnabled(false);
- remove.setEnabled(false);
+ _addProjectButton.setEnabled(false);
+ _addExtProjectButton.setEnabled(false);
+ _editButton.setEnabled(false);
+ _removeButton.setEnabled(false);
}
else
{
- addProject.setEnabled(canAddWebModule());
- addExtProject.setEnabled(true);
+ _addProjectButton.setEnabled(canAddWebModule());
+ _addExtProjectButton.setEnabled(true);
}
}
@@ -427,15 +428,15 @@ protected void selectWebApp()
try
{
- selection = webAppTable.getSelectionIndex();
- remove.setEnabled(true);
- edit.setEnabled(true);
+ _selection = _webAppTable.getSelectionIndex();
+ _removeButton.setEnabled(true);
+ _editButton.setEnabled(true);
}
catch (Exception e)
{
- selection = -1;
- remove.setEnabled(false);
- edit.setEnabled(false);
+ _selection = -1;
+ _removeButton.setEnabled(false);
+ _editButton.setEnabled(false);
}
}
@@ -460,11 +461,11 @@ protected boolean isDocumentBaseValid(String s)
// bad path
}
- if (s.startsWith(configuration.getDocBasePrefix()))
+ if (s.startsWith(_configuration.getDocBasePrefix()))
{
try
{
- String t = s.substring(configuration.getDocBasePrefix().length());
+ String t = s.substring(_configuration.getDocBasePrefix().length());
if (ResourcesPlugin.getWorkspace().getRoot().getProject(t).exists())
return true;
}
@@ -494,7 +495,7 @@ protected boolean isDocumentBaseValid(String s)
*/
public void setFocus()
{
- if (webAppTable != null)
- webAppTable.setFocus();
+ if (_webAppTable != null)
+ _webAppTable.setFocus();
}
}
View
88 org.eclipse.jst.server.jetty.ui/src/org/eclipse/jst/server/jetty/ui/internal/editor/WebModuleDialog.java
@@ -51,16 +51,16 @@
*/
public class WebModuleDialog extends Dialog
{
- protected IModule module4;
- protected WebModule module;
- protected boolean isEdit;
- protected boolean isProject;
- protected Text docBase;
- protected IServerAttributes server2;
- protected IJettyServer server;
- protected IJettyConfiguration config;
+ protected IModule _module4;
+ protected WebModule _module;
+ protected boolean _isEdit;
+ protected boolean _isProject;
+ protected Text _docBase;
+ protected IServerAttributes _serverAttributes;
+ protected IJettyServer _server;
+ protected IJettyConfiguration _config;
- protected Table projTable;
+ protected Table _projTable;
/**
* WebModuleDialog constructor comment.
@@ -79,11 +79,11 @@
public WebModuleDialog(Shell parentShell, IServerAttributes server2, IJettyServer server, IJettyConfiguration config, WebModule module)
{
super(parentShell);
- this.module = module;
- this.server2 = server2;
- this.server = server;
- this.config = config;
- isEdit = true;
+ this._module = module;
+ this._serverAttributes = server2;
+ this._server = server;
+ this._config = config;
+ _isEdit = true;
}
/**
@@ -103,8 +103,8 @@ public WebModuleDialog(Shell parentShell, IServerAttributes server2, IJettyServe
public WebModuleDialog(Shell parentShell, IServerAttributes server2, IJettyServer server, IJettyConfiguration config, boolean isProject)
{
this(parentShell,server2,server,config,new WebModule("/","",null,true));
- isEdit = false;
- this.isProject = isProject;
+ _isEdit = false;
+ this._isProject = isProject;
}
/**
@@ -113,7 +113,7 @@ public WebModuleDialog(Shell parentShell, IServerAttributes server2, IJettyServe
protected void configureShell(Shell newShell)
{
super.configureShell(newShell);
- if (isEdit)
+ if (_isEdit)
newShell.setText(Messages.configurationEditorWebModuleDialogTitleEdit);
else
newShell.setText(Messages.configurationEditorWebModuleDialogTitleAdd);
@@ -146,23 +146,23 @@ protected Control createDialogArea(Composite parent)
IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
whs.setHelp(composite,ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG);
// add project field if we are adding a project
- if (!isEdit && isProject)
+ if (!_isEdit && _isProject)
{
Label l = new Label(composite,SWT.NONE);
l.setText(Messages.configurationEditorWebModuleDialogProjects);
GridData data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
l.setLayoutData(data);
- projTable = new Table(composite,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE);
+ _projTable = new Table(composite,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.SINGLE);
data = new GridData();
data.widthHint = 150;
data.heightHint = 75;
- projTable.setLayoutData(data);
- whs.setHelp(projTable,ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PROJECT);
+ _projTable.setLayoutData(data);
+ whs.setHelp(_projTable,ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PROJECT);
// fill table with web module projects
ILabelProvider labelProvider = ServerUICore.getLabelProvider();
- IModule[] modules = ServerUtil.getModules(server2.getServerType().getRuntimeType().getModuleTypes());
+ IModule[] modules = ServerUtil.getModules(_serverAttributes.getServerType().getRuntimeType().getModuleTypes());
if (modules != null)
{
int size = modules.length;
@@ -171,11 +171,11 @@ protected Control createDialogArea(Composite parent)
IModule module3 = modules[i];
if ("jst.web".equals(module3.getModuleType().getId()))
{
- IStatus status = server2.canModifyModules(new IModule[]
+ IStatus status = _serverAttributes.canModifyModules(new IModule[]
{ module3 },null,null);
if (status != null && status.isOK())
{
- TableItem item = new TableItem(projTable,SWT.NONE);
+ TableItem item = new TableItem(_projTable,SWT.NONE);
item.setText(0,labelProvider.getText(module3));
item.setImage(0,labelProvider.getImage(module3));
item.setData(module3);
@@ -188,28 +188,28 @@ protected Control createDialogArea(Composite parent)
}
new Label(composite,SWT.NONE).setText(Messages.configurationEditorWebModuleDialogDocumentBase);
- docBase = new Text(composite,SWT.BORDER);
+ _docBase = new Text(composite,SWT.BORDER);
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- docBase.setLayoutData(data);
- docBase.setText(module.getDocumentBase());
- whs.setHelp(docBase,ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG_DOCBASE);
+ _docBase.setLayoutData(data);
+ _docBase.setText(_module.getDocumentBase());
+ whs.setHelp(_docBase,ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG_DOCBASE);
// disable document base for project modules
- if (isProject || (module.getMemento() != null && module.getMemento().length() > 0))
- docBase.setEditable(false);
+ if (_isProject || (_module.getMemento() != null && _module.getMemento().length() > 0))
+ _docBase.setEditable(false);
else
{
- docBase.addModifyListener(new ModifyListener()
+ _docBase.addModifyListener(new ModifyListener()
{
public void modifyText(ModifyEvent e)
{
- module = new WebModule(module.getPath(),docBase.getText(),module.getMemento(),module.isReloadable());
+ _module = new WebModule(_module.getPath(),_docBase.getText(),_module.getMemento(),_module.isReloadable());
validate();
}
});
}
- if (isEdit || isProject)
+ if (_isEdit || _isProject)
new Label(composite,SWT.NONE).setText(" ");
else
{
@@ -225,7 +225,7 @@ public void widgetSelected(SelectionEvent se)
dialog.setMessage(Messages.configurationEditorWebModuleDialogSelectDirectory);
String selectedDirectory = dialog.open();
if (selectedDirectory != null)
- docBase.setText(selectedDirectory);
+ _docBase.setText(selectedDirectory);
}
catch (Exception e)
{
@@ -241,7 +241,7 @@ public void widgetSelected(SelectionEvent se)
data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
data.widthHint = 150;
path.setLayoutData(data);
- path.setText(module.getPath());
+ path.setText(_module.getPath());
/*
* if (module.getMemento() != null && module.getMemento().length() > 0) path.setEditable(false); else
*/
@@ -249,7 +249,7 @@ public void widgetSelected(SelectionEvent se)
{
public void modifyText(ModifyEvent e)
{
- module = new WebModule(path.getText(),module.getDocumentBase(),module.getMemento(),module.isReloadable());
+ _module = new WebModule(path.getText(),_module.getDocumentBase(),_module.getMemento(),_module.isReloadable());
}
});
whs.setHelp(path,ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG_PATH);
@@ -272,23 +272,23 @@ public void modifyText(ModifyEvent e)
// whs.setHelp(reloadable, ContextIds.CONFIGURATION_EDITOR_WEBMODULE_DIALOG_RELOAD);
// }
- if (!isEdit && isProject)
+ if (!_isEdit && _isProject)
{
- projTable.addSelectionListener(new SelectionAdapter()
+ _projTable.addSelectionListener(new SelectionAdapter()
{
public void widgetSelected(SelectionEvent event)
{
try
{
- IModule module3 = (IModule)projTable.getSelection()[0].getData();
+ IModule module3 = (IModule)_projTable.getSelection()[0].getData();
IWebModule module2 = (IWebModule)module3.loadAdapter(IWebModule.class,null);
String contextRoot = module2.getContextRoot();
if (contextRoot != null && !contextRoot.startsWith("/") && contextRoot.length() > 0)
contextRoot = "/" + contextRoot;
- module = new WebModule(contextRoot,module3.getName(),module3.getId(),module.isReloadable());
- docBase.setText(module3.getName());
+ _module = new WebModule(contextRoot,module3.getName(),module3.getId(),_module.isReloadable());
+ _docBase.setText(module3.getName());
path.setText(contextRoot);
- module4 = module3;
+ _module4 = module3;
}
catch (Exception e)
{
@@ -315,7 +315,7 @@ protected Control createButtonBar(Composite parent)
protected void validate()
{
boolean ok = true;
- if (module.getDocumentBase() == null || module.getDocumentBase().length() < 1)
+ if (_module.getDocumentBase() == null || _module.getDocumentBase().length() < 1)
ok = false;
getButton(IDialogConstants.OK_ID).setEnabled(ok);
@@ -328,6 +328,6 @@ protected void validate()
*/
public WebModule getWebModule()
{
- return module;
+ return _module;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.