Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbc2e49c

Browse files
author
jossonsmith
committed
Merge with /trunk
1 parent33739eb commitbc2e49c

20 files changed

+1329
-52
lines changed

‎icons/z-logo-u.gif‎

1020 Bytes
Loading

‎plugin.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
</shortcut>
9797
<shortcut
9898
label="Java2Script Unit Test"
99-
icon="icons/z-logo.gif"
99+
icon="icons/z-logo-u.gif"
100100
modes="run, debug"
101101
class="net.sf.j2s.ui.launching.J2SUnitLaunchShortcut"
102102
id="net.sf.j2s.debug.ui.localJ2SJUnitShortcut">
@@ -201,7 +201,7 @@
201201
icon="icons/z-logo.gif"
202202
id="net.sf.j2s.ui.launching.launchConfigurationTypeImage.j2sApplication"/>
203203
<launchConfigurationTypeImage
204-
icon="icons/z-logo.gif"
204+
icon="icons/z-logo-u.gif"
205205
configTypeID="net.sf.j2s.ui.launching.j2sUnit"
206206
id="net.sf.j2s.ui.launching.launchConfigurationTypeImage.j2sUnit"/>
207207
</extension>

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

Lines changed: 116 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
importjava.util.Iterator;
1010
importjava.util.List;
1111
importjava.util.Properties;
12+
importnet.sf.j2s.ui.launching.J2SCyclicProjectUtils;
1213

1314

1415
publicclassCompositeResourcesextendsResourceimplementsIClasspathContainer {
@@ -21,7 +22,7 @@ public class CompositeResources extends Resource implements IClasspathContainer
2122

2223
publicFilegetAbsoluteFile() {
2324
if (getRelativePath().startsWith("/")) {
24-
returnnewFile(getFolder(),".." +getRelativePath());
25+
returnnewFile(getFolder(),getRelativePath());
2526
}else {
2627
returnsuper.getAbsoluteFile();
2728
}
@@ -34,14 +35,14 @@ public String getName() {
3435

3536
publicbooleanexists() {
3637
if (getRelativePath().startsWith("/")) {
37-
returnnewFile(getFolder(),".." +getRelativePath()).exists();
38+
returnnewFile(getFolder(),getRelativePath()).exists();
3839
}else {
3940
returnsuper.exists();
4041
}
4142
}
4243
publicStringgetBinRelativePath() {
4344
if (getRelativePath().startsWith("/")) {
44-
return".." +getRelativePath().substring(0,getRelativePath().lastIndexOf('/') +1);
45+
returngetRelativePath().substring(0,getRelativePath().lastIndexOf('/') +1);
4546
}else {
4647
return"";
4748
//return binRelativePath;
@@ -115,7 +116,7 @@ private void addResourceByString(List resourcesList, String[] reses) {
115116
if (res.startsWith("|")) {
116117
res =res.substring(1);
117118
Resourcerr =null;
118-
if (res.endsWith(".z.js")) {
119+
if (res.endsWith(".z.js") ||res.endsWith(".j2x")) {
119120
rr =newContactedClasses();
120121
}elseif (res.endsWith(".css")) {
121122
rr =newCSSResource();
@@ -129,7 +130,7 @@ private void addResourceByString(List resourcesList, String[] reses) {
129130
rr.setParent(this);
130131
rr.setAbsolute(true);
131132
resourcesList.add(rr);
132-
}elseif (res.endsWith(".z.js")) {
133+
}elseif (res.endsWith(".z.js") ||res.endsWith(".j2x")) {
133134
ContactedClassesjz =newContactedClasses();
134135
jz.setFolder(this.getAbsoluteFolder());
135136
jz.setRelativePath(res);
@@ -151,7 +152,7 @@ private void addResourceByString(List resourcesList, String[] reses) {
151152
resourcesList.add(css);
152153
}elseif (res.endsWith("/.j2s")) {
153154
ProjectResourcesprj =newProjectResources();
154-
prj.setFolder(this.getAbsoluteFolder());
155+
prj.setFolder(this.getAbsoluteFolder().getParentFile());
155156
prj.setRelativePath(res);
156157
prj.setParent(this);
157158
resourcesList.add(prj);
@@ -240,10 +241,119 @@ public String toHTMLString() {
240241
}
241242
for (Iteratoriter =resources.iterator();iter.hasNext();) {
242243
Resourceres = (Resource)iter.next();
244+
if (!J2SCyclicProjectUtils.visit(res)) {
245+
continue;
246+
}
243247
buf.append(res.toHTMLString());
244248
}
245249
returnbuf.toString();
246250
}
251+
252+
publicStringtoJ2XString() {
253+
StringBufferbuf =newStringBuffer();
254+
if (!J2SCyclicProjectUtils.visit(this)) {
255+
returnbuf.toString();
256+
}
257+
if (resources ==null) {
258+
this.load();
259+
}
260+
for (Iteratoriter =resources.iterator();iter.hasNext();) {
261+
Resourceres = (Resource)iter.next();
262+
if (!J2SCyclicProjectUtils.visit(res)) {
263+
continue;
264+
}
265+
if (resinstanceofCompositeResources) {
266+
CompositeResourcesc = (CompositeResources)res;
267+
buf.append(c.toJ2XString());
268+
buf.append(',');
269+
}
270+
}
271+
for (Iteratoriter =resources.iterator();iter.hasNext();) {
272+
Resourceres = (Resource)iter.next();
273+
if (!J2SCyclicProjectUtils.visit(res)) {
274+
continue;
275+
}
276+
if (resinstanceofContactedClasses) {
277+
ContactedClassesunit = (ContactedClasses)res;
278+
buf.append(unit.getAbsoluteFile().getAbsolutePath());
279+
buf.append(',');
280+
}
281+
}
282+
returnbuf.toString();
283+
}
284+
285+
publicStringexistedClassesString() {
286+
StringBufferbuf =newStringBuffer();
287+
if (!J2SCyclicProjectUtils.visit(this)) {
288+
returnbuf.toString();
289+
}
290+
if (resources ==null) {
291+
this.load();
292+
}
293+
buf.append('[');
294+
try {
295+
buf.append(newFile(getAbsoluteFolder(),binRelativePath).getCanonicalPath());
296+
}catch (IOExceptione) {
297+
// TODO Auto-generated catch block
298+
e.printStackTrace();
299+
}
300+
buf.append(']');
301+
buf.append(',');
302+
for (Iteratoriter =resources.iterator();iter.hasNext();) {
303+
Resourceres = (Resource)iter.next();
304+
if (resinstanceofUnitClass) {
305+
if (!J2SCyclicProjectUtils.visit(res)) {
306+
continue;
307+
}
308+
UnitClassunit = (UnitClass)res;
309+
buf.append(unit.getClassName());
310+
buf.append(',');
311+
}
312+
}
313+
for (Iteratoriter =resources.iterator();iter.hasNext();) {
314+
Resourceres = (Resource)iter.next();
315+
if (resinstanceofCompositeResources) {
316+
CompositeResourcesc = (CompositeResources)res;
317+
buf.append(c.existedClassesString());
318+
buf.append(',');
319+
}
320+
}
321+
returnbuf.toString();
322+
}
323+
324+
publicStringignoredClassesString() {
325+
StringBufferbuf =newStringBuffer();
326+
if (!J2SCyclicProjectUtils.visit(this)) {
327+
returnbuf.toString();
328+
}
329+
if (resources ==null) {
330+
this.load();
331+
}
332+
for (Iteratoriter =resources.iterator();iter.hasNext();) {
333+
Resourceres = (Resource)iter.next();
334+
if (!J2SCyclicProjectUtils.visit(res)) {
335+
continue;
336+
}
337+
if (resinstanceofCompositeResources) {
338+
CompositeResourcesc = (CompositeResources)res;
339+
buf.append(c.ignoredClassesString());
340+
buf.append(',');
341+
}
342+
}
343+
for (Iteratoriter =abandonedResources.iterator();iter.hasNext();) {
344+
Resourceres = (Resource)iter.next();
345+
if (!J2SCyclicProjectUtils.visit(res)) {
346+
continue;
347+
}
348+
if (resinstanceofUnitClass) {
349+
UnitClassunit = (UnitClass)res;
350+
buf.append(unit.getClassName());
351+
buf.append(',');
352+
}
353+
}
354+
returnbuf.toString();
355+
}
356+
247357
publicintgetType() {
248358
returnVARIABLE;
249359
}

‎src/net/sf/j2s/ui/classpath/ContactedClasses.java‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
packagenet.sf.j2s.ui.classpath;
22

33
importjava.io.File;
4+
importjava.io.IOException;
45
importjava.util.ArrayList;
56
importjava.util.Iterator;
67
importjava.util.List;
78
importjava.util.Properties;
9+
importnet.sf.j2s.ui.launching.J2SCyclicProjectUtils;
810

911

1012
publicclassContactedClassesextendsResourceimplementsIExternalResource,IClasspathContainer {
@@ -124,6 +126,9 @@ public void setBinRelativePath(String binRelativePath) {
124126
}
125127

126128
publicStringtoHTMLString() {
129+
if (getRelativePath() !=null &&getRelativePath().endsWith(".j2x")) {
130+
return"";
131+
}
127132
Resourcep =this.getParent();
128133
if (p !=null) {
129134
if (pinstanceofContactedClasses) {
@@ -139,6 +144,9 @@ public String toHTMLString() {
139144
}
140145
for (Iteratoriter =externalList.iterator();iter.hasNext();) {
141146
Resourceres = (Resource)iter.next();
147+
if (!J2SCyclicProjectUtils.visit(res)) {
148+
continue;
149+
}
142150
buf.append(res.toHTMLString());
143151
}
144152
buf.append("<script type=\"text/javascript\" src=\"");
@@ -175,6 +183,18 @@ public String toHTMLString() {
175183
buf.append("\"></script>\r\n");
176184
returnbuf.toString();
177185
}
186+
187+
publicStringtoJ2XString() {
188+
if (getName().endsWith(".j2x")) {
189+
try {
190+
returngetAbsoluteFile().getCanonicalPath();
191+
}catch (IOExceptione) {
192+
e.printStackTrace();
193+
}
194+
}
195+
return"";
196+
}
197+
178198
publicintgetType() {
179199
returnCONTAINER;
180200
}

‎src/net/sf/j2s/ui/classpath/ProjectResources.java‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
publicclassProjectResourcesextendsCompositeResources {
88

99
publicFilegetAbsoluteFile() {
10-
returnnewFile(getFolder(),".." +getRelativePath());
10+
returnnewFile(getFolder(),getRelativePath());
1111
}
1212

1313
publicStringgetName() {
@@ -16,10 +16,10 @@ public String getName() {
1616
}
1717

1818
publicbooleanexists() {
19-
returnnewFile(getFolder(),".." +getRelativePath()).exists();
19+
returnnewFile(getFolder(),getRelativePath()).exists();
2020
}
2121
publicStringgetBinRelativePath() {
22-
return".." +getRelativePath().substring(0,getRelativePath().lastIndexOf('/') +1);
22+
returngetRelativePath().substring(0,getRelativePath().lastIndexOf('/') +1);
2323
//return super.getBinRelativePath();
2424
}
2525
publicStringtoHTMLString() {
@@ -36,6 +36,7 @@ public String toHTMLString() {
3636
//return buf.toString();
3737
returnsuper.toHTMLString();
3838
}
39+
3940
publicintgetType() {
4041
returnPROJECT;
4142
}

‎src/net/sf/j2s/ui/classpath/UnitClass.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public boolean exists() {
3636
}
3737
publicStringtoHTMLString() {
3838
Stringbin ="";
39+
// Class unit *.js is loaded by Clazz.load from now on.
40+
if (true)returnbin;
3941
if (this.getParent() !=null
4042
&& (this.getParent()instanceofCompositeResources)) {
4143
CompositeResourcescc = (CompositeResources)this.getParent();
@@ -46,6 +48,7 @@ public String toHTMLString() {
4648
}
4749
returnJ2SLaunchingUtil.wrapTypeJS(getClassName(),bin +getBinRelativePath());
4850
}
51+
4952
publicintgetType() {
5053
returnARCHIVE;
5154
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*******************************************************************************
2+
* Java2Script Pacemaker (http://j2s.sourceforge.net)
3+
*
4+
* Copyright (c) 2006 ognize.com and others.
5+
* All rights reserved. This program and the accompanying materials
6+
* are made available under the terms of the Eclipse Public License v1.0
7+
* which accompanies this distribution, and is available at
8+
* http://www.eclipse.org/legal/epl-v10.html
9+
*
10+
* Contributors:
11+
* ognize.com - initial API and implementation
12+
*******************************************************************************/
13+
14+
packagenet.sf.j2s.ui.launching;
15+
16+
importjava.util.HashSet;
17+
importjava.util.Set;
18+
19+
/**
20+
* @author josson smith
21+
*
22+
* 2006-8-12
23+
*/
24+
publicclassJ2SCyclicProjectUtils {
25+
26+
privatestaticSettracks =newHashSet();
27+
28+
publicstaticvoidemptyTracks() {
29+
tracks.clear();
30+
}
31+
32+
publicstaticbooleanvisit(Objectobj) {
33+
if (tracks.contains(obj)) {
34+
returnfalse;
35+
}
36+
tracks.add(obj);
37+
returntrue;
38+
}
39+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp