001: /*
002: * Created on May 22, 2004
003: */
004: package net.charabia.jsmoothgen.application.swtgui;
005:
006: import net.charabia.jsmoothgen.application.JSmoothModelBean;
007: import net.charabia.jsmoothgen.application.swtgui.resources.JSmoothResources;
008:
009: import org.eclipse.swt.SWT;
010: import org.eclipse.swt.events.SelectionAdapter;
011: import org.eclipse.swt.events.SelectionEvent;
012: import org.eclipse.swt.layout.GridData;
013: import org.eclipse.swt.layout.GridLayout;
014: import org.eclipse.swt.widgets.Button;
015: import org.eclipse.swt.widgets.Composite;
016: import org.eclipse.swt.widgets.Control;
017: import org.eclipse.swt.widgets.Group;
018: import org.eclipse.swt.widgets.List;
019: import org.eclipse.swt.widgets.Text;
020:
021: /**
022: * @author Dumon
023: */
024: public class JVMOptionsPage extends JSmoothPage {
025: private Text jar;
026: private Text mainclass;
027: private Text args;
028: private List classpath;
029: private Button usejar;
030: private Button setjar;
031: private Button addjar;
032: private Button addfolder;
033: private Button remove;
034:
035: public JVMOptionsPage(JSmoothApplication js) {
036: super (js);
037: }
038:
039: public Control createPageArea(Composite parent) {
040: Composite top = new Composite(parent, SWT.NONE);
041: top.setLayout(new GridLayout());
042:
043: // Classpath list
044: Group group = new Group(top, SWT.NONE);
045: group.setText("Classpath");
046: group.setLayout(new GridLayout());
047: GridData griddata = new GridData(GridData.FILL_HORIZONTAL);
048: group.setLayoutData(griddata);
049: group.setLayout(new GridLayout(2, false));
050:
051: classpath = new List(group, SWT.BORDER | SWT.V_SCROLL
052: | SWT.H_SCROLL | SWT.MULTI);
053: griddata = new GridData(GridData.FILL_BOTH);
054: griddata.widthHint = 250; // TODO: Hardscoded
055: griddata.heightHint = classpath.getItemHeight() * 10; // TODO: Hardcoded
056: classpath.setLayoutData(griddata);
057: classpath.addSelectionListener(new SelectionAdapter() {
058: public void widgetSelected(SelectionEvent e) {
059: }
060: });
061:
062: // The classpath Button bar
063: Composite composite = new Composite(group, SWT.NONE);
064: composite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
065: GridLayout layout = new GridLayout();
066: layout.marginHeight = 0;
067: layout.marginWidth = 2;
068: composite.setLayout(layout);
069:
070: addjar = new Button(composite, SWT.NONE);
071: addjar.setText("Add JAR File...");
072: addjar.addSelectionListener(new SelectionAdapter() {
073: public void widgetSelected(SelectionEvent e) {
074: }
075: });
076: griddata = new GridData(GridData.FILL_HORIZONTAL);
077: griddata.widthHint = 130;
078: addjar.setLayoutData(griddata);
079:
080: addfolder = new Button(composite, SWT.NONE);
081: addfolder.setText("Add Class Folder...");
082: addfolder.addSelectionListener(new SelectionAdapter() {
083: public void widgetSelected(SelectionEvent e) {
084: }
085: });
086: griddata = new GridData(GridData.FILL_HORIZONTAL);
087: griddata.widthHint = 130;
088: addfolder.setLayoutData(griddata);
089:
090: remove = new Button(composite, SWT.NONE);
091: remove.setText("Remove");
092: remove.addSelectionListener(new SelectionAdapter() {
093: public void widgetSelected(SelectionEvent e) {
094: }
095: });
096: griddata = new GridData(GridData.FILL_HORIZONTAL);
097: griddata.widthHint = 130;
098: remove.setLayoutData(griddata);
099:
100: return top;
101: }
102:
103: public void load() {
104: JSmoothModelBean jsmodel = getApplication().getModelBean();
105: }
106:
107: protected void configureResources() {
108: setImage(JSmoothResources.IMG_SWITCHER_APPLICATION);
109: setToolTip("JVM Options");
110: }
111: }
|