Revision 782
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
3 |
|
|
4 |
<modelVersion>4.0.0</modelVersion> |
|
5 |
<artifactId>org.gvsig.scripting.swing</artifactId> |
|
6 |
<packaging>pom</packaging> |
|
7 |
<name>${project.artifactId}</name> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.scripting</artifactId> |
|
11 |
<version>2.3.30</version> |
|
12 |
</parent> |
|
13 |
<modules> |
|
14 |
<module>org.gvsig.scripting.swing.api</module> |
|
15 |
<module>org.gvsig.scripting.swing.impl</module> |
|
16 |
</modules> |
|
17 |
</project> |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/test/resources/README.txt | ||
---|---|---|
1 |
#set( $symbol_pound = '#' ) |
|
2 |
#set( $symbol_dollar = '$' ) |
|
3 |
#set( $symbol_escape = '\' ) |
|
4 |
Put into this folder the resources needed by your test classes. |
|
5 |
|
|
6 |
This folder is added to the Tests classpath, so you can load any resources |
|
7 |
through the ClassLoader. |
|
8 |
|
|
9 |
By default, in this folder you can find an example of log4j configuration, |
|
10 |
prepared to log messages through the console, so logging works when you |
|
11 |
run your tests classes. |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/test/resources/log4j.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> |
|
3 |
|
|
4 |
<!-- |
|
5 |
Log4J configuration file for unit tests execution. |
|
6 |
--> |
|
7 |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> |
|
8 |
|
|
9 |
<!-- Appender configuration to show logging messages through the console --> |
|
10 |
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> |
|
11 |
<layout class="org.apache.log4j.PatternLayout"> |
|
12 |
<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n %m%n" /> |
|
13 |
</layout> |
|
14 |
</appender> |
|
15 |
|
|
16 |
<!-- |
|
17 |
Activate logging messages of DEBUG level of higher only for the |
|
18 |
DefaultExampleManager class. |
|
19 |
You can put full classes names or packages instead, to configure |
|
20 |
logging for all the classes and subpackages of the package. |
|
21 |
--> |
|
22 |
<category name="org.gvsig.scripting.impl.DefaultExampleManager"> |
|
23 |
<priority value="DEBUG" /> |
|
24 |
</category> |
|
25 |
|
|
26 |
<!-- |
|
27 |
By default, show only logging messages of INFO level or higher, |
|
28 |
through the previously configured CONSOLE appender. |
|
29 |
--> |
|
30 |
<root> |
|
31 |
<priority value="INFO" /> |
|
32 |
<appender-ref ref="CONSOLE" /> |
|
33 |
</root> |
|
34 |
</log4j:configuration> |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/test/java/README.txt | ||
---|---|---|
1 |
#set( $symbol_pound = '#' ) |
|
2 |
#set( $symbol_dollar = '$' ) |
|
3 |
#set( $symbol_escape = '\' ) |
|
4 |
For each class you are going to test, create one Test class with the same |
|
5 |
name as the class to test, ending with Test. |
|
6 |
|
|
7 |
For example, the unit tests of the "ExampleLibrary" class are performed |
|
8 |
by the "ExampleLibraryTest" class. |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/test/java/org/gvsig/scripting/MyTestJScriptableThinlet.java | ||
---|---|---|
1 |
package org.gvsig.scripting; |
|
2 |
|
|
3 |
import java.awt.BorderLayout; |
|
4 |
import java.io.File; |
|
5 |
|
|
6 |
import javax.swing.JFrame; |
|
7 |
|
|
8 |
import org.gvsig.scripting.swing.api.JThinlet; |
|
9 |
import org.gvsig.scripting.swing.impl.DefaultJThinlet; |
|
10 |
|
|
11 |
public class MyTestJScriptableThinlet { |
|
12 |
|
|
13 |
public static void main(String[] args) { |
|
14 |
|
|
15 |
// Creamos el JPanel del thinlet y le |
|
16 |
// cargamos el xml de pruebas. |
|
17 |
JThinlet panel = new DefaultJThinlet(new File("/home/jobacas/ScriptFramework/org.gvsig.scripting/src/org/gvsig/scripting/impl/xul/thing.xml")); |
|
18 |
|
|
19 |
JFrame frame = new JFrame("TEST JScriptableThinlet"); |
|
20 |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
21 |
frame.setLayout(new BorderLayout()); |
|
22 |
frame.setSize(500, 400); |
|
23 |
// Añadimos el JPanel del thinlet al frame. |
|
24 |
frame.add(panel, BorderLayout.CENTER); |
|
25 |
//frame.pack(); |
|
26 |
frame.setVisible(true); |
|
27 |
|
|
28 |
} |
|
29 |
} |
|
30 |
|
|
31 |
|
|
32 |
|
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/test/java/org/gvsig/scripting/impl/MyTestDefaultJThinG.java | ||
---|---|---|
1 |
package org.gvsig.scripting.impl; |
|
2 |
|
|
3 |
import java.awt.BorderLayout; |
|
4 |
|
|
5 |
import javax.swing.JFrame; |
|
6 |
|
|
7 |
import org.gvsig.scripting.swing.impl.DefaultJThinG; |
|
8 |
|
|
9 |
public class MyTestDefaultJThinG { |
|
10 |
|
|
11 |
public static void main(String[] args) { |
|
12 |
|
|
13 |
// Creamos el JPanel del thinlet y le |
|
14 |
// cargamos el xml de pruebas. |
|
15 |
DefaultJThinG panel = new DefaultJThinG(); |
|
16 |
|
|
17 |
JFrame frame = new JFrame("TEST JScriptableThinlet"); |
|
18 |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
19 |
frame.setLayout(new BorderLayout()); |
|
20 |
frame.setSize(500, 400); |
|
21 |
// Añadimos el JPanel del thinlet al frame. |
|
22 |
frame.add(panel, BorderLayout.CENTER); |
|
23 |
frame.pack(); |
|
24 |
frame.setVisible(true); |
|
25 |
|
|
26 |
} |
|
27 |
} |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/test/java/org/gvsig/scripting/MyTestJScriptableThinG.java | ||
---|---|---|
1 |
package org.gvsig.scripting; |
|
2 |
|
|
3 |
import java.awt.BorderLayout; |
|
4 |
|
|
5 |
import javax.swing.JFrame; |
|
6 |
|
|
7 |
import org.gvsig.scripting.swing.impl.DefaultJThinG; |
|
8 |
|
|
9 |
public class MyTestJScriptableThinG { |
|
10 |
|
|
11 |
public static void main(String[] args) { |
|
12 |
|
|
13 |
// Creamos el JPanel del thinlet y le |
|
14 |
// cargamos el xml de pruebas. |
|
15 |
DefaultJThinG panel = new DefaultJThinG(); |
|
16 |
|
|
17 |
JFrame frame = new JFrame("TEST JScriptableThinlet"); |
|
18 |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
19 |
frame.setLayout(new BorderLayout()); |
|
20 |
frame.setSize(500, 400); |
|
21 |
// Añadimos el JPanel del thinlet al frame. |
|
22 |
frame.add(panel, BorderLayout.CENTER); |
|
23 |
//frame.pack(); |
|
24 |
frame.setVisible(true); |
|
25 |
|
|
26 |
} |
|
27 |
} |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/test/java/org/gvsig/scripting/MyTestJScriptingBrowser.java | ||
---|---|---|
1 |
package org.gvsig.scripting; |
|
2 |
|
|
3 |
import java.awt.BorderLayout; |
|
4 |
import java.awt.Dimension; |
|
5 |
|
|
6 |
import javax.swing.JFrame; |
|
7 |
import javax.swing.JPanel; |
|
8 |
|
|
9 |
import org.gvsig.scripting.swing.api.ScriptingSwingLocator; |
|
10 |
import org.gvsig.scripting.swing.api.ScriptingUIManager; |
|
11 |
import org.gvsig.scripting.swing.impl.DefaultJScriptingBrowser; |
|
12 |
|
|
13 |
public class MyTestJScriptingBrowser extends JPanel { |
|
14 |
|
|
15 |
/** |
|
16 |
* |
|
17 |
*/ |
|
18 |
private static final long serialVersionUID = 1L; |
|
19 |
private DefaultJScriptingBrowser treePanel; |
|
20 |
|
|
21 |
public MyTestJScriptingBrowser() { |
|
22 |
super(new BorderLayout()); |
|
23 |
|
|
24 |
// Inicializamos las librerías |
|
25 |
ScriptingLibrary lib = new ScriptingLibrary(); |
|
26 |
lib.initialize(); |
|
27 |
|
|
28 |
|
|
29 |
// Asignamos el locator e iniciamos la instancia |
|
30 |
|
|
31 |
ScriptingUIManager uimanager = ScriptingSwingLocator.getUIManager(); |
|
32 |
ScriptingManager manager = uimanager.getManager(); |
|
33 |
treePanel = new DefaultJScriptingBrowser(uimanager, manager.getUserFolder()); |
|
34 |
|
|
35 |
// Establecemos algunas características del JPanel |
|
36 |
treePanel.setPreferredSize(new Dimension(500, 800)); |
|
37 |
add(treePanel, BorderLayout.CENTER); |
|
38 |
; |
|
39 |
} |
|
40 |
|
|
41 |
/** |
|
42 |
* Create the GUI and show it. For thread safety, |
|
43 |
* this method should be invoked from the |
|
44 |
* event-dispatching thread. |
|
45 |
*/ |
|
46 |
private static void createAndShowGUI() { |
|
47 |
//Create and set up the window. |
|
48 |
JFrame frame = new JFrame("TEST ScriptUserBrowser"); |
|
49 |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
50 |
|
|
51 |
//Create and set up the content pane. |
|
52 |
MyTestJScriptingBrowser newContentPane = new MyTestJScriptingBrowser(); |
|
53 |
newContentPane.setOpaque(true); //content panes must be opaque |
|
54 |
frame.getContentPane().add(newContentPane, BorderLayout.CENTER); |
|
55 |
|
|
56 |
//Display the window. |
|
57 |
frame.pack(); |
|
58 |
frame.setVisible(true); |
|
59 |
} |
|
60 |
|
|
61 |
public static void main(String[] args) { |
|
62 |
|
|
63 |
//Iniciamos el test |
|
64 |
javax.swing.SwingUtilities.invokeLater(new Runnable() { |
|
65 |
public void run() { |
|
66 |
createAndShowGUI(); |
|
67 |
} |
|
68 |
}); |
|
69 |
} |
|
70 |
|
|
71 |
} |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/test/java/org/gvsig/scripting/MyTestLauncher.java | ||
---|---|---|
1 |
package org.gvsig.scripting; |
|
2 |
|
|
3 |
import javax.swing.JFrame; |
|
4 |
import javax.swing.JPanel; |
|
5 |
|
|
6 |
|
|
7 |
public class MyTestLauncher extends JPanel { |
|
8 |
|
|
9 |
/** |
|
10 |
* |
|
11 |
*/ |
|
12 |
private static final long serialVersionUID = 1L; |
|
13 |
|
|
14 |
|
|
15 |
public static void main( String args[] ) { |
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
// Inicializamos las librerías |
|
20 |
/* |
|
21 |
ScriptingLibrary lib = new ScriptingLibrary(); |
|
22 |
lib.initialize(); |
|
23 |
|
|
24 |
// Asignamos el locator e iniciamos la instancia |
|
25 |
ScriptingUIManager uimanager = ScriptingLocator.getUIManager(); |
|
26 |
ScriptingManager manager = uimanager.getManager(); |
|
27 |
|
|
28 |
URL u = TestLauncher.class.getClassLoader().getResource("org/gvsig/scripting/impl/scripts/"); |
|
29 |
File f = new File(u.getPath()); |
|
30 |
manager.registerSystemFolder("Tests", f); |
|
31 |
*/ |
|
32 |
|
|
33 |
JFrame frame = new JFrame("TEST Launcher"); |
|
34 |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
35 |
|
|
36 |
//Create and set up the content pane. |
|
37 |
// JScriptingLauncher newContentPane = new JScriptingLauncher(uimanager); |
|
38 |
// newContentPane.setOpaque(true); //content panes must be opaque |
|
39 |
// frame.setContentPane(newContentPane); |
|
40 |
|
|
41 |
//Display the window. |
|
42 |
frame.pack(); |
|
43 |
frame.setSize( 250,400 ); |
|
44 |
frame.setVisible(true); |
|
45 |
|
|
46 |
} |
|
47 |
} |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/test/java/org/gvsig/scripting/TestComposer.java | ||
---|---|---|
1 |
package org.gvsig.scripting; |
|
2 |
|
|
3 |
import javax.swing.JPanel; |
|
4 |
|
|
5 |
import org.gvsig.scripting.swing.api.ScriptingSwingLocator; |
|
6 |
import org.gvsig.scripting.swing.api.ScriptingUIManager; |
|
7 |
|
|
8 |
public class TestComposer extends JPanel { |
|
9 |
|
|
10 |
/** |
|
11 |
* |
|
12 |
*/ |
|
13 |
private static final long serialVersionUID = 1L; |
|
14 |
|
|
15 |
|
|
16 |
public static void main( String args[] ) { |
|
17 |
// Asignamos el locator e iniciamos la instancia |
|
18 |
ScriptingUIManager uimanager = ScriptingSwingLocator.getUIManager(); |
|
19 |
ScriptingManager manager = uimanager.getManager(); |
|
20 |
|
|
21 |
/* URL u = TestLauncher.class.getClassLoader().getResource("org/gvsig/scripting/impl/scripts/"); |
|
22 |
File f = new File(u.getPath()); |
|
23 |
manager.registerSystemFolder("Tests", f); |
|
24 |
*/ |
|
25 |
|
|
26 |
uimanager.createComposer(); |
|
27 |
|
|
28 |
} |
|
29 |
} |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/test/java/org/gvsig/scripting/swing/syntaxhighlight/MyTest.java | ||
---|---|---|
1 |
package org.gvsig.scripting.swing.syntaxhighlight; |
|
2 |
|
|
3 |
import javax.swing.JEditorPane; |
|
4 |
import javax.swing.JFrame; |
|
5 |
import javax.swing.JScrollPane; |
|
6 |
|
|
7 |
|
|
8 |
public class MyTest { |
|
9 |
public static void main(String a[]) |
|
10 |
{ |
|
11 |
|
|
12 |
/* final JEditorPane edit = new JEditorPaneSyntaxHighlighting(); |
|
13 |
edit.setContentType("text/java"); |
|
14 |
|
|
15 |
JFrame frame = new JFrame("Syntax Highlighting"); |
|
16 |
frame.getContentPane().add( new JScrollPane(edit) ); |
|
17 |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
18 |
frame.setSize(800,300); |
|
19 |
frame.setVisible(true);*/ |
|
20 |
} |
|
21 |
} |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/test/java/org/gvsig/scripting/swing/impl/composer/TestJRemoveHelpModel.java | ||
---|---|---|
1 |
package org.gvsig.scripting.swing.impl.composer; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
|
|
5 |
import org.gvsig.scripting.ScriptingLocator; |
|
6 |
import org.gvsig.scripting.ScriptingManager; |
|
7 |
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase; |
|
8 |
|
|
9 |
public class TestJRemoveHelpModel extends AbstractLibraryAutoInitTestCase { |
|
10 |
|
|
11 |
protected ScriptingManager manager; |
|
12 |
protected JMoveScriptModel model; |
|
13 |
|
|
14 |
@Override |
|
15 |
protected void doSetUp() throws Exception { |
|
16 |
manager = ScriptingLocator.getManager(); |
|
17 |
} |
|
18 |
|
|
19 |
public void setWorkingHelpFolder(){ |
|
20 |
File file =new File(this.getClass().getClassLoader().getResource("org/gvsig/scripting/home/help").getFile()); |
|
21 |
// FIXME: hay que sustituirlo por manager.setHomeFolder(home) |
|
22 |
// manager.getHelpManager().setFolder(file.getAbsolutePath()); |
|
23 |
} |
|
24 |
|
|
25 |
public void testMove() { |
|
26 |
setWorkingHelpFolder(); |
|
27 |
|
|
28 |
} |
|
29 |
} |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/test/java/org/gvsig/scripting/swing/impl/composer/TestJRenameModel.java | ||
---|---|---|
1 |
package org.gvsig.scripting.swing.impl.composer; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
|
|
5 |
import junit.framework.Assert; |
|
6 |
|
|
7 |
import org.gvsig.scripting.ScriptingLocator; |
|
8 |
import org.gvsig.scripting.ScriptingManager; |
|
9 |
import org.gvsig.scripting.ScriptingScript; |
|
10 |
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase; |
|
11 |
|
|
12 |
public class TestJRenameModel extends AbstractLibraryAutoInitTestCase { |
|
13 |
|
|
14 |
protected ScriptingManager manager; |
|
15 |
protected JRenameModel model; |
|
16 |
|
|
17 |
@Override |
|
18 |
protected void doSetUp() throws Exception { |
|
19 |
manager = ScriptingLocator.getManager(); |
|
20 |
} |
|
21 |
|
|
22 |
public void setWorkingFolder(){ |
|
23 |
File file =new File(this.getClass().getClassLoader().getResource("org/gvsig/scripting/home").getFile()); |
|
24 |
// FIXME: hay que sustituirlo por manager.setHomeFolder(home) |
|
25 |
// manager.setRootUserFolder(file.getAbsolutePath()); |
|
26 |
} |
|
27 |
|
|
28 |
public File getFile(String name){ |
|
29 |
return new File(manager.getRootUserFolder()+File.separator+name); |
|
30 |
} |
|
31 |
|
|
32 |
public void checkExistsFile(String fName){ |
|
33 |
File fscript = getFile(fName); |
|
34 |
Assert.assertTrue(fscript.exists()); |
|
35 |
} |
|
36 |
|
|
37 |
public void checkDoesntExistFile(String fName){ |
|
38 |
File fscript = getFile(fName); |
|
39 |
Assert.assertFalse(fscript.exists()); |
|
40 |
} |
|
41 |
|
|
42 |
public void testRename() { |
|
43 |
setWorkingFolder(); |
|
44 |
ScriptingScript script = (ScriptingScript) manager.createUnit(ScriptingManager.UNIT_SCRIPT, manager.getUserFolder(), "testScript01"); |
|
45 |
checkExistsFile("testScript01.py"); |
|
46 |
checkExistsFile("testScript01.inf"); |
|
47 |
|
|
48 |
model = new JRenameModel(manager,script); |
|
49 |
model.setNewName("testScript"); |
|
50 |
try { |
|
51 |
model.validate(); |
|
52 |
} catch (Exception e) { |
|
53 |
Assert.fail("The data model is correct. Validation couldn't fail"); |
|
54 |
} |
|
55 |
Assert.assertTrue(script.rename("testScript")); |
|
56 |
|
|
57 |
//Comprobamos que existen los ficheros con el nuevo nombre |
|
58 |
checkExistsFile("testScript.py"); |
|
59 |
checkExistsFile("testScript.inf"); |
|
60 |
|
|
61 |
//Confirmamos que han sido renombrados y no copiados |
|
62 |
checkDoesntExistFile("testScript01.py"); |
|
63 |
checkDoesntExistFile("testScript01.inf"); |
|
64 |
} |
|
65 |
|
|
66 |
public void testRenameSameName() { |
|
67 |
setWorkingFolder(); |
|
68 |
ScriptingScript script1 = (ScriptingScript) manager.createUnit(ScriptingManager.UNIT_SCRIPT, manager.getUserFolder(), "testScript01"); |
|
69 |
ScriptingScript script2 = (ScriptingScript) manager.createUnit(ScriptingManager.UNIT_SCRIPT, manager.getUserFolder(), "testScript02"); |
|
70 |
|
|
71 |
checkExistsFile(script2.getId()+".py"); |
|
72 |
checkExistsFile(script2.getId()+".inf"); |
|
73 |
|
|
74 |
model = new JRenameModel(manager,script1); |
|
75 |
model.setNewName(script2.getId()); |
|
76 |
try { |
|
77 |
model.validate(); |
|
78 |
} catch (Exception e) { |
|
79 |
Assert.assertEquals("This file already exists.\nWrite another name for the script",e.getMessage()); |
|
80 |
} |
|
81 |
Assert.assertFalse(script1.rename(script2.getId())); |
|
82 |
|
|
83 |
} |
|
84 |
|
|
85 |
public void testRenameWithEmptyNewName() { |
|
86 |
setWorkingFolder(); |
|
87 |
ScriptingScript script = (ScriptingScript) manager.createUnit(ScriptingManager.UNIT_SCRIPT, manager.getUserFolder(), "testScript01"); |
|
88 |
checkExistsFile("testScript01.py"); |
|
89 |
checkExistsFile("testScript01.inf"); |
|
90 |
|
|
91 |
model = new JRenameModel(manager,script); |
|
92 |
model.setNewName(""); |
|
93 |
try { |
|
94 |
model.validate(); |
|
95 |
} catch (Exception e) { |
|
96 |
Assert.assertEquals("Name must not be empty.",e.getMessage()); |
|
97 |
} |
|
98 |
|
|
99 |
checkExistsFile("testScript01.py"); |
|
100 |
checkExistsFile("testScript01.inf"); |
|
101 |
} |
|
102 |
} |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/test/java/org/gvsig/scripting/swing/impl/composer/TestJMoveScriptModel.java | ||
---|---|---|
1 |
package org.gvsig.scripting.swing.impl.composer; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
|
|
5 |
import junit.framework.Assert; |
|
6 |
|
|
7 |
import org.gvsig.scripting.ScriptingFolder; |
|
8 |
import org.gvsig.scripting.ScriptingLocator; |
|
9 |
import org.gvsig.scripting.ScriptingManager; |
|
10 |
import org.gvsig.scripting.ScriptingScript; |
|
11 |
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase; |
|
12 |
|
|
13 |
public class TestJMoveScriptModel extends AbstractLibraryAutoInitTestCase { |
|
14 |
|
|
15 |
protected ScriptingManager manager; |
|
16 |
protected JMoveScriptModel model; |
|
17 |
|
|
18 |
@Override |
|
19 |
protected void doSetUp() throws Exception { |
|
20 |
manager = ScriptingLocator.getManager(); |
|
21 |
} |
|
22 |
|
|
23 |
public void setWorkingFolder(){ |
|
24 |
File file =new File(this.getClass().getClassLoader().getResource("org/gvsig/scripting/home").getFile()); |
|
25 |
// FIXME: hay que sustituirlo por manager.setHomeFolder(home) |
|
26 |
// manager.setRootUserFolder(file.getAbsolutePath()); |
|
27 |
} |
|
28 |
|
|
29 |
public void testMove() { |
|
30 |
setWorkingFolder(); |
|
31 |
ScriptingFolder folder = (ScriptingFolder) manager.createUnit(ScriptingManager.UNIT_FOLDER, manager.getUserFolder(), "test"); |
|
32 |
ScriptingScript script = (ScriptingScript) manager.createUnit(ScriptingManager.UNIT_SCRIPT, manager.getUserFolder(), "testScript01"); |
|
33 |
model = new JMoveScriptModel(manager,script); |
|
34 |
model.setMoveTo(folder.getFile()); |
|
35 |
try { |
|
36 |
model.validate(); |
|
37 |
} catch (Exception e) { |
|
38 |
Assert.fail("The data model is correct. Validation couldn't fail"); |
|
39 |
} |
|
40 |
script.move(folder); |
|
41 |
Assert.assertEquals(folder.getFile().getAbsolutePath(), model.getUnit().getParent().getFile().getAbsolutePath()); |
|
42 |
|
|
43 |
} |
|
44 |
|
|
45 |
public void testMoveWithSameName() { |
|
46 |
setWorkingFolder(); |
|
47 |
ScriptingFolder folder = (ScriptingFolder) manager.createUnit(ScriptingManager.UNIT_FOLDER, manager.getUserFolder(), "test"); |
|
48 |
ScriptingScript script1 = (ScriptingScript) manager.createUnit(ScriptingManager.UNIT_SCRIPT, manager.getUserFolder(), "testScript01"); |
|
49 |
manager.createUnit(ScriptingManager.UNIT_SCRIPT, folder, "testScript01"); |
|
50 |
model = new JMoveScriptModel(manager,script1); |
|
51 |
model.setMoveTo(folder.getFile()); |
|
52 |
try { |
|
53 |
model.validate(); |
|
54 |
} catch (Exception e) { |
|
55 |
Assert.assertEquals("This file already exists.\nWrite another name for the script",e.getMessage()); |
|
56 |
} |
|
57 |
Assert.assertFalse(script1.move(folder)); |
|
58 |
} |
|
59 |
|
|
60 |
public void testMoveToAnInvalidDestination() { |
|
61 |
setWorkingFolder(); |
|
62 |
ScriptingScript script = (ScriptingScript) manager.createUnit(ScriptingManager.UNIT_SCRIPT, manager.getUserFolder(), "testScript01"); |
|
63 |
model = new JMoveScriptModel(manager,script); |
|
64 |
|
|
65 |
model.setMoveTo(""); |
|
66 |
try { |
|
67 |
model.validate(); |
|
68 |
} catch (Exception e) { |
|
69 |
Assert.assertEquals("Destination must not be empty.",e.getMessage()); |
|
70 |
} |
|
71 |
|
|
72 |
model.setMoveTo("/not/a/valid/path"); |
|
73 |
try { |
|
74 |
model.validate(); |
|
75 |
} catch (Exception e) { |
|
76 |
Assert.assertEquals("Not a valid destination.",e.getMessage()); |
|
77 |
} |
|
78 |
} |
|
79 |
} |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/test/java/org/gvsig/scripting/swing/impl/composer/TestJNewScriptModel.java | ||
---|---|---|
1 |
package org.gvsig.scripting.swing.impl.composer; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
|
|
5 |
import junit.framework.Assert; |
|
6 |
|
|
7 |
import org.gvsig.scripting.ScriptingFolder; |
|
8 |
import org.gvsig.scripting.ScriptingLocator; |
|
9 |
import org.gvsig.scripting.ScriptingManager; |
|
10 |
import org.gvsig.scripting.ScriptingUnit; |
|
11 |
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase; |
|
12 |
|
|
13 |
public class TestJNewScriptModel extends AbstractLibraryAutoInitTestCase { |
|
14 |
|
|
15 |
protected ScriptingManager manager; |
|
16 |
// protected JNewScriptModel model; |
|
17 |
// protected JNewScriptModel model2; |
|
18 |
// |
|
19 |
@Override |
|
20 |
protected void doSetUp() throws Exception { |
|
21 |
manager = ScriptingLocator.getManager(); |
|
22 |
} |
|
23 |
|
|
24 |
// public void setWorkingFolder(){ |
|
25 |
// File file =new File(this.getClass().getClassLoader().getResource("org/gvsig/scripting/home").getFile()); |
|
26 |
// if (!file.exists()) { |
|
27 |
// file.mkdir(); |
|
28 |
// } |
|
29 |
//// FIXME: hay que sustituirlo por manager.setHomeFolder(home) |
|
30 |
//// manager.setRootUserFolder(file.getAbsolutePath()); |
|
31 |
// } |
|
32 |
// |
|
33 |
// public void testCreate(){ |
|
34 |
// setWorkingFolder(); |
|
35 |
// model.setType(ScriptingManager.UNIT_SCRIPT); |
|
36 |
// model.setName("TestScript01"); |
|
37 |
// model.setDescription("Test Script 01"); |
|
38 |
// model.setCreatedBy("Anonymus"); |
|
39 |
// model.setVersion("v0.1"); |
|
40 |
// model.setPath(manager.getRootUserFolder()); |
|
41 |
// try { |
|
42 |
// model.validate(); |
|
43 |
// } catch (Exception e) { |
|
44 |
// Assert.fail("The data model is correct. Validation couldn't fail"); |
|
45 |
// } |
|
46 |
// } |
|
47 |
// |
|
48 |
// public void testCreateWithEmptyName() { |
|
49 |
// testCreate(); |
|
50 |
// model.setType(ScriptingManager.UNIT_SCRIPT); |
|
51 |
// model.setName(""); |
|
52 |
// model.setDescription("Test Script 01"); |
|
53 |
// model.setCreatedBy("Anonymus"); |
|
54 |
// model.setVersion("v0.1"); |
|
55 |
// model.setPath(manager.getRootUserFolder()); |
|
56 |
// try { |
|
57 |
// model.validate(); |
|
58 |
// } catch (Exception e) { |
|
59 |
// Assert.assertEquals(e.getMessage(), "Name must not be empty."); |
|
60 |
// } |
|
61 |
// } |
|
62 |
// |
|
63 |
// public void testCreateWithSameName() { |
|
64 |
// testCreate(); |
|
65 |
// this.manager.createUnit( |
|
66 |
// model.getType(), |
|
67 |
// manager.getFolder(new File(model.getPath())), |
|
68 |
// model.getName()+model.getExtension() |
|
69 |
// ); |
|
70 |
// |
|
71 |
// model.setType(ScriptingManager.UNIT_SCRIPT); |
|
72 |
// model.setName("TestScript01"); |
|
73 |
// model.setDescription("Test Script 01"); |
|
74 |
// model.setCreatedBy("Anonymus"); |
|
75 |
// model.setVersion("v0.1"); |
|
76 |
// model.setPath(manager.getRootUserFolder()); |
|
77 |
// try { |
|
78 |
// model.validate(); |
|
79 |
// } catch (Exception e) { |
|
80 |
// Assert.assertEquals(e.getMessage(), "This file already exists.\nWrite another name for the script"); |
|
81 |
// |
|
82 |
// } |
|
83 |
// ScriptingUnit newFolder= this.manager.createUnit( |
|
84 |
// ScriptingManager.UNIT_FOLDER, |
|
85 |
// manager.getFolder(new File(model.getPath())), |
|
86 |
// "scripts" |
|
87 |
// ); |
|
88 |
// model.setPath(((ScriptingFolder) newFolder).getPath()); |
|
89 |
// try { |
|
90 |
// model.validate(); |
|
91 |
// } catch (Exception e) { |
|
92 |
// Assert.fail("The data model is correct. Validation couldn't fail"); |
|
93 |
// } |
|
94 |
// |
|
95 |
// } |
|
96 |
// |
|
97 |
// public void testCreateProjects() { |
|
98 |
// testCreate(); |
|
99 |
// |
|
100 |
// model.setType(ScriptingManager.UNIT_PROJECT); |
|
101 |
// model.setName("TestScript01"); |
|
102 |
// model.setDescription("Test Script 01"); |
|
103 |
// model.setCreatedBy("Anonymus"); |
|
104 |
// model.setVersion("v0.1"); |
|
105 |
// model.setPath(manager.getRootUserFolder()); |
|
106 |
// try { |
|
107 |
// model.validate(); |
|
108 |
// } catch (Exception e) { |
|
109 |
// Assert.assertEquals(e.getMessage(), "Projects will be supported in future versions"); |
|
110 |
// |
|
111 |
// } |
|
112 |
// } |
|
113 |
|
|
114 |
} |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/javadoc/overview.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 |
<head> |
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
6 |
<title>org.gvsig.scripting package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>TODO: Example library overview.</p> |
|
11 |
|
|
12 |
<p>See the <a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#overviewcomment">Javadoc Tool documentation about the overview file</a></p> |
|
13 |
|
|
14 |
</body> |
|
15 |
</html> |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/resources/overview.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 |
<head> |
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
6 |
<title>org.gvsig.scripting package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>TODO: Example library overview.</p> |
|
11 |
|
|
12 |
<p>See the <a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#overviewcomment">Javadoc Tool documentation about the overview file</a></p> |
|
13 |
|
|
14 |
</body> |
|
15 |
</html> |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/resources/README.txt | ||
---|---|---|
1 |
Put into this folder the resources needed by your library classes. |
|
2 |
|
|
3 |
This folder is added to the runtime classpath, so you can load any resources |
|
4 |
through the ClassLoader. |
|
5 |
|
|
6 |
By default, into this folder you can find some examples of resource bundle |
|
7 |
property files that may be used by your library classes. |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.scripting.swing.impl.ScriptingSwingDefaultSwingLibrary |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/resources/org/gvsig/scripting/swing/impl/componentchooser.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<!-- jEdit settings: :tabSize=4:indentSize=4:noTabs=true:folding=explicit:collapseFolds=1: --> |
|
3 |
|
|
4 |
<panel bottom="12" columns="1" left="12" right="12" top="12" weightx="1" weighty="1"> |
|
5 |
<list colspan="2" name="list" line="false" weightx="1" weighty="1" action="selectionChanged(this, lSelected)" perform="close()"/> |
|
6 |
<panel gap="6" top="12" weightx="1"> |
|
7 |
<label text="Selected:"/> |
|
8 |
<label name="lSelected" text="null"/> |
|
9 |
<panel weightx="1"/> |
|
10 |
<button name="bOk" text="Ok" icon="icons/ok.gif" mnemonic="0" type="default" action="ok()"/> |
|
11 |
<button name="bCancel" text="Cancel" icon="icons/cancel.gif" mnemonic="0" type="cancel" action="close()"/> |
|
12 |
</panel> |
|
13 |
</panel> |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/resources/org/gvsig/scripting/swing/impl/thing.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<!-- jEdit settings: :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: --> |
|
3 |
|
|
4 |
<panel columns="1" gap="4"> |
|
5 |
|
|
6 |
<menubar weightx="1"> |
|
7 |
<menu text="File" mnemonic="0"> |
|
8 |
<menuitem text="New" mnemonic="0" icon="icons/empty_menu.gif" accelerator="ctrl N" action="menu_file_new()"/> |
|
9 |
<menuitem text="Open..." mnemonic="0" icon="icons/empty_menu.gif" accelerator="ctrl O" action="menu_file_open()"/> |
|
10 |
<separator/> |
|
11 |
<menuitem text="Reload" mnemonic="0" icon="icons/empty_menu.gif" accelerator="ctrl R" action="menu_file_reload()"/> |
|
12 |
<separator/> |
|
13 |
<menuitem text="Save" mnemonic="0" icon="icons/empty_menu.gif" accelerator="ctrl S" action="menu_file_save()"/> |
|
14 |
<menuitem text="Save As..." mnemonic="5" icon="icons/empty_menu.gif" action="menu_file_save_as()"/> |
|
15 |
<separator/> |
|
16 |
<menuitem text="Exit" mnemonic="0" icon="icons/empty_menu.gif" accelerator="alt F4" action="menu_file_exit()"/> |
|
17 |
</menu> |
|
18 |
<menu text="Edit" mnemonic="0"> |
|
19 |
<menuitem text="Cut" name="menu_edit_cut" mnemonic="0" accelerator="ctrl X" icon="icons/edit_cut.gif" action="menu_edit_cut()"/> |
|
20 |
<menuitem text="Copy" name="menu_edit_copy" mnemonic="1" accelerator="ctrl C" icon="icons/edit_copy.gif" action="menu_edit_copy()"/> |
|
21 |
<menuitem text="Paste" name="menu_edit_paste" mnemonic="0" accelerator="ctrl V" icon="icons/edit_paste.gif" action="menu_edit_paste()"/> |
|
22 |
<menuitem text="Paste from system clipboard" name="menu_edit_paste_systemcb" mnemonic="1" accelerator="ctrl shift V" icon="icons/empty_menu.gif" action="menu_edit_paste_systemcb()"/> |
|
23 |
<menuitem text="Delete" name="menu_edit_delete" mnemonic="0" icon="icons/edit_delete.gif" action="menu_edit_delete()"/> |
|
24 |
<separator/> |
|
25 |
<menuitem text="Settings..." mnemonic="0" icon="icons/empty_menu.gif" action="menu_edit_settings()"/> |
|
26 |
</menu> |
|
27 |
<menu text="Tools" mnemonic="0"> |
|
28 |
<menuitem text="Generate Handler Stub Source..." name="menu_tools_generate" mnemonic="0" accelerator="ctrl G" icon="icons/empty_menu.gif" action="menu_tools_generate()"/> |
|
29 |
</menu> |
|
30 |
<menu text="Help" mnemonic="0"> |
|
31 |
<menuitem text="About Thing..." mnemonic="0" icon="icons/thing_small.gif" action="menu_help_about()"/> |
|
32 |
</menu> |
|
33 |
</menubar> |
|
34 |
|
|
35 |
<panel name="toolbar" weightx="1" gap="-1"> |
|
36 |
|
|
37 |
<!-- top level components --> |
|
38 |
<button name="tb_add_panel" property="classname=panel" icon="icons/panel.gif" tooltip="Create new panel" action="addComponent(this)"/> |
|
39 |
<button name="tb_add_dialog" property="classname=dialog" icon="icons/dialog.gif" tooltip="Create new dialog" action="addComponent(this)"/> |
|
40 |
<button name="tb_add_desktop" property="classname=desktop" icon="icons/desktop.gif" tooltip="Create new desktop" action="addComponent(this)"/> |
|
41 |
<button name="tb_add_splitpane" property="classname=splitpane" icon="icons/splitpane.gif" tooltip="Create new splitpane" action="addComponent(this)"/> |
|
42 |
<button name="tb_add_tabbedpane" property="classname=tabbedpane" icon="icons/tabbedpane.gif" tooltip="Create new tabbedpane" action="addComponent(this)"/> |
|
43 |
|
|
44 |
<!-- menu components --> |
|
45 |
<button name="tb_add_menubar" property="classname=menubar" icon="icons/menubar.gif" tooltip="Create new menubar" action="addComponent(this)"/> |
|
46 |
<button name="tb_add_menu" property="classname=menu" icon="icons/menu.gif" tooltip="Create new menu" action="addComponent(this)"/> |
|
47 |
<button name="tb_add_menuitem" property="classname=menuitem" icon="icons/menuitem.gif" tooltip="Create new menuitem" action="addComponent(this)"/> |
|
48 |
<button name="tb_add_checkboxmenuitem" property="classname=checkboxmenuitem" icon="icons/checkboxmenuitem.gif" tooltip="Create new checkboxmenuitem" action="addComponent(this)"/> |
|
49 |
|
|
50 |
<!-- components --> |
|
51 |
<button name="tb_add_label" property="classname=label" icon="icons/label.gif" tooltip="Create new label" action="addComponent(this)"/> |
|
52 |
<button name="tb_add_button" property="classname=button" icon="icons/button.gif" tooltip="Create new button" action="addComponent(this)"/> |
|
53 |
<button name="tb_add_togglebutton" property="classname=togglebutton" icon="icons/togglebutton.gif" tooltip="Create new togglebutton" action="addComponent(this)"/> |
|
54 |
<button name="tb_add_checkbox" property="classname=checkbox" icon="icons/checkbox.gif" tooltip="Create new checkbox" action="addComponent(this)"/> |
|
55 |
<button name="tb_add_textfield" property="classname=textfield" icon="icons/textfield.gif" tooltip="Create new textfield" action="addComponent(this)"/> |
|
56 |
<button name="tb_add_combobox" property="classname=combobox" icon="icons/combobox.gif" tooltip="Create new combobox" action="addComponent(this)"/> |
|
57 |
<button name="tb_add_passwordfield" property="classname=passwordfield" icon="icons/passwordfield.gif" tooltip="Create new passwordfield" action="addComponent(this)"/> |
|
58 |
<button name="tb_add_spinbox" property="classname=spinbox" icon="icons/spinbox.gif" tooltip="Create new spinbox" action="addComponent(this)"/> |
|
59 |
<button name="tb_add_progressbar" property="classname=progressbar" icon="icons/progressbar.gif" tooltip="Create new progressbar" action="addComponent(this)"/> |
|
60 |
<button name="tb_add_slider" property="classname=slider" icon="icons/slider.gif" tooltip="Create new slider" action="addComponent(this)"/> |
|
61 |
<button name="tb_add_separator" property="classname=separator" icon="icons/separator.gif" tooltip="Create new separator" action="addComponent(this)"/> |
|
62 |
<button name="tb_add_list" property="classname=list" icon="icons/list.gif" tooltip="Create new list" action="addComponent(this)"/> |
|
63 |
<button name="tb_add_table" property="classname=table" icon="icons/table.gif" tooltip="Create new table" action="addComponent(this)"/> |
|
64 |
<button name="tb_add_textarea" property="classname=textarea" icon="icons/textarea.gif" tooltip="Create new textarea" action="addComponent(this)"/> |
|
65 |
<button name="tb_add_tree" property="classname=tree" icon="icons/tree.gif" tooltip="Create new tree" action="addComponent(this)"/> |
|
66 |
|
|
67 |
<!-- list items --> |
|
68 |
<button name="tb_add_choice" property="classname=choice" icon="icons/choice.gif" tooltip="Create new choice" action="addComponent(this)"/> |
|
69 |
<button name="tb_add_item" property="classname=item" icon="icons/item.gif" tooltip="Create new item" action="addComponent(this)"/> |
|
70 |
<button name="tb_add_node" property="classname=node" icon="icons/node.gif" tooltip="Create new node" action="addComponent(this)"/> |
|
71 |
<button name="tb_add_tab" property="classname=tab" icon="icons/tab.gif" tooltip="Create new tab" action="addComponent(this)"/> |
|
72 |
|
|
73 |
<!-- table components --> |
|
74 |
<button name="tb_add_row" property="classname=row" icon="icons/row.gif" tooltip="Create new row" action="addComponent(this)"/> |
|
75 |
<button name="tb_add_cell" property="classname=cell" icon="icons/cell.gif" tooltip="Create new cell" action="addComponent(this)"/> |
|
76 |
<button name="tb_add_header" property="classname=header" icon="icons/header.gif" tooltip="Create new header" action="addComponent(this)"/> |
|
77 |
<button name="tb_add_column" property="classname=column" icon="icons/column.gif" tooltip="Create new column" action="addComponent(this)"/> |
|
78 |
|
|
79 |
<!-- other --> |
|
80 |
<button name="tb_add_popupmenu" property="classname=popupmenu" icon="icons/popupmenu.gif" tooltip="Create new popupmenu" action="addComponent(this)"/> |
|
81 |
|
|
82 |
<!-- later --> |
|
83 |
<!-- |
|
84 |
<button name="tb_add_bean" property="classname=bean" icon="icons/bean.gif" tooltip="Create new bean" action="addComponent(this)" enabled="false"/> |
|
85 |
--> |
|
86 |
|
|
87 |
<!-- placeholder in case there are no buttons add all --> |
|
88 |
<separator height="30" width="1"/> |
|
89 |
</panel> |
|
90 |
|
|
91 |
<!-- main workarea --> |
|
92 |
<panel left="4" right="4" weightx="1" weighty="1"> |
|
93 |
<splitpane orientation="horizontal" divider="200" weightx="1" weighty="1"> |
|
94 |
|
|
95 |
<!-- left splitpane: component tree and properties table --> |
|
96 |
<splitpane orientation="vertical"> |
|
97 |
<panel columns="1" weightx="1" weighty="1"> |
|
98 |
<tree name="tree" angle="true" line="false" selection="single" weightx="1" weighty="1" action="treeSelectionChanged()"/> |
|
99 |
<panel top="3" bottom="3" gap="2" scrollable="true"> |
|
100 |
<button name="tb_edit_copy" icon="icons/edit_copy.gif" tooltip="Copy selected component to internal ThinG clipboard and system clipboard" action="menu_edit_copy()"/> |
|
101 |
<button name="tb_edit_cut" icon="icons/edit_cut.gif" tooltip="Cut selected component to internal ThinG clipboard and system clipboard" action="menu_edit_cut()"/> |
|
102 |
<button name="tb_edit_paste" icon="icons/edit_paste.gif" tooltip="Paste component from internal ThinG clipboard below selected component" action="menu_edit_paste()"/> |
|
103 |
<button name="tb_edit_delete" icon="icons/edit_delete.gif" tooltip="Remove selected component" action="menu_edit_delete()"/> |
|
104 |
<separator/> |
|
105 |
<button name="tb_edit_moveup" icon="icons/edit_moveup.gif" tooltip="Move selected component up" action="moveComponentUp()"/> |
|
106 |
<button name="tb_edit_movedown" icon="icons/edit_movedown.gif" tooltip="Move selected component down" action="moveComponentDown()"/> |
|
107 |
</panel> |
|
108 |
</panel> |
|
109 |
<panel columns="1" gap="5"> |
|
110 |
<table name="props" selection="single" weightx="1" weighty="1" action="tableSelectionChanged()"> |
|
111 |
<header> |
|
112 |
<column name="props_key" text="Property" width="80" sort="ascent"/> |
|
113 |
<column name="props_value" text="Value"/> |
|
114 |
</header> |
|
115 |
</table> |
|
116 |
<panel name="propedit" columns="3" gap="5" weightx="1" border="true" top="5" left="5" bottom="5" right="5"> |
|
117 |
<label name="propedit_name" text=""/> |
|
118 |
<panel name="propedit_panel" gap="5" weightx="1"/> |
|
119 |
<button name="propedit_reset" text="Reset" tooltip="Reset to default value" font="10" valign="center" enabled="false" action="propEditReset()"/> |
|
120 |
</panel> |
|
121 |
</panel> |
|
122 |
</splitpane> |
|
123 |
|
|
124 |
<!-- right splitpane: preview panel --> |
|
125 |
<tabbedpane name="tabs" placement="top" selected="1" action="tabSelected(this.selected)"> |
|
126 |
<!-- Attention: because of an obscure bug in Thinlet.getNextFocusable(), --> |
|
127 |
<!-- the tab "XML" must be the first one! If it is not the first panel, Thinlet --> |
|
128 |
<!-- runs into an endless loop when the user navigates from the "Preview" tab --> |
|
129 |
<!-- to the "XML" tab, trying to set the next focusable component. --> |
|
130 |
<tab text="XML" mnemonic="0"> |
|
131 |
<panel weightx="1" weighty="1"> |
|
132 |
<textarea name="serialize" editable="false" weightx="1" weighty="1"/> |
|
133 |
</panel> |
|
134 |
</tab> |
|
135 |
<tab text="Preview" mnemonic="0"> |
|
136 |
<panel name="preview" border="true" scrollable="true" weightx="1" weighty="1"/> |
|
137 |
</tab> |
|
138 |
</tabbedpane> |
|
139 |
|
|
140 |
</splitpane> |
|
141 |
</panel> |
|
142 |
|
|
143 |
<!-- status bar at bottom --> |
|
144 |
<textfield name="statusbar" editable="false" text="ThinG" weightx="1"/> |
|
145 |
|
|
146 |
</panel> |
org.gvsig.scripting/tags/org.gvsig.scripting-2.3.30/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/resources/org/gvsig/scripting/swing/impl/generate.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<!-- jEdit settings: :tabSize=4:indentSize=4:noTabs=true:folding=explicit:collapseFolds=1: --> |
|
3 |
|
|
4 |
<panel columns="1" |
|
5 |
bottom="12" left="12" right="12" top="12" gap="12" |
|
6 |
init="init(cbGenerateInterface, cbGenerateHandler, cbGenerateAsThinlet, cbGenerateMain, tInterfaceName, tHandlerName, tPackageName, tOutputDir, tPreview, bOk)" |
|
7 |
weightx="1" weighty="1" |
|
8 |
> |
|
9 |
<panel border="true" bottom="6" columns="3" font=" bold" gap="6" left="6" right="6" text="Generate" top="6" weightx="1"> |
|
10 |
<checkbox action="checkboxChanged(this)" mnemonic="0" name="cbGenerateInterface" text="Interface for Handler class" weightx="1"/> |
|
11 |
<label for="tInterfaceName" mnemonic="1" text="Interface Name:"/> |
|
12 |
<textfield perform="textfieldChanged(this)" name="tInterfaceName" weightx="4"/> |
|
13 |
<checkbox action="checkboxChanged(this)" mnemonic="0" name="cbGenerateHandler" selected="true" text="Handler class" weightx="1"/> |
|
14 |
<label for="tHandlerName" mnemonic="1" text="Class Name:"/> |
|
15 |
<textfield perform="textfieldChanged(this)" name="tHandlerName" weightx="4"/> |
|
16 |
<panel/> |
|
17 |
<label for="tPackageName" mnemonic="0" text="Package Name:"/> |
|
18 |
<textfield perform="textfieldChanged(this)" name="tPackageName" weightx="4"/> |
|
19 |
<panel colspan="3" gap="6" weightx="1"> |
|
20 |
<label for="tOutputDir" mnemonic="7" text="Output Directory:"/> |
|
21 |
<textfield name="tOutputDir" weightx="1"/> |
|
22 |
<button action="buttonOutputDirClicked()" text="..." tooltip="Select Output Directory"/> |
|
23 |
</panel> |
|
24 |
</panel> |
|
25 |
<panel border="true" bottom="6" columns="1" font=" bold" gap="6" left="6" right="6" text="Handler Options" top="6"> |
|
26 |
<checkbox action="checkboxChanged(this)" mnemonic="13" name="cbGenerateAsThinlet" text="Handler is a Thinlet"/> |
|
27 |
<checkbox action="checkboxChanged(this)" mnemonic="9" name="cbGenerateMain" text="Generate main()"/> |
|
28 |
</panel> |
|
29 |
<panel border="true" bottom="6" font=" bold" gap="6" left="6" right="6" text="Preview" top="6" weightx="1" weighty="1"> |
|
30 |
<textarea editable="false" font="Monospaced 11" name="tPreview" weightx="1" weighty="1"/> |
|
31 |
</panel> |
|
32 |
<panel gap="6" halign="right" weightx="1"> |
|
33 |
<button action="ok()" icon="icons/ok.gif" mnemonic="0" name="bOk" text="Ok" valign="bottom" weighty="1"/> |
|
34 |
<button action="close()" icon="icons/cancel.gif" mnemonic="0" name="bCancel" text="Cancel" type="cancel" valign="bottom" weighty="1"/> |
|
35 |
</panel> |
|
36 |
</panel> |
Also available in: Unified diff