Skip to content

Commit 862f1a8

Browse files
author
jossonsmith
committed
Merge with /trunks for bug-fix of refrenced projects' classpath bugs.
And also fix bugs that some launcher tabs are with border styles.
1 parent 817a4b2 commit 862f1a8

File tree

8 files changed

+81
-136
lines changed

8 files changed

+81
-136
lines changed

src/net/sf/j2s/ui/classpath/CompositeResources.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,6 @@ public boolean accept(File pathname) {
279279
}
280280
for (Iterator iter = resources.iterator(); iter.hasNext();) {
281281
Resource res = (Resource) iter.next();
282-
if (!J2SCyclicProjectUtils.visit(res)) {
283-
continue;
284-
}
285282
if (res instanceof CompositeResources) {
286283
CompositeResources c = (CompositeResources) res;
287284
buf.append(c.toJ2XString());
@@ -290,12 +287,12 @@ public boolean accept(File pathname) {
290287
}
291288
for (Iterator iter = resources.iterator(); iter.hasNext();) {
292289
Resource res = (Resource) iter.next();
293-
if (!J2SCyclicProjectUtils.visit(res)) {
294-
continue;
295-
}
296290
if (res instanceof ContactedClasses) {
291+
if (!J2SCyclicProjectUtils.visit(res)) {
292+
continue;
293+
}
297294
ContactedClasses unit = (ContactedClasses) res;
298-
buf.append(unit.getAbsoluteFile().getAbsolutePath());
295+
buf.append(unit.toJ2XString());
299296
buf.append(',');
300297
}
301298
}
@@ -378,21 +375,21 @@ public String ignoredClassesString() {
378375
}
379376
for (Iterator iter = resources.iterator(); iter.hasNext();) {
380377
Resource res = (Resource) iter.next();
381-
if (!J2SCyclicProjectUtils.visit(res)) {
382-
continue;
383-
}
384378
if (res instanceof CompositeResources) {
379+
if (!J2SCyclicProjectUtils.visit(res)) {
380+
continue;
381+
}
385382
CompositeResources c = (CompositeResources) res;
386383
buf.append(c.ignoredClassesString());
387384
buf.append(',');
388385
}
389386
}
390387
for (Iterator iter = abandonedResources.iterator(); iter.hasNext();) {
391388
Resource res = (Resource) iter.next();
392-
if (!J2SCyclicProjectUtils.visit(res)) {
393-
continue;
394-
}
395389
if (res instanceof UnitClass) {
390+
if (!J2SCyclicProjectUtils.visit(res)) {
391+
continue;
392+
}
396393
UnitClass unit = (UnitClass) res;
397394
buf.append(unit.getClassName());
398395
buf.append(',');

src/net/sf/j2s/ui/launching/IJ2SLauchingConfiguration.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
public interface IJ2SLauchingConfiguration {
44

5-
public static final String RUN_IN_BACKGROUND = "run.in.background";
6-
public static final String INNER_CONSOLE = "inner.console";
75
public static final String FAST_VIEW_J2S_CONSOLE = "fast.view.j2s.console";
86
public static final String MAXIMIZE_J2S_CONSOLE = "maximize.j2s.console";
97

src/net/sf/j2s/ui/launching/J2SArgumentsTab.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2005 IBM Corporation and others.
2+
* Copyright (c) 2000, 2006 IBM Corporation and others.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v1.0
55
* which accompanies this distribution, and is available at
@@ -14,9 +14,9 @@
1414
import org.eclipse.core.runtime.CoreException;
1515
import org.eclipse.debug.core.ILaunchConfiguration;
1616
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
17-
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
1817
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
1918
import org.eclipse.debug.ui.StringVariableSelectionDialog;
19+
import org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchTab;
2020
import org.eclipse.jdt.internal.debug.ui.IJavaDebugHelpContextIds;
2121
import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
2222
import org.eclipse.jdt.internal.debug.ui.JavaDebugImages;
@@ -48,7 +48,7 @@
4848
* </p>
4949
* @since 2.0
5050
*/
51-
public class J2SArgumentsTab extends AbstractLaunchConfigurationTab {
51+
public class J2SArgumentsTab extends JavaLaunchTab {
5252

5353
// Program arguments widgets
5454
protected Label fPrgmArgumentsLabel;
@@ -80,7 +80,7 @@ protected WorkingDirectoryBlock createWorkingDirBlock() {
8080
*/
8181
public void createControl(Composite parent) {
8282
Font font = parent.getFont();
83-
Composite comp = new Composite(parent, parent.getStyle());
83+
Composite comp = new Composite(parent, SWT.NONE);
8484
GridLayout layout = new GridLayout(1, true);
8585
comp.setLayout(layout);
8686
comp.setFont(font);
@@ -96,7 +96,7 @@ public void createControl(Composite parent) {
9696
group.setLayout(layout);
9797
group.setLayoutData(new GridData(GridData.FILL_BOTH));
9898

99-
String controlName = (LauncherMessages.JavaArgumentsTab__Program_arguments__5); //$NON-NLS-1$
99+
String controlName = (LauncherMessages.JavaArgumentsTab__Program_arguments__5);
100100
group.setText(controlName);
101101

102102
fPrgmArgumentsText = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
@@ -112,7 +112,7 @@ public void modifyText(ModifyEvent evt) {
112112
});
113113
ControlAccessibleListener.addListener(fPrgmArgumentsText, group.getText());
114114

115-
String buttonLabel = LauncherMessages.JavaArgumentsTab_5; //$NON-NLS-1$
115+
String buttonLabel = LauncherMessages.JavaArgumentsTab_5;
116116
Button pgrmArgVariableButton = createPushButton(group, buttonLabel, null);
117117
pgrmArgVariableButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
118118
pgrmArgVariableButton.addSelectionListener(new SelectionListener() {
@@ -175,7 +175,7 @@ public void initializeFrom(ILaunchConfiguration configuration) {
175175
//fVMArgumentsBlock.initializeFrom(configuration);
176176
fWorkingDirectoryBlock.initializeFrom(configuration);
177177
} catch (CoreException e) {
178-
setErrorMessage(LauncherMessages.JavaArgumentsTab_Exception_occurred_reading_configuration___15 + e.getStatus().getMessage()); //$NON-NLS-1$
178+
setErrorMessage(LauncherMessages.JavaArgumentsTab_Exception_occurred_reading_configuration___15 + e.getStatus().getMessage());
179179
JDIDebugUIPlugin.log(e);
180180
}
181181
}
@@ -190,7 +190,7 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
190190
}
191191

192192
/**
193-
* Retuns the string in the text widget, or <code>null</code> if empty.
193+
* Returns the string in the text widget, or <code>null</code> if empty.
194194
*
195195
* @return text or <code>null</code>
196196
*/
@@ -206,7 +206,7 @@ protected String getAttributeValueFrom(Text text) {
206206
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
207207
*/
208208
public String getName() {
209-
return LauncherMessages.JavaArgumentsTab__Arguments_16; //$NON-NLS-1$
209+
return LauncherMessages.JavaArgumentsTab__Arguments_16;
210210
}
211211

212212
/**
@@ -250,7 +250,7 @@ public Image getImage() {
250250
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
251251
*/
252252
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
253-
// do nothing when activated
253+
fWorkingDirectoryBlock.initializeFrom(workingCopy);
254254
}
255255

256256
/* (non-Javadoc)
@@ -260,4 +260,3 @@ public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
260260
// do nothing when deactivated
261261
}
262262
}
263-

src/net/sf/j2s/ui/launching/J2SConsoleOptionsTab.java

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.eclipse.debug.core.ILaunchConfiguration;
55
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
66
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
7+
import org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchTab;
78
import org.eclipse.jdt.internal.debug.ui.JavaDebugImages;
89
import org.eclipse.swt.SWT;
910
import org.eclipse.swt.events.SelectionAdapter;
@@ -18,10 +19,6 @@
1819

1920
public class J2SConsoleOptionsTab extends AbstractLaunchConfigurationTab {
2021

21-
private Button btnBackground;
22-
23-
private Button btnInnerConsole;
24-
2522
private Button btnFastView;
2623

2724
private Button btnMaximize;
@@ -32,7 +29,7 @@ public J2SConsoleOptionsTab() {
3229

3330
public void createControl(Composite parent) {
3431
Font font = parent.getFont();
35-
Composite comp = new Composite(parent, parent.getStyle());
32+
Composite comp = new Composite(parent, SWT.NONE);
3633
GridLayout layout = new GridLayout(1, true);
3734
comp.setLayout(layout);
3835
comp.setFont(font);
@@ -50,24 +47,6 @@ public void createControl(Composite parent) {
5047
String controlName = "Console UI Options";
5148
group.setText(controlName);
5249

53-
btnBackground = new Button(group, SWT.CHECK);
54-
btnBackground.setText("Run in background");
55-
btnBackground.addSelectionListener(new SelectionAdapter() {
56-
public void widgetSelected(SelectionEvent e) {
57-
updateLaunchConfigurationDialog();
58-
}
59-
});
60-
btnBackground.setEnabled(false);
61-
62-
btnInnerConsole = new Button(group, SWT.CHECK);
63-
btnInnerConsole.setText("Contains inner console");
64-
btnInnerConsole.addSelectionListener(new SelectionAdapter() {
65-
public void widgetSelected(SelectionEvent e) {
66-
updateLaunchConfigurationDialog();
67-
}
68-
});
69-
btnInnerConsole.setEnabled(false);
70-
7150
btnFastView = new Button(group, SWT.CHECK);
7251
btnFastView.setText("Make J2S console as fast view automatically");
7352
btnFastView.addSelectionListener(new SelectionAdapter() {
@@ -86,10 +65,6 @@ public void widgetSelected(SelectionEvent e) {
8665
}
8766

8867
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
89-
configuration.setAttribute(IJ2SLauchingConfiguration.RUN_IN_BACKGROUND,
90-
true);
91-
configuration.setAttribute(IJ2SLauchingConfiguration.INNER_CONSOLE,
92-
true);
9368
configuration.setAttribute(IJ2SLauchingConfiguration.FAST_VIEW_J2S_CONSOLE,
9469
false);
9570
configuration.setAttribute(
@@ -98,10 +73,6 @@ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
9873

9974
public void initializeFrom(ILaunchConfiguration configuration) {
10075
try {
101-
btnBackground.setSelection(configuration.getAttribute(
102-
IJ2SLauchingConfiguration.RUN_IN_BACKGROUND, true));
103-
btnInnerConsole.setSelection(configuration.getAttribute(
104-
IJ2SLauchingConfiguration.INNER_CONSOLE, true));
10576
btnFastView.setSelection(configuration.getAttribute(
10677
IJ2SLauchingConfiguration.FAST_VIEW_J2S_CONSOLE, false));
10778
btnMaximize.setSelection(configuration.getAttribute(
@@ -112,10 +83,6 @@ public void initializeFrom(ILaunchConfiguration configuration) {
11283
}
11384

11485
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
115-
configuration.setAttribute(IJ2SLauchingConfiguration.RUN_IN_BACKGROUND,
116-
btnBackground.getSelection());
117-
configuration.setAttribute(IJ2SLauchingConfiguration.INNER_CONSOLE,
118-
btnInnerConsole.getSelection());
11986
configuration.setAttribute(IJ2SLauchingConfiguration.FAST_VIEW_J2S_CONSOLE,
12087
btnFastView.getSelection());
12188
configuration.setAttribute(
@@ -133,5 +100,16 @@ public Image getImage() {
133100
public static Image getClasspathImage() {
134101
return JavaDebugImages.get(JavaDebugImages.IMG_OBJS_MONITOR);
135102
}
103+
104+
/* (non-Javadoc)
105+
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
106+
*/
107+
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {}
108+
109+
/* (non-Javadoc)
110+
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
111+
*/
112+
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {}
113+
136114

137115
}

src/net/sf/j2s/ui/launching/J2SGenerateHTMLOptionsTab.java

Lines changed: 11 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public J2SGenerateHTMLOptionsTab() {
3838

3939
public void createControl(Composite parent) {
4040
Font font = parent.getFont();
41-
Composite comp = new Composite(parent, parent.getStyle());
41+
Composite comp = new Composite(parent, SWT.NONE);
4242
GridLayout layout = new GridLayout(1, true);
4343
comp.setLayout(layout);
4444
comp.setFont(font);
@@ -74,63 +74,6 @@ public void modifyText(ModifyEvent evt) {
7474
updateLaunchConfigurationDialog();
7575
}
7676
});
77-
Composite c = new Composite(comp, parent.getStyle());
78-
layout = new GridLayout(4, false);
79-
c.setLayout(layout);
80-
gd = new GridData(GridData.FILL_BOTH);
81-
c.setLayoutData(gd);
82-
new Label(c, SWT.NONE).setText("Generate System.out.*() by");
83-
Button btnAlert = new Button(c, SWT.PUSH);
84-
btnAlert.setText("window.alert");
85-
btnAlert.addSelectionListener(new SelectionAdapter() {
86-
public void widgetSelected(SelectionEvent e) {
87-
String str = "<script type=\"text/javascript\">\r\n" +
88-
"System = {};\r\n" +
89-
"System.out = {};\r\n" +
90-
"System.err = {};\r\n" +
91-
"System.out.println = System.err.println = alert;\r\n" +
92-
"System.out.print = System.err.print = alert;\r\n" +
93-
"</script>";
94-
headHeaderText.setText(str);
95-
}
96-
});
97-
Button btnWrite = new Button(c, SWT.PUSH);
98-
btnWrite.setText("document.write");
99-
btnWrite.addSelectionListener(new SelectionAdapter() {
100-
public void widgetSelected(SelectionEvent e) {
101-
String str = "<script type=\"text/javascript\">\r\n" +
102-
"System = {};\r\n" +
103-
"System.out = {};\r\n" +
104-
"System.err = {};\r\n" +
105-
"System.out.println = System.err.println = function (str) {\r\n" +
106-
"\tdocument.write (str + \"<br/>\");\r\n" +
107-
"};\r\n" +
108-
"System.out.print = System.err.print = function (str) {\r\n" +
109-
"\tdocument.write (str);\r\n" +
110-
"};\r\n" +
111-
"</script>";
112-
headHeaderText.setText(str);
113-
}
114-
});
115-
Button btnInsert = new Button(c, SWT.PUSH);
116-
btnInsert.setText("document.body.appendChild");
117-
btnInsert.addSelectionListener(new SelectionAdapter() {
118-
public void widgetSelected(SelectionEvent e) {
119-
String str = "<script type=\"text/javascript\">\r\n" +
120-
"System = {};\r\n" +
121-
"System.out = {};\r\n" +
122-
"System.err = {};\r\n" +
123-
"System.out.println = System.err.println = function (str) {\r\n" +
124-
"\tdocument.body.appendChild (document.createTextNode (str));\r\n" +
125-
"\tdocument.body.appendChild (document.createElement (\"BR\"));\r\n" +
126-
"};\r\n" +
127-
"System.out.print = System.err.print = function (str) {\r\n" +
128-
"\tdocument.body.appendChild (document.createTextNode (str));\r\n" +
129-
"};\r\n" +
130-
"</script>";
131-
headHeaderText.setText(str);
132-
}
133-
});
13477

13578
new Label(comp, SWT.NONE).setText("Tail of Header:");
13679
tailHeaderText = new Text(comp, SWT.MULTI | SWT.WRAP | SWT.BORDER
@@ -244,5 +187,15 @@ public Image getImage() {
244187
public static Image getClasspathImage() {
245188
return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE);
246189
}
190+
191+
/* (non-Javadoc)
192+
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
193+
*/
194+
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {}
195+
196+
/* (non-Javadoc)
197+
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
198+
*/
199+
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {}
247200

248201
}

0 commit comments

Comments
 (0)