wip commit with working vasc demo tech
This commit is contained in:
parent
a25e98f5d5
commit
c23d14522f
100 changed files with 4356 additions and 1220 deletions
10
vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.classpath
Normal file
10
vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.classpath
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
23
vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.project
Normal file
23
vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.project
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>vasc-demo-tech-ui</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding//src/test/java=UTF-8
|
||||
encoding//src/test/resources=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
80
vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/pom.xml
Normal file
80
vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/pom.xml
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
<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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>vasc-demo-tech</artifactId>
|
||||
<groupId>net.forwardfire.vasc.demo</groupId>
|
||||
<version>0.3.5-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>vasc-demo-tech-ui</artifactId>
|
||||
<name>vasc-demo-tech-ui</name>
|
||||
<description>vasc-demo-tech-ui</description>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc.demo</groupId>
|
||||
<artifactId>vasc-demo-tech-editor</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc.demo</groupId>
|
||||
<artifactId>vasc-demo-tech-web</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-frontend-swing</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-backend-ldap</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-backend-mongodb</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-backend-metamodel</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-backend-jdbc</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jdesktop.bsaf</groupId>
|
||||
<artifactId>bsaf</artifactId>
|
||||
<version>${bsaf.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>jnlp</artifactId>
|
||||
<groupId>javax.jnlp</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>9.1-901.jdbc4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-jdk14</artifactId>
|
||||
<version>1.6.4</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
/*
|
||||
* Copyright (c) 2011, Willem Cazander
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.forwardfire.vasc.demo.tech.ui;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.text.DateFormat;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.logging.Formatter;
|
||||
import java.util.logging.LogManager;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
/**
|
||||
* PatternLogFormatter Formats the messages of the logger.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
*/
|
||||
public class PatternLogFormatter extends Formatter {
|
||||
|
||||
private final String lineSeperator;
|
||||
private final MessageFormat logFormat;
|
||||
private final MessageFormat logErrorFormat;
|
||||
private final DateFormat dateFormat;
|
||||
static private final String DEFAULT_LOG_FORMAT = "%d %l [%C.%s] %m%r";
|
||||
static private final String DEFAULT_LOG_ERROR_FORMAT = "%d %l [%C.%s] %m%r%S";
|
||||
static private final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
static private final String[] LOG_OPTIONS = {
|
||||
"%d", /* Formated date string */
|
||||
"%l", /* Logger level */
|
||||
"%n", /* Logger name */
|
||||
"%m", /* Logger message */
|
||||
"%t", /* Thread ID */
|
||||
"%s", /* Source method */
|
||||
"%c", /* Source Class */
|
||||
"%C", /* Source Class Simple */
|
||||
"%S", /* Stacktrace */
|
||||
"%r", /* Return/newline */
|
||||
};
|
||||
|
||||
public PatternLogFormatter() {
|
||||
String logFormatStr = LogManager.getLogManager().getProperty(getClass().getName()+".log_pattern");
|
||||
String logFormatErrorStr = LogManager.getLogManager().getProperty(getClass().getName()+".log_error_pattern");
|
||||
String logDateStr = LogManager.getLogManager().getProperty(getClass().getName()+".date_pattern");
|
||||
|
||||
if (logDateStr!=null && logDateStr.isEmpty()==false) {
|
||||
dateFormat = new SimpleDateFormat(logDateStr);
|
||||
} else {
|
||||
dateFormat = new SimpleDateFormat(DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
|
||||
if (logFormatStr==null || logFormatStr.isEmpty()) {
|
||||
logFormatStr = DEFAULT_LOG_FORMAT;
|
||||
}
|
||||
if (logFormatStr.contains("{") || logFormatStr.contains("}")) {
|
||||
throw new IllegalArgumentException("Curly braces not allowed in log pattern.");
|
||||
}
|
||||
for (int i=0;i<LOG_OPTIONS.length;i++) {
|
||||
logFormatStr = logFormatStr.replace(LOG_OPTIONS[i], "{"+i+"}");
|
||||
}
|
||||
logFormat = new MessageFormat(logFormatStr);
|
||||
|
||||
if (logFormatErrorStr==null || logFormatErrorStr.isEmpty()) {
|
||||
logFormatErrorStr = DEFAULT_LOG_ERROR_FORMAT;
|
||||
}
|
||||
if (logFormatErrorStr.contains("{") || logFormatErrorStr.contains("}")) {
|
||||
throw new IllegalArgumentException("Curly braces not allowed in log pattern.");
|
||||
}
|
||||
for (int i=0;i<LOG_OPTIONS.length;i++) {
|
||||
logFormatErrorStr = logFormatErrorStr.replace(LOG_OPTIONS[i], "{"+i+"}");
|
||||
}
|
||||
logErrorFormat = new MessageFormat(logFormatErrorStr);
|
||||
|
||||
lineSeperator = String.format("%n"); // Used platform dependent seperator
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(LogRecord record) {
|
||||
String[] logFields = new String[10];
|
||||
logFields[1] = record.getLevel().toString();
|
||||
logFields[2] = record.getLoggerName();
|
||||
logFields[3] = record.getMessage();
|
||||
if ((logFields[3] == null || logFields[3].isEmpty()) && record.getThrown()!=null) {
|
||||
logFields[3] = record.getThrown().getMessage();
|
||||
}
|
||||
logFields[4] = Integer.toString(record.getThreadID());
|
||||
logFields[5] = record.getSourceMethodName() != null ? record.getSourceMethodName() : "?";
|
||||
logFields[6] = record.getSourceClassName() != null ? record.getSourceClassName() : "?";
|
||||
int dotIdx = logFields[6].lastIndexOf(".") + 1;
|
||||
if (dotIdx > 0 && dotIdx < logFields[6].length()) {
|
||||
logFields[7] = logFields[6].substring(dotIdx);
|
||||
} else {
|
||||
logFields[7] = logFields[6];
|
||||
}
|
||||
logFields[8] = record.getThrown()!=null ? createStackTrace(record.getThrown()) : "";
|
||||
logFields[9] = lineSeperator;
|
||||
synchronized (logFormat) {
|
||||
logFields[0] = dateFormat.format(new Date(record.getMillis())); // dateFormat is guarded by the logFormat lock.
|
||||
if (record.getThrown()==null) {
|
||||
return logFormat.format(logFields);
|
||||
} else {
|
||||
return logErrorFormat.format(logFields);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String createStackTrace(Throwable t) {
|
||||
StringWriter buf = new StringWriter();
|
||||
t.printStackTrace(new PrintWriter(buf));
|
||||
return buf.getBuffer().toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,187 @@
|
|||
/*
|
||||
* Copyright 2007-2012 forwardfire.net All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.forwardfire.vasc.demo.tech.ui;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.EventObject;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.LogManager;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import org.apache.juli.logging.LogFactory;
|
||||
import org.jdesktop.application.Application;
|
||||
import org.jdesktop.application.FrameView;
|
||||
import org.jdesktop.application.SingleFrameApplication;
|
||||
|
||||
import net.forwardfire.vasc.demo.tech.ui.components.JMainPanel;
|
||||
import net.forwardfire.vasc.demo.tech.ui.components.JMainPanelMenuBar;
|
||||
import net.forwardfire.vasc.demo.tech.web.core.TomcatManager;
|
||||
|
||||
public class TechUI extends SingleFrameApplication {
|
||||
|
||||
private Logger logger = null;
|
||||
private VascManager vascManager = null;
|
||||
private TomcatManager tomcatManager = null;
|
||||
|
||||
static public void main(String[] args) {
|
||||
Application.launch(TechUI.class, args);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Config logging and setup logger object.
|
||||
*/
|
||||
private void setupLogging() {
|
||||
|
||||
LogFactory.getLog(TechUI.class); // init JULI so reconfig is done once.
|
||||
|
||||
File logConfig = new File("logfile.properties");
|
||||
if (logConfig.exists()) {
|
||||
InputStream in = null;
|
||||
try {
|
||||
in = new FileInputStream(logConfig);
|
||||
LogManager.getLogManager().readConfiguration(in);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (in!=null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Logger rootLogger = Logger.getAnonymousLogger();
|
||||
while (rootLogger.getParent()!=null) {
|
||||
rootLogger = rootLogger.getParent();
|
||||
}
|
||||
for (Handler h:rootLogger.getHandlers()) {
|
||||
h.setFormatter(new PatternLogFormatter());
|
||||
}
|
||||
}
|
||||
logger = Logger.getLogger(TechUI.class.getName());
|
||||
}
|
||||
|
||||
class ShutdownManager implements ExitListener {
|
||||
public boolean canExit(EventObject e) {
|
||||
return true;
|
||||
}
|
||||
public void willExit(EventObject event) {
|
||||
logger.info("Shutdown requested.");
|
||||
long startTime = System.currentTimeMillis();
|
||||
try {
|
||||
tomcatManager.stop();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
long stopTime = System.currentTimeMillis();
|
||||
logger.info("TechUI stopped in "+(stopTime-startTime)+" ms.");
|
||||
}
|
||||
}
|
||||
|
||||
private void autoLoadVasc() {
|
||||
File autoLoadDir = new File("auto");
|
||||
if (autoLoadDir.exists()==false) {
|
||||
return;
|
||||
}
|
||||
for (File file:autoLoadDir.listFiles()) {
|
||||
if (file.canRead()==false) {
|
||||
continue;
|
||||
}
|
||||
if (file.getName().endsWith("xml")==false) {
|
||||
continue;
|
||||
}
|
||||
vascManager.openFile(file);
|
||||
}
|
||||
}
|
||||
|
||||
protected void initialize(String[] args) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
setupLogging();
|
||||
logger.info("Starting Vasc-Demo-Tech-UI.");
|
||||
vascManager = new VascManager();
|
||||
vascManager.start();
|
||||
autoLoadVasc();
|
||||
|
||||
long stopTime = System.currentTimeMillis();
|
||||
logger.info("TechUI initialized in "+(stopTime-startTime)+" ms.");
|
||||
}
|
||||
|
||||
protected void startup() {
|
||||
try {
|
||||
long startTime = System.currentTimeMillis();
|
||||
addExitListener(new ShutdownManager());
|
||||
|
||||
FrameView mainView = getMainView();
|
||||
mainView.setComponent(new JMainPanel());
|
||||
mainView.setMenuBar(new JMainPanelMenuBar());
|
||||
mainView.getFrame().setMinimumSize(new Dimension(1024-64,768-128));
|
||||
show(mainView);
|
||||
|
||||
tomcatManager = new TomcatManager();
|
||||
tomcatManager.setVascController(vascManager.getVascController());
|
||||
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
tomcatManager.start();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
long stopTime = System.currentTimeMillis();
|
||||
logger.info("TechUI startup in "+(stopTime-startTime)+" ms total startup in "+(stopTime-startTime)+" ms.");
|
||||
} catch (Exception e) {
|
||||
StringWriter sw = new StringWriter();
|
||||
e.printStackTrace(new PrintWriter(sw));
|
||||
JOptionPane.showMessageDialog(null, "Fatal Startup Error:\n"+sw.getBuffer().toString(), "Vasc Demo Tech Startup Error", JOptionPane.ERROR_MESSAGE);
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static public TechUI getInstance() {
|
||||
return getInstance(TechUI.class);
|
||||
}
|
||||
|
||||
public VascManager getVascManager() {
|
||||
return vascManager;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,292 @@
|
|||
package net.forwardfire.vasc.demo.tech.ui;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.eobjects.metamodel.DataContext;
|
||||
import org.eobjects.metamodel.schema.Column;
|
||||
import org.eobjects.metamodel.schema.Relationship;
|
||||
import org.eobjects.metamodel.schema.Table;
|
||||
|
||||
import net.forwardfire.vasc.backend.VascBackendControllerLocal;
|
||||
import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextProvider;
|
||||
import net.forwardfire.vasc.backend.metamodel.MetaModelVascBackend;
|
||||
import net.forwardfire.vasc.core.VascController;
|
||||
import net.forwardfire.vasc.core.VascEntry;
|
||||
import net.forwardfire.vasc.core.VascEntryControllerLocal;
|
||||
import net.forwardfire.vasc.core.VascEntryField;
|
||||
import net.forwardfire.vasc.core.VascException;
|
||||
import net.forwardfire.vasc.core.VascLinkEntry;
|
||||
import net.forwardfire.vasc.core.VascLinkEntryType;
|
||||
import net.forwardfire.vasc.demo.tech.ui.components.JMainPanel;
|
||||
import net.forwardfire.vasc.impl.DefaultVascEntry;
|
||||
import net.forwardfire.vasc.impl.DefaultVascEntryField;
|
||||
import net.forwardfire.vasc.impl.DefaultVascFactory;
|
||||
import net.forwardfire.vasc.impl.DefaultVascLinkEntry;
|
||||
import net.forwardfire.vasc.impl.ui.VascSelectItemModelEntry;
|
||||
import net.forwardfire.vasc.impl.x4o.VascParser;
|
||||
|
||||
public class VascManager {
|
||||
|
||||
private Logger logger = null;
|
||||
private VascController vascController = null;
|
||||
|
||||
public VascManager() {
|
||||
logger = Logger.getLogger(VascManager.class.getName());
|
||||
}
|
||||
|
||||
public void start() {
|
||||
try {
|
||||
vascController = DefaultVascFactory.getDefaultVascController(2288L,"forwardfire.net","user","admin");
|
||||
initEditor();
|
||||
} catch (VascException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
vascController = null;
|
||||
logger.info("Stop manager, cleared all.");
|
||||
}
|
||||
|
||||
private void initEditor() {
|
||||
try {
|
||||
VascParser parser = new VascParser(vascController);
|
||||
parser.addGlobalELBean("vascController", vascController);
|
||||
parser.parseResource("net/forwardfire/vasc/editor/vasc-edit.xml");
|
||||
|
||||
DefaultVascFactory.fillVascControllerLocalEntries((VascEntryControllerLocal) vascController.getVascEntryController(), vascController);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void openFile(File file) {
|
||||
try {
|
||||
VascParser parser = new VascParser(vascController);
|
||||
File f = File.createTempFile("test-vasc", ".xml");
|
||||
parser.setDebugOutputStream(new FileOutputStream(f));
|
||||
parser.parseFile(file.getAbsolutePath());
|
||||
|
||||
DefaultVascFactory.fillVascControllerLocalEntries((VascEntryControllerLocal) vascController.getVascEntryController(), vascController);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public VascController getVascController() {
|
||||
return vascController;
|
||||
}
|
||||
|
||||
public void printEntries() {
|
||||
try {
|
||||
for (String key:getVascController().getVascEntryController().getVascEntryIds()) {
|
||||
VascEntry ve = getVascController().getVascEntryController().getVascEntryById(key);
|
||||
printEntry(ve);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void printEntry(VascEntry e) throws Exception {
|
||||
|
||||
System.out.println("");
|
||||
System.out.println("=== Printing entry ===");
|
||||
System.out.println("");
|
||||
|
||||
for (Method m:e.getClass().getMethods()) {
|
||||
if (m.getName().startsWith("get")==false) { //a bit dirty
|
||||
continue;
|
||||
}
|
||||
if (m.getParameterTypes().length>0) {
|
||||
continue;
|
||||
}
|
||||
System.out.println("prop: "+m.getName()+" -> "+m.invoke(e));
|
||||
}
|
||||
|
||||
System.out.println("");
|
||||
System.out.println("=== Fields ===");
|
||||
for (VascEntryField vef:e.getVascEntryFields()) {
|
||||
|
||||
System.out.println("=== Field: "+vef.getId());
|
||||
|
||||
for (Method m:vef.getClass().getMethods()) {
|
||||
if (m.getName().startsWith("get")==false) { //a bit dirty
|
||||
continue;
|
||||
}
|
||||
if (m.getParameterTypes().length>0) {
|
||||
continue;
|
||||
}
|
||||
System.out.println("prop: "+m.getName()+" -> "+m.invoke(vef));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void createMetaEntry(MetaModelDataContextProvider ds,String id,String tableName) {
|
||||
logger.info("Creating entry id: "+id+" of table: "+tableName);
|
||||
DataContext metaDs = ds.getDataContext();
|
||||
Table metaTable = null;
|
||||
if (tableName==null) {
|
||||
metaTable = metaDs.getDefaultSchema().getTable(0);
|
||||
} else {
|
||||
metaTable = metaDs.getDefaultSchema().getTableByName(tableName);
|
||||
}
|
||||
Column[] keys = metaTable.getPrimaryKeys();
|
||||
Column[] cols = metaTable.getColumns();
|
||||
if (cols.length==0) {
|
||||
return; // vasc needs at least one column
|
||||
}
|
||||
|
||||
MetaModelVascBackend backend = new MetaModelVascBackend();
|
||||
backend.setId(id+"_backend");
|
||||
backend.setDataContextProvider(ds);
|
||||
backend.setTable(metaTable.getName());
|
||||
if (keys.length>0) {
|
||||
backend.setTableId(keys[0].getName());
|
||||
} else {
|
||||
backend.setTableId(cols[0].getName());
|
||||
//TODO backend.setRequestReadOnly(true);
|
||||
}
|
||||
|
||||
VascEntry ve = new DefaultVascEntry();
|
||||
ve.setId(id);
|
||||
ve.setBackendId(id+"_backend");
|
||||
ve.setPrimaryKeyFieldId(backend.getTableId());
|
||||
createFields(ve,cols);
|
||||
|
||||
for (Relationship rs:metaTable.getRelationships()) {
|
||||
logger.finer("Found relation FT: "+rs.getForeignTable().getName()+" PT: "+rs.getPrimaryTable().getName());
|
||||
if (tableName.equals(rs.getForeignTable().getName())==false) {
|
||||
logger.info("Creating Link entry for: "+rs.getForeignColumns()[0].getName()+" of table: "+rs.getForeignTable().getName());
|
||||
createLinkEntry(ds,rs,ve,metaTable,id+"_"+rs.getForeignTable().getName()+"_"+rs.getForeignColumns()[0].getName()+"_link");
|
||||
} else {
|
||||
logger.info("Creating List entry for: "+rs.getPrimaryColumns()[0].getName()+" of table: "+rs.getPrimaryTable().getName());
|
||||
createListEntry(ds,rs,ve,metaTable,id+"_"+rs.getPrimaryTable().getName()+"_"+rs.getPrimaryColumns()[0].getName()+"_list");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
((VascBackendControllerLocal)getVascController().getVascBackendController()).addVascBackend(backend);
|
||||
((VascEntryControllerLocal)getVascController().getVascEntryController()).addVascEntry(ve, getVascController());
|
||||
|
||||
// mm TODO rm this fill which adds the global actions ... and show updated tree in editor
|
||||
DefaultVascFactory.fillVascControllerLocalEntries((VascEntryControllerLocal) getVascController().getVascEntryController(), getVascController());
|
||||
//rebuildTree();
|
||||
((JMainPanel)TechUI.getInstance().getMainView().getComponent()).rebuildTree();
|
||||
} catch (Exception ee) {
|
||||
ee.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void createLinkEntry(MetaModelDataContextProvider ds,Relationship rs2,VascEntry ve,Table metaTable,String id) {
|
||||
MetaModelVascBackend backendLink = new MetaModelVascBackend();
|
||||
backendLink.setId(id+"_backend");
|
||||
backendLink.setDataContextProvider(ds);
|
||||
backendLink.setTable(rs2.getForeignTable().getName());
|
||||
|
||||
Column[] keys = rs2.getForeignTable().getPrimaryKeys();
|
||||
Column[] cols = rs2.getForeignTable().getColumns();
|
||||
if (cols.length==0) {
|
||||
return;
|
||||
}
|
||||
if (keys.length>0) {
|
||||
backendLink.setTableId(keys[0].getName());
|
||||
} else {
|
||||
backendLink.setTableId(cols[0].getName());
|
||||
}
|
||||
|
||||
VascEntry veLink = new DefaultVascEntry();
|
||||
veLink.setId(id);
|
||||
veLink.setBackendId(id+"_backend");
|
||||
veLink.setPrimaryKeyFieldId(backendLink.getTableId());
|
||||
createFields(veLink,cols);
|
||||
|
||||
for (Relationship rs:rs2.getForeignTable().getRelationships()) {
|
||||
logger.finer("Found relation FT: "+rs.getForeignTable().getName()+" PT: "+rs.getPrimaryTable().getName());
|
||||
if (rs2.getForeignTable().getName().equals(rs.getForeignTable().getName())==false) {
|
||||
//logger.info("Creating Link entry for: "+rs.getForeignColumns()[0].getName()+" of table: "+rs.getForeignTable().getName());
|
||||
//createLinkEntry(ds,rs,ve,rs2.getForeignTable(),id+"_"+rs.getForeignTable().getName()+"_"+rs.getForeignColumns()[0].getName()+"_link");
|
||||
} else {
|
||||
logger.info("Creating List entry for: "+rs.getPrimaryColumns()[0].getName()+" of table: "+rs.getPrimaryTable().getName());
|
||||
createListEntry(ds,rs,veLink,rs2.getForeignTable(),id+"_"+rs.getPrimaryTable().getName()+"_"+rs.getPrimaryColumns()[0].getName()+"_list");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
((VascBackendControllerLocal)getVascController().getVascBackendController()).addVascBackend(backendLink);
|
||||
((VascEntryControllerLocal)getVascController().getVascEntryController()).addVascEntry(veLink, getVascController());
|
||||
|
||||
VascLinkEntry vle = new DefaultVascLinkEntry();
|
||||
vle.setId(id+"Link");
|
||||
vle.setVascLinkEntryType(VascLinkEntryType.DEFAULT_TYPE);
|
||||
vle.setVascEntryId(id);
|
||||
vle.addEntryParameterFieldId(rs2.getForeignColumns()[0].getName(), rs2.getPrimaryColumns()[0].getName());
|
||||
|
||||
ve.addVascLinkEntry(vle);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void createListEntry(MetaModelDataContextProvider ds,Relationship rs,VascEntry ve,Table metaTable,String id) {
|
||||
MetaModelVascBackend backendLink = new MetaModelVascBackend();
|
||||
backendLink.setId(id+"_backend");
|
||||
backendLink.setDataContextProvider(ds);
|
||||
backendLink.setTable(rs.getPrimaryTable().getName());
|
||||
|
||||
Column[] keys = rs.getPrimaryTable().getPrimaryKeys();
|
||||
Column[] cols = rs.getPrimaryTable().getColumns();
|
||||
if (cols.length==0) {
|
||||
return;
|
||||
}
|
||||
if (keys.length>0) {
|
||||
backendLink.setTableId(keys[0].getName());
|
||||
} else {
|
||||
backendLink.setTableId(cols[0].getName());
|
||||
}
|
||||
VascEntry veLink = new DefaultVascEntry();
|
||||
veLink.setId(id);
|
||||
veLink.setBackendId(id+"_backend");
|
||||
veLink.setPrimaryKeyFieldId(backendLink.getTableId());
|
||||
createFields(veLink,cols);
|
||||
try {
|
||||
VascEntryField vef = ve.getVascEntryFieldById(rs.getForeignColumns()[0].getName());
|
||||
if (vef==null) {
|
||||
logger.warning("Could not find: "+rs.getForeignColumns()[0].getName()+" in ve: "+ve.getId());
|
||||
return;
|
||||
}
|
||||
vef.setVascEntryFieldType(getVascController().getVascEntryFieldTypeController().getVascEntryFieldTypeById("ListField"));
|
||||
|
||||
VascSelectItemModelEntry itemModel = new VascSelectItemModelEntry();
|
||||
itemModel.setEntryId(veLink.getId());
|
||||
itemModel.setDisplayFieldId(veLink.getDisplayNameFieldId());
|
||||
vef.getVascEntryFieldType().setDataObject(itemModel);
|
||||
|
||||
((VascBackendControllerLocal)getVascController().getVascBackendController()).addVascBackend(backendLink);
|
||||
((VascEntryControllerLocal)getVascController().getVascEntryController()).addVascEntry(veLink, getVascController());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void createFields(VascEntry ve,Column[] cols) {
|
||||
for (Column c:cols) {
|
||||
VascEntryField vef = new DefaultVascEntryField(c.getName());
|
||||
vef.setVascEntryFieldType(getVascController().getVascEntryFieldTypeController().getVascEntryFieldTypeByClass(c.getType().getJavaEquivalentClass()));
|
||||
if (c.getName().toLowerCase().contains("desc") || c.getName().toLowerCase().contains("text")) {
|
||||
vef.setVascEntryFieldType(getVascController().getVascEntryFieldTypeController().getVascEntryFieldTypeById("TextAreaField"));
|
||||
}
|
||||
ve.addVascEntryField(vef);
|
||||
if (ve.getDisplayNameFieldId()==null && c.getName().equals(ve.getPrimaryKeyFieldId())==false && c.getType().getJavaEquivalentClass()==String.class) {
|
||||
ve.setDisplayNameFieldId(c.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package net.forwardfire.vasc.demo.tech.ui.actions;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Frame;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.io.File;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextCsv;
|
||||
import net.forwardfire.vasc.demo.tech.ui.TechUI;
|
||||
|
||||
public class JDialogMetaCsv extends JDialog implements ActionListener {
|
||||
|
||||
private static final long serialVersionUID = -8638394652416472734L;
|
||||
|
||||
public JDialogMetaCsv(Frame aFrame) {
|
||||
setTitle("Add csv file");
|
||||
setMinimumSize(new Dimension(640,480));
|
||||
setPreferredSize(new Dimension(999,666));
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent we) {
|
||||
clearAndHide();
|
||||
}
|
||||
});
|
||||
JPanel mainPanel = new JPanel();
|
||||
mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
|
||||
mainPanel.setLayout(new BorderLayout());
|
||||
//mainPanel.add(createPanelTop(),BorderLayout.NORTH);
|
||||
mainPanel.add(createPanelCenter(),BorderLayout.CENTER);
|
||||
//mainPanel.add(createPanelBottom(),BorderLayout.SOUTH);
|
||||
getContentPane().add(mainPanel);
|
||||
pack();
|
||||
setLocationRelativeTo(aFrame);
|
||||
}
|
||||
|
||||
public void clearAndHide() {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
public JPanel createPanelCenter() {
|
||||
JPanel result = new JPanel();
|
||||
//result.setLayout(new SpringLayout());
|
||||
|
||||
result.add(new JLabel("File"));
|
||||
JButton fileButton = new JButton("Open");
|
||||
fileButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
final JFileChooser fc = new JFileChooser();
|
||||
int returnVal = fc.showOpenDialog((JButton)e.getSource());
|
||||
if (returnVal == JFileChooser.APPROVE_OPTION) {
|
||||
File file = fc.getSelectedFile();
|
||||
MetaModelDataContextCsv ds = new MetaModelDataContextCsv();
|
||||
ds.setFile(file.getAbsolutePath());
|
||||
TechUI.getInstance().getVascManager().createMetaEntry(ds,file.getName(),null);
|
||||
}
|
||||
}
|
||||
});
|
||||
result.add(fileButton);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
package net.forwardfire.vasc.demo.tech.ui.actions;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Frame;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.SpringLayout;
|
||||
|
||||
import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextJdbc;
|
||||
import net.forwardfire.vasc.demo.tech.ui.TechUI;
|
||||
import net.forwardfire.vasc.demo.tech.ui.components.SpringLayoutGrid;
|
||||
|
||||
import org.eobjects.metamodel.DataContext;
|
||||
|
||||
public class JDialogMetaJdbc extends JDialog implements ActionListener {
|
||||
|
||||
private static final long serialVersionUID = -8638394652416472734L;
|
||||
private JComboBox driverClassBox = null;
|
||||
private JTextField connectUrlField = null;
|
||||
private JTextField usernameField = null;
|
||||
private JTextField passwordField = null;
|
||||
|
||||
|
||||
public JDialogMetaJdbc(Frame aFrame) {
|
||||
setTitle("Add jdbc");
|
||||
setMinimumSize(new Dimension(300,200));
|
||||
setPreferredSize(new Dimension(500,400));
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent we) {
|
||||
clearAndHide();
|
||||
}
|
||||
});
|
||||
JPanel mainPanel = new JPanel();
|
||||
mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
|
||||
mainPanel.setLayout(new BorderLayout());
|
||||
//mainPanel.add(createPanelTop(),BorderLayout.NORTH);
|
||||
mainPanel.add(createPanelCenter(),BorderLayout.CENTER);
|
||||
//mainPanel.add(createPanelBottom(),BorderLayout.SOUTH);
|
||||
getContentPane().add(mainPanel);
|
||||
pack();
|
||||
setLocationRelativeTo(aFrame);
|
||||
}
|
||||
|
||||
public void clearAndHide() {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
public JPanel createPanelCenter() {
|
||||
JPanel result = new JPanel();
|
||||
result.setLayout(new SpringLayout());
|
||||
|
||||
result.add(new JLabel("Driver"));
|
||||
driverClassBox = new JComboBox(new String[] {"org.postgresql.Driver","com.mysql.jdbc.Driver","org.apache.derby.jdbc.EmbeddedDriver","org.hsqldb.jdbcDriver","org.sqlite.JDBC"});
|
||||
driverClassBox.setSelectedIndex(0);
|
||||
result.add(driverClassBox);
|
||||
|
||||
result.add(new JLabel("Url"));
|
||||
connectUrlField = new JTextField("jdbc:postgresql://localhost/dellstore2");
|
||||
result.add(connectUrlField);
|
||||
|
||||
result.add(new JLabel("Username"));
|
||||
usernameField = new JTextField("postgres");
|
||||
result.add(usernameField);
|
||||
|
||||
result.add(new JLabel("Password"));
|
||||
passwordField = new JTextField("postgresql");
|
||||
result.add(passwordField);
|
||||
|
||||
JButton fileButton = new JButton("Connect");
|
||||
fileButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
String url = connectUrlField.getText();
|
||||
MetaModelDataContextJdbc ds = new MetaModelDataContextJdbc();
|
||||
ds.setDriverClass((String)driverClassBox.getSelectedItem());
|
||||
ds.setConnectUrl(url);
|
||||
ds.setUsername(usernameField.getText());
|
||||
ds.setPassword(passwordField.getText());
|
||||
DataContext metaDs = ds.getDataContext();
|
||||
String dbName = url.substring(url.lastIndexOf('/')+1,url.length());
|
||||
for (String table:metaDs.getDefaultSchema().getTableNames()) {
|
||||
TechUI.getInstance().getVascManager().createMetaEntry(ds,dbName+"_"+table,table);
|
||||
}
|
||||
}
|
||||
});
|
||||
result.add(fileButton);
|
||||
result.add(new JLabel(""));
|
||||
|
||||
SpringLayoutGrid.makeCompactGrid(result, 5, 2);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
package net.forwardfire.vasc.demo.tech.ui.actions;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Frame;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.SpringLayout;
|
||||
|
||||
import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextMongodb;
|
||||
import net.forwardfire.vasc.demo.tech.ui.TechUI;
|
||||
import net.forwardfire.vasc.demo.tech.ui.components.SpringLayoutGrid;
|
||||
|
||||
import org.eobjects.metamodel.DataContext;
|
||||
|
||||
public class JDialogMetaMongodb extends JDialog implements ActionListener {
|
||||
|
||||
private static final long serialVersionUID = -8638394652416472734L;
|
||||
private JTextField hostNameField = null;
|
||||
private JTextField hostPortField = null;
|
||||
private JTextField databaseField = null;
|
||||
|
||||
public JDialogMetaMongodb(Frame aFrame) {
|
||||
setTitle("Add mongodb");
|
||||
setMinimumSize(new Dimension(300,200));
|
||||
setPreferredSize(new Dimension(400,300));
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent we) {
|
||||
clearAndHide();
|
||||
}
|
||||
});
|
||||
JPanel mainPanel = new JPanel();
|
||||
mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
|
||||
mainPanel.setLayout(new BorderLayout());
|
||||
//mainPanel.add(createPanelTop(),BorderLayout.NORTH);
|
||||
mainPanel.add(createPanelCenter(),BorderLayout.CENTER);
|
||||
//mainPanel.add(createPanelBottom(),BorderLayout.SOUTH);
|
||||
getContentPane().add(mainPanel);
|
||||
pack();
|
||||
setLocationRelativeTo(aFrame);
|
||||
}
|
||||
|
||||
public void clearAndHide() {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
public JPanel createPanelCenter() {
|
||||
JPanel result = new JPanel();
|
||||
result.setLayout(new SpringLayout());
|
||||
|
||||
result.add(new JLabel("Hostname"));
|
||||
hostNameField = new JTextField("localhost");
|
||||
result.add(hostNameField);
|
||||
|
||||
result.add(new JLabel("Port"));
|
||||
hostPortField = new JTextField("27017");
|
||||
result.add(hostPortField);
|
||||
|
||||
result.add(new JLabel("Database"));
|
||||
databaseField = new JTextField("lefiona");
|
||||
result.add(databaseField);
|
||||
|
||||
JButton fileButton = new JButton("Connect");
|
||||
fileButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
MetaModelDataContextMongodb ds = new MetaModelDataContextMongodb();
|
||||
ds.setHostname(hostNameField.getText());
|
||||
ds.setPort(new Integer(hostPortField.getText()));
|
||||
ds.setDatabase(databaseField.getText());
|
||||
DataContext metaDs = ds.getDataContext();
|
||||
for (String table:metaDs.getDefaultSchema().getTableNames()) {
|
||||
TechUI.getInstance().getVascManager().createMetaEntry(ds,ds.getDatabase()+"_"+table,table);
|
||||
}
|
||||
}
|
||||
});
|
||||
result.add(fileButton);
|
||||
result.add(new JLabel(""));
|
||||
|
||||
SpringLayoutGrid.makeCompactGrid(result, 4, 2);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,153 @@
|
|||
package net.forwardfire.vasc.demo.tech.ui.components;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.Enumeration;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogManager;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTextArea;
|
||||
import javax.swing.ScrollPaneConstants;
|
||||
import javax.swing.SpringLayout;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import net.forwardfire.vasc.demo.tech.ui.PatternLogFormatter;
|
||||
|
||||
public class JConsolePanel extends JPanel implements ActionListener {
|
||||
|
||||
private static final long serialVersionUID = 485766723433479054L;
|
||||
private UILogHandler logHandler = null;
|
||||
private JButton clearButton = null;
|
||||
private JComboBox levelBox = null;
|
||||
private JTextArea logTextArea = null;
|
||||
private JCheckBox autoScrollBox = null;
|
||||
private int logLinesMax = 255;
|
||||
|
||||
public JConsolePanel() {
|
||||
setLayout(new FlowLayout(FlowLayout.LEFT));
|
||||
JPanel wrap = new JPanel();
|
||||
wrap.setLayout(new SpringLayout());
|
||||
wrap.add(createHeader());
|
||||
wrap.add(createEditor());
|
||||
SpringLayoutGrid.makeCompactGrid(wrap,2,1);
|
||||
add(wrap);
|
||||
|
||||
Logger rootLogger = Logger.getAnonymousLogger();
|
||||
while (rootLogger.getParent()!=null) {
|
||||
rootLogger = rootLogger.getParent();
|
||||
}
|
||||
|
||||
logHandler = new UILogHandler();
|
||||
logHandler.setFormatter(new PatternLogFormatter());
|
||||
rootLogger.addHandler(logHandler);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This needs release if playing the the this tab add/removal very multiple times.
|
||||
*/
|
||||
public void release() {
|
||||
Logger rootLogger = Logger.getAnonymousLogger();
|
||||
while (rootLogger.getParent()!=null) {
|
||||
rootLogger = rootLogger.getParent();
|
||||
}
|
||||
rootLogger.removeHandler(logHandler);
|
||||
}
|
||||
|
||||
private JPanel createHeader() {
|
||||
JPanel result = new JPanel();
|
||||
result.setBorder(BorderFactory.createLineBorder(Color.BLUE));
|
||||
result.setLayout(new FlowLayout(FlowLayout.LEFT));
|
||||
result.add(new JLabel("Log Level"));
|
||||
levelBox = new JComboBox(new Level[] {Level.OFF,Level.SEVERE,Level.WARNING,Level.INFO,Level.FINE,Level.FINER,Level.FINEST,Level.ALL});
|
||||
levelBox.setSelectedItem(Level.INFO);
|
||||
levelBox.addActionListener(this);
|
||||
result.add(levelBox);
|
||||
clearButton = new JButton("Clear");
|
||||
clearButton.addActionListener(this);
|
||||
result.add(clearButton);
|
||||
autoScrollBox = new JCheckBox("Autoscroll");
|
||||
autoScrollBox.setSelected(true);
|
||||
result.add(autoScrollBox);
|
||||
return result;
|
||||
}
|
||||
|
||||
private JPanel createEditor() {
|
||||
JPanel result = new JPanel();
|
||||
result.setBorder(BorderFactory.createLineBorder(Color.BLUE));
|
||||
logTextArea = new JTextArea(5, 80);
|
||||
logTextArea.setAutoscrolls(true);
|
||||
logTextArea.setEditable(false);
|
||||
JScrollPane logScrollPane = new JScrollPane(logTextArea);
|
||||
logScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||
logScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
|
||||
logScrollPane.getViewport().setOpaque(false);
|
||||
result.add(logScrollPane);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (clearButton.equals(e.getSource())) {
|
||||
logTextArea.setText("");
|
||||
} else if (levelBox.equals(e.getSource()) && levelBox.getSelectedIndex()!=-1) {
|
||||
Level level = (Level)levelBox.getSelectedItem();
|
||||
logHandler.setLevel(level);
|
||||
Enumeration<String> loggers = LogManager.getLogManager().getLoggerNames();
|
||||
while (loggers.hasMoreElements()) {
|
||||
String name = loggers.nextElement();
|
||||
Logger logger = LogManager.getLogManager().getLogger(name);
|
||||
if (logger!=null && name.contains("pulsefire")) {
|
||||
logger.setLevel(level); // only set pulsefire code loggers
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class UILogHandler extends Handler {
|
||||
@Override
|
||||
public void close() throws SecurityException {
|
||||
}
|
||||
@Override
|
||||
public void flush() {
|
||||
}
|
||||
@Override
|
||||
public void publish(LogRecord record) {
|
||||
final String recordStr = getFormatter().format(record);
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
logTextArea.append(recordStr);
|
||||
if (logTextArea.getLineCount() > logLinesMax) {
|
||||
String t = logTextArea.getText();
|
||||
int l = 0;
|
||||
int rm = logLinesMax/2;
|
||||
for (int i=0;i<rm;i++) {
|
||||
int ll = t.indexOf('\n',l+1);
|
||||
if (ll==-1) {
|
||||
break;
|
||||
}
|
||||
l = ll;
|
||||
}
|
||||
String tt = t.substring(l,t.length());
|
||||
logTextArea.setText(tt);
|
||||
}
|
||||
if (autoScrollBox.isSelected()) {
|
||||
logTextArea.setCaretPosition(logTextArea.getText().length());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,269 @@
|
|||
/*
|
||||
* Copyright 2007-2012 forwardfire.net All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.forwardfire.vasc.demo.tech.ui.components;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JSplitPane;
|
||||
import javax.swing.JTabbedPane;
|
||||
import javax.swing.JTree;
|
||||
import javax.swing.ScrollPaneConstants;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.event.TreeModelListener;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import javax.swing.tree.DefaultTreeModel;
|
||||
import javax.swing.tree.TreeNode;
|
||||
|
||||
import net.forwardfire.vasc.core.VascEntry;
|
||||
import net.forwardfire.vasc.demo.tech.ui.TechUI;
|
||||
import net.forwardfire.vasc.demo.tech.ui.VascManager;
|
||||
import net.forwardfire.vasc.frontends.swing.SwingPanelIntegration;
|
||||
import net.forwardfire.vasc.frontends.swing.SwingPanelTabbed;
|
||||
import net.forwardfire.vasc.impl.DefaultVascFactory;
|
||||
|
||||
public class JMainPanel extends JPanel {
|
||||
|
||||
private static final long serialVersionUID = 5834715323973411147L;
|
||||
private VascManager vascManager = null;
|
||||
private SwingPanelIntegration spi = null;
|
||||
private JTabbedPane tabPane = null;
|
||||
private JTree vascTree = null;
|
||||
private JSplitPane bottomSplitPane = null;
|
||||
private JSplitPane treeSplitPane = null;
|
||||
|
||||
|
||||
public JMainPanel() {
|
||||
this.vascManager=TechUI.getInstance().getVascManager();
|
||||
setLayout(new BorderLayout());
|
||||
add(createBottomSplit(), BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
private JSplitPane createBottomSplit() {
|
||||
JSplitPane sp0 = createTreeSplit();
|
||||
JPanel sp1 = new JConsolePanel();
|
||||
bottomSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,sp0,sp1);
|
||||
bottomSplitPane.setOneTouchExpandable(true);
|
||||
bottomSplitPane.setResizeWeight(0.2);
|
||||
bottomSplitPane.setDividerLocation(750);
|
||||
sp0.setMinimumSize(new Dimension(400, 400));
|
||||
sp1.setMinimumSize(new Dimension(400, 150));
|
||||
return bottomSplitPane;
|
||||
}
|
||||
|
||||
private JSplitPane createTreeSplit() {
|
||||
JScrollPane sp0 = createTreePane();
|
||||
JScrollPane sp1 = createContentPane();
|
||||
treeSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,sp0,sp1);
|
||||
treeSplitPane.setOneTouchExpandable(true);
|
||||
treeSplitPane.setResizeWeight(0.7);
|
||||
treeSplitPane.setDividerLocation(200);
|
||||
sp0.setMinimumSize(new Dimension(200, 400));
|
||||
sp1.setMinimumSize(new Dimension(400, 400));
|
||||
return treeSplitPane;
|
||||
}
|
||||
|
||||
|
||||
|
||||
class VascTreeModel extends DefaultTreeModel {
|
||||
public VascTreeModel(TreeNode root) {
|
||||
super(root);
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = -7436681803506994277L;
|
||||
|
||||
@Override
|
||||
public void addTreeModelListener(TreeModelListener l) {
|
||||
super.addTreeModelListener(l);
|
||||
}
|
||||
}
|
||||
|
||||
private JScrollPane createTreePane() {
|
||||
|
||||
DefaultMutableTreeNode root = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.NONE,null));
|
||||
|
||||
vascTree = new JTree(new VascTreeModel(root));
|
||||
vascTree.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
super.mouseClicked(e);
|
||||
if (e.getClickCount() == 2 && vascTree.getSelectionModel().isSelectionEmpty()==false) {
|
||||
try {
|
||||
DefaultMutableTreeNode node = (DefaultMutableTreeNode)vascTree.getSelectionModel().getSelectionPath().getLastPathComponent();
|
||||
if (node.getUserObject() instanceof String) {
|
||||
return;
|
||||
}
|
||||
VascTreeNode vascNode = (VascTreeNode)node.getUserObject();
|
||||
if (vascNode != null) {
|
||||
if (vascNode.type == VascTreeNodeType.ENTRY) {
|
||||
VascEntry ee = vascManager.getVascController().getVascEntryController().getVascEntryById(vascNode.id).clone();
|
||||
DefaultVascFactory.fillVascEntryFrontend(ee, vascManager.getVascController(), DefaultVascFactory.getDefaultVascFrontendData(null));
|
||||
spi.createNewVascView(ee);
|
||||
}
|
||||
}
|
||||
} catch (Exception ee) {
|
||||
ee.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
JPanel treePanel = new JPanel();
|
||||
treePanel.setLayout(new GridLayout(1,0));
|
||||
JScrollPane p = createJScrollPane(treePanel);
|
||||
p.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||
p.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
|
||||
treePanel.add(vascTree);
|
||||
|
||||
rebuildTree();
|
||||
return p;
|
||||
}
|
||||
|
||||
private JScrollPane createContentPane() {
|
||||
JPanel contentPane = new JPanel();
|
||||
contentPane.setLayout(new GridLayout(1,0));
|
||||
JScrollPane p = createJScrollPane(contentPane);
|
||||
|
||||
tabPane = new JTabbedPane();
|
||||
spi = new SwingPanelTabbed(tabPane);
|
||||
contentPane.add(tabPane);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
private JScrollPane createJScrollPane(JPanel innerPanel) {
|
||||
JScrollPane scrollPane = new JScrollPane(innerPanel);
|
||||
scrollPane.setBorder(BorderFactory.createEmptyBorder());
|
||||
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
|
||||
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
|
||||
scrollPane.getVerticalScrollBar().setUnitIncrement(10);
|
||||
scrollPane.getHorizontalScrollBar().setUnitIncrement(10);
|
||||
//innerPanel.setParentScrollPane(scrollPane);
|
||||
return scrollPane;
|
||||
}
|
||||
|
||||
class VascTreeNode {
|
||||
public VascTreeNode() {}
|
||||
public VascTreeNode(VascTreeNodeType type,String id) { this.type=type;this.id=id; }
|
||||
public VascTreeNode(VascTreeNodeType type,String id,String entryId) { this.type=type;this.id=id;this.entryId=entryId; }
|
||||
VascTreeNodeType type;
|
||||
String id;
|
||||
String entryId;
|
||||
@Override
|
||||
public String toString() {
|
||||
return id;
|
||||
}
|
||||
|
||||
}
|
||||
enum VascTreeNodeType {
|
||||
NONE,
|
||||
FIELD_TYPE,
|
||||
BACKEND,
|
||||
ENTRY
|
||||
}
|
||||
|
||||
public void rebuildTree() {
|
||||
|
||||
DefaultMutableTreeNode root = (DefaultMutableTreeNode)vascTree.getModel().getRoot();
|
||||
root.removeAllChildren();
|
||||
|
||||
DefaultMutableTreeNode fieldTypes = new DefaultMutableTreeNode("FieldTypes");
|
||||
for (String id:vascManager.getVascController().getVascEntryFieldTypeController().getVascEntryFieldTypeIds()) {
|
||||
DefaultMutableTreeNode typeNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.FIELD_TYPE,id));
|
||||
fieldTypes.add(typeNode);
|
||||
}
|
||||
root.add(fieldTypes);
|
||||
|
||||
DefaultMutableTreeNode backends = new DefaultMutableTreeNode("VascBackends");
|
||||
for (String id:vascManager.getVascController().getVascBackendController().getVascBackendIds()) {
|
||||
DefaultMutableTreeNode backendNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.BACKEND,id));
|
||||
backends.add(backendNode);
|
||||
}
|
||||
root.add(backends);
|
||||
|
||||
DefaultMutableTreeNode entries = new DefaultMutableTreeNode("VascEntries");
|
||||
for (String id:vascManager.getVascController().getVascEntryController().getVascEntryIds()) {
|
||||
//VascEntry ve = vascManager.getVascController().getVascEntryController().getVascEntryById(id);
|
||||
DefaultMutableTreeNode entryNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY,id));
|
||||
entries.add(entryNode);
|
||||
/*
|
||||
DefaultMutableTreeNode fields = new DefaultMutableTreeNode("Fields");
|
||||
for (VascEntryField vef:ve.getVascEntryFields()) {
|
||||
DefaultMutableTreeNode vefNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY_FIELD,vef.getId(),id));
|
||||
fields.add(vefNode);
|
||||
}
|
||||
entryNode.add(fields);
|
||||
|
||||
DefaultMutableTreeNode fieldSets = new DefaultMutableTreeNode("FieldSets");
|
||||
for (VascEntryFieldSet vefs:ve.getVascEntryFieldSets()) {
|
||||
DefaultMutableTreeNode vefsNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY_FIELD_SET,vefs.getId(),id));
|
||||
fieldSets.add(vefsNode);
|
||||
}
|
||||
entryNode.add(fieldSets);
|
||||
|
||||
DefaultMutableTreeNode links = new DefaultMutableTreeNode("Links");
|
||||
for (VascLinkEntry vle:ve.getVascLinkEntries()) {
|
||||
DefaultMutableTreeNode vefsNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY_FIELD_SET,vle.getId()));
|
||||
links.add(vefsNode);
|
||||
}
|
||||
entryNode.add(links);
|
||||
|
||||
DefaultMutableTreeNode filters = new DefaultMutableTreeNode("Backend Filters");
|
||||
for (VascBackendFilter vbf:ve.getVascBackendFilters()) {
|
||||
DefaultMutableTreeNode vefsNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY_FIELD_SET,vbf.getClass().getSimpleName()));
|
||||
filters.add(vefsNode);
|
||||
}
|
||||
entryNode.add(links);
|
||||
|
||||
DefaultMutableTreeNode param = new DefaultMutableTreeNode("Backend Parameters");
|
||||
for (String key:ve.getEntryParameterKeys()) {
|
||||
DefaultMutableTreeNode vefsNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY_FIELD_SET,key));
|
||||
param.add(vefsNode);
|
||||
}
|
||||
entryNode.add(param);
|
||||
|
||||
|
||||
DefaultMutableTreeNode options = new DefaultMutableTreeNode("List Options");
|
||||
for (VascEntryField vef:ve.getListOptions()) {
|
||||
DefaultMutableTreeNode vefsNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY_FIELD_SET,vef.getId()));
|
||||
options.add(vefsNode);
|
||||
}
|
||||
entryNode.add(options);
|
||||
*/
|
||||
}
|
||||
root.add(entries);
|
||||
|
||||
SwingUtilities.updateComponentTreeUI(vascTree);
|
||||
}
|
||||
|
||||
public JTabbedPane getTabPane() {
|
||||
return tabPane;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
package net.forwardfire.vasc.demo.tech.ui.components;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuBar;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JTabbedPane;
|
||||
|
||||
import net.forwardfire.vasc.demo.tech.ui.TechUI;
|
||||
import net.forwardfire.vasc.demo.tech.ui.actions.JDialogMetaCsv;
|
||||
import net.forwardfire.vasc.demo.tech.ui.actions.JDialogMetaJdbc;
|
||||
import net.forwardfire.vasc.demo.tech.ui.actions.JDialogMetaMongodb;
|
||||
|
||||
public class JMainPanelMenuBar extends JMenuBar {
|
||||
|
||||
JMenu fileMenu = new JMenu("File");
|
||||
JMenu connMenu = new JMenu("Connection");
|
||||
JMenu tabMenu = new JMenu("Tabs");
|
||||
|
||||
public JMainPanelMenuBar() {
|
||||
createMenuItems();
|
||||
add(fileMenu);
|
||||
add(connMenu);
|
||||
add(tabMenu);
|
||||
}
|
||||
|
||||
|
||||
private void createMenuItems() {
|
||||
JMenuItem openXmlItem = new JMenuItem("Import Xml");
|
||||
openXmlItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
final JFileChooser fc = new JFileChooser();
|
||||
//fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
|
||||
int returnVal = fc.showOpenDialog((JMenuItem)e.getSource());
|
||||
if (returnVal == JFileChooser.APPROVE_OPTION) {
|
||||
File file = fc.getSelectedFile();
|
||||
TechUI.getInstance().getVascManager().openFile(file);
|
||||
((JMainPanel)TechUI.getInstance().getMainView().getComponent()).rebuildTree();
|
||||
}
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
fileMenu.add(openXmlItem);
|
||||
//JMenuItem closeXmlItem = new JMenuItem("Close");
|
||||
//fileMenu.add(closeXmlItem);
|
||||
fileMenu.addSeparator();
|
||||
JMenuItem exitItem = new JMenuItem("Exit");
|
||||
exitItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
TechUI.getInstance().exit();
|
||||
}
|
||||
});
|
||||
fileMenu.add(exitItem);
|
||||
|
||||
JMenuItem connectVascItem = new JMenuItem("Add Vasc");
|
||||
connectVascItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
}
|
||||
});
|
||||
connMenu.add(connectVascItem);
|
||||
|
||||
JMenuItem connectLdapItem = new JMenuItem("Add Ldap");
|
||||
connectLdapItem.setEnabled(false);
|
||||
connMenu.add(connectLdapItem);
|
||||
connMenu.addSeparator();
|
||||
JMenuItem connectMetaCsvItem = new JMenuItem("Add meta csv");
|
||||
connectMetaCsvItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JDialogMetaCsv d = new JDialogMetaCsv(TechUI.getInstance().getMainFrame());
|
||||
d.setVisible(true);
|
||||
}
|
||||
});
|
||||
connMenu.add(connectMetaCsvItem);
|
||||
JMenuItem connectMetaXmlItem = new JMenuItem("Add meta xml");
|
||||
connMenu.add(connectMetaXmlItem);
|
||||
JMenuItem connectMetaMongoItem = new JMenuItem("Add meta mongo");
|
||||
connectMetaMongoItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JDialogMetaMongodb d = new JDialogMetaMongodb(TechUI.getInstance().getMainFrame());
|
||||
d.setVisible(true);
|
||||
}
|
||||
});
|
||||
connMenu.add(connectMetaMongoItem);
|
||||
JMenuItem connectMetaJdbcItem = new JMenuItem("Add meta jdbc");
|
||||
connectMetaJdbcItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JDialogMetaJdbc d = new JDialogMetaJdbc(TechUI.getInstance().getMainFrame());
|
||||
d.setVisible(true);
|
||||
}
|
||||
});
|
||||
connMenu.add(connectMetaJdbcItem);
|
||||
|
||||
/*
|
||||
for (final String id:ve.getVascFrontendData().getVascController().getVascEntryController().getVascEntryIds()) {
|
||||
JMenuItem item = new JMenuItem(id);
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
VascEntry ee = ve.getVascFrontendData().getVascController().getVascEntryController().getVascEntryById(id).clone();
|
||||
DefaultVascFactory.fillVascEntryFrontend(ee, ve.getVascFrontendData().getVascController(), DefaultVascFactory.getDefaultVascFrontendData(null));
|
||||
spi.createNewVascView(ee);
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
vascMenu.add(item);
|
||||
}
|
||||
*/
|
||||
|
||||
JMenuItem item = new JMenuItem("Close tab");
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JTabbedPane tabPane = ((JMainPanel)TechUI.getInstance().getMainView().getComponent()).getTabPane();
|
||||
if (tabPane.getSelectedIndex()>=0) {
|
||||
tabPane.removeTabAt(tabPane.getSelectedIndex()); // todo release vasc frontend
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
tabMenu.add(item);
|
||||
JMenuItem itemAll = new JMenuItem("Close All tabs");
|
||||
itemAll.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JTabbedPane tabPane = ((JMainPanel)TechUI.getInstance().getMainView().getComponent()).getTabPane();
|
||||
for (int i=tabPane.getTabCount();i>0;i--) {
|
||||
tabPane.removeTabAt(i-1); // todo release vasc frontend
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
tabMenu.add(itemAll);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,214 @@
|
|||
/*
|
||||
* Copyright (c) 2011, Willem Cazander
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.forwardfire.vasc.demo.tech.ui.components;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
|
||||
import javax.swing.Spring;
|
||||
import javax.swing.SpringLayout;
|
||||
|
||||
|
||||
/**
|
||||
* SpringLayoutGrid, someone should create an JCP to get these functions into
|
||||
* SpringLayout object because this code is to much duplicated on many projects.
|
||||
*
|
||||
* A 1.4 file that provides utility methods for creating form- or grid-style
|
||||
* layouts with SpringLayout. These utilities are used by several programs, such
|
||||
* as SpringBox and SpringCompactGrid.
|
||||
*/
|
||||
public class SpringLayoutGrid {
|
||||
|
||||
|
||||
/**
|
||||
* Aligns the first <code>rows</code>*<code>cols</code> components of
|
||||
* <code>parent</code> in a grid. Each component is as big as the maximum
|
||||
* preferred width and height of the components. The parent is made just big
|
||||
* enough to fit them all.
|
||||
*
|
||||
* @param rows
|
||||
* number of rows
|
||||
* @param cols
|
||||
* number of columns
|
||||
* @param initialX
|
||||
* x location to start the grid at
|
||||
* @param initialY
|
||||
* y location to start the grid at
|
||||
* @param xPad
|
||||
* x padding between cells
|
||||
* @param yPad
|
||||
* y padding between cells
|
||||
*/
|
||||
public static void makeGrid(Container parent, int rows, int cols,int initialX, int initialY, int xPad, int yPad) {
|
||||
SpringLayout layout;
|
||||
try {
|
||||
layout = (SpringLayout) parent.getLayout();
|
||||
} catch (ClassCastException exc) {
|
||||
throw new IllegalArgumentException("parent container has not StringLayout layoutmanager.");
|
||||
}
|
||||
|
||||
Spring xPadSpring = Spring.constant(xPad);
|
||||
Spring yPadSpring = Spring.constant(yPad);
|
||||
Spring initialXSpring = Spring.constant(initialX);
|
||||
Spring initialYSpring = Spring.constant(initialY);
|
||||
int max = rows * cols;
|
||||
|
||||
//Calculate Springs that are the max of the width/height so that all
|
||||
//cells have the same size.
|
||||
Spring maxWidthSpring = layout.getConstraints(parent.getComponent(0))
|
||||
.getWidth();
|
||||
Spring maxHeightSpring = layout.getConstraints(parent.getComponent(0))
|
||||
.getWidth();
|
||||
for (int i = 1; i < max; i++) {
|
||||
SpringLayout.Constraints cons = layout.getConstraints(parent
|
||||
.getComponent(i));
|
||||
|
||||
maxWidthSpring = Spring.max(maxWidthSpring, cons.getWidth());
|
||||
maxHeightSpring = Spring.max(maxHeightSpring, cons.getHeight());
|
||||
}
|
||||
|
||||
//Apply the new width/height Spring. This forces all the
|
||||
//components to have the same size.
|
||||
for (int i = 0; i < max; i++) {
|
||||
SpringLayout.Constraints cons = layout.getConstraints(parent
|
||||
.getComponent(i));
|
||||
|
||||
cons.setWidth(maxWidthSpring);
|
||||
cons.setHeight(maxHeightSpring);
|
||||
}
|
||||
|
||||
//Then adjust the x/y constraints of all the cells so that they
|
||||
//are aligned in a grid.
|
||||
SpringLayout.Constraints lastCons = null;
|
||||
SpringLayout.Constraints lastRowCons = null;
|
||||
for (int i = 0; i < max; i++) {
|
||||
SpringLayout.Constraints cons = layout.getConstraints(parent
|
||||
.getComponent(i));
|
||||
if (i % cols == 0) { //start of new row
|
||||
lastRowCons = lastCons;
|
||||
cons.setX(initialXSpring);
|
||||
} else { //x position depends on previous component
|
||||
cons.setX(Spring.sum(lastCons.getConstraint(SpringLayout.EAST),
|
||||
xPadSpring));
|
||||
}
|
||||
|
||||
if (i / cols == 0) { //first row
|
||||
cons.setY(initialYSpring);
|
||||
} else { //y position depends on previous row
|
||||
cons.setY(Spring.sum(lastRowCons
|
||||
.getConstraint(SpringLayout.SOUTH), yPadSpring));
|
||||
}
|
||||
lastCons = cons;
|
||||
}
|
||||
|
||||
//Set the parent's size.
|
||||
SpringLayout.Constraints pCons = layout.getConstraints(parent);
|
||||
pCons.setConstraint(SpringLayout.SOUTH, Spring.sum(Spring
|
||||
.constant(yPad), lastCons.getConstraint(SpringLayout.SOUTH)));
|
||||
pCons.setConstraint(SpringLayout.EAST, Spring.sum(
|
||||
Spring.constant(xPad), lastCons
|
||||
.getConstraint(SpringLayout.EAST)));
|
||||
}
|
||||
|
||||
/* Used by makeCompactGrid. */
|
||||
private static SpringLayout.Constraints getConstraintsForCell(int row,
|
||||
int col, Container parent, int cols) {
|
||||
SpringLayout layout = (SpringLayout) parent.getLayout();
|
||||
Component c = parent.getComponent(row * cols + col);
|
||||
return layout.getConstraints(c);
|
||||
}
|
||||
|
||||
|
||||
public static void makeCompactGrid(Container parent, int rows, int cols) {
|
||||
makeCompactGrid(parent,rows,cols,6,6,6,6);
|
||||
}
|
||||
|
||||
/**
|
||||
* Aligns the first <code>rows</code>*<code>cols</code> components of
|
||||
* <code>parent</code> in a grid. Each component in a column is as wide as
|
||||
* the maximum preferred width of the components in that column; height is
|
||||
* similarly determined for each row. The parent is made just big enough to
|
||||
* fit them all.
|
||||
*
|
||||
* @param rows
|
||||
* number of rows
|
||||
* @param cols
|
||||
* number of columns
|
||||
* @param initialX
|
||||
* x location to start the grid at
|
||||
* @param initialY
|
||||
* y location to start the grid at
|
||||
* @param xPad
|
||||
* x padding between cells
|
||||
* @param yPad
|
||||
* y padding between cells
|
||||
*/
|
||||
public static void makeCompactGrid(Container parent, int rows, int cols,int initialX, int initialY, int xPad, int yPad) {
|
||||
SpringLayout layout;
|
||||
try {
|
||||
layout = (SpringLayout) parent.getLayout();
|
||||
} catch (ClassCastException exc) {
|
||||
throw new IllegalArgumentException("parent container has not StringLayout layoutmanager.");
|
||||
}
|
||||
|
||||
//Align all cells in each column and make them the same width.
|
||||
Spring x = Spring.constant(initialX);
|
||||
for (int c = 0; c < cols; c++) {
|
||||
Spring width = Spring.constant(0);
|
||||
for (int r = 0; r < rows; r++) {
|
||||
width = Spring.max(width, getConstraintsForCell(r, c, parent,
|
||||
cols).getWidth());
|
||||
}
|
||||
for (int r = 0; r < rows; r++) {
|
||||
SpringLayout.Constraints constraints = getConstraintsForCell(r,
|
||||
c, parent, cols);
|
||||
constraints.setX(x);
|
||||
constraints.setWidth(width);
|
||||
}
|
||||
x = Spring.sum(x, Spring.sum(width, Spring.constant(xPad)));
|
||||
}
|
||||
|
||||
//Align all cells in each row and make them the same height.
|
||||
Spring y = Spring.constant(initialY);
|
||||
for (int r = 0; r < rows; r++) {
|
||||
Spring height = Spring.constant(0);
|
||||
for (int c = 0; c < cols; c++) {
|
||||
height = Spring.max(height, getConstraintsForCell(r, c, parent,
|
||||
cols).getHeight());
|
||||
}
|
||||
for (int c = 0; c < cols; c++) {
|
||||
SpringLayout.Constraints constraints = getConstraintsForCell(r,
|
||||
c, parent, cols);
|
||||
constraints.setY(y);
|
||||
constraints.setHeight(height);
|
||||
}
|
||||
y = Spring.sum(y, Spring.sum(height, Spring.constant(yPad)));
|
||||
}
|
||||
|
||||
//Set the parent's size.
|
||||
SpringLayout.Constraints pCons = layout.getConstraints(parent);
|
||||
pCons.setConstraint(SpringLayout.SOUTH, y);
|
||||
pCons.setConstraint(SpringLayout.EAST, x);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
#
|
||||
# Copyright (c) 2011, Willem Cazander
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
# that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
# following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
# the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
# Application's properties
|
||||
Application.name = Vasc Demo Tech
|
||||
Application.title = VascDemoTech
|
||||
Application.vendor = Willem Cazander
|
||||
Application.homepage = http://vasc.forwardfire.org/
|
||||
Application.vendorId = vasc
|
||||
Application.id = vascdemotech
|
||||
Application.lookAndFeel = com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel
|
||||
#Application.icon = images/icon.png
|
||||
|
||||
|
||||
generic.active.labelText = active
|
||||
generic.active.toolTipText = active
|
||||
generic.createdDate.labelText = createdDate
|
||||
generic.createdDate.toolTipText = createdDate
|
||||
generic.description.labelText = description
|
||||
generic.description.toolTipText = description
|
||||
generic.id.labelText = id
|
||||
generic.id.toolTipText = id
|
||||
generic.modifiedDate.labelText = modifiedDate
|
||||
generic.modifiedDate.toolTipText = modifiedDate
|
||||
generic.name.labelText = name
|
||||
generic.name.toolTipText = name
|
||||
generic.orderNumber.labelText = orderNumber
|
||||
generic.orderNumber.toolTipText = orderNumber
|
||||
|
||||
# hibernate validators
|
||||
validator.assertFalse=assertion failed
|
||||
validator.assertTrue=assertion failed
|
||||
validator.future=Date must lie in the future
|
||||
validator.length=Field must contain between {min} and {max} characters.
|
||||
validator.max=Value must be equal to or lower than {value}
|
||||
validator.min=Value must be equal to or higher than {value}
|
||||
validator.notNull=A value must be entered
|
||||
validator.past=Date must lie in the future
|
||||
validator.pattern=Value must conform to "{regex}"
|
||||
validator.range=Value must lie between {min} and {max}
|
||||
validator.size=There must be between {min} and {max} characters
|
||||
validator.email=The value must be a valid e-mail address
|
||||
|
||||
# vasc validators
|
||||
vasc.validator.VascDateFutureValidator=The date must lie in the future.
|
||||
vasc.validator.VascDatePastValidator=The date must lie in the past.
|
||||
vasc.validator.VascIntSizeValidator=Value must lie between {0} and {1}
|
||||
vasc.validator.VascLongSizeValidator=Value must lie between {0} and {1}
|
||||
vasc.validator.VascObjectNotNullValidator=A value must be entered
|
||||
vasc.validator.VascObjectNullValidator=No value may be entered
|
||||
vasc.validator.VascStringEmailValidator=The value must be a valid e-mail address
|
||||
vasc.validator.VascStringLengthValidator=There must be at least {0} and at most {1} items
|
||||
vasc.validator.VascStringRegexValidator=Value must conform to "{0}"
|
||||
vasc.validator.VascStringZipCodeValidator=Value must be a valid post code.
|
||||
|
||||
# Vasc actions labels
|
||||
vasc.action.addRowAction.description = add a new record
|
||||
vasc.action.addRowAction.name = Add
|
||||
vasc.action.csvExportAction.description = CSV
|
||||
vasc.action.csvExportAction.name = CSV
|
||||
vasc.action.xmlExportAction.description = XML
|
||||
vasc.action.xmlExportAction.name = XML
|
||||
vasc.action.deleteRowAction.description = delete
|
||||
vasc.action.deleteRowAction.name = delete
|
||||
vasc.action.downloadAction.description = Select this record.
|
||||
vasc.action.downloadAction.name = Select
|
||||
vasc.action.editRowAction.description = edit
|
||||
vasc.action.editRowAction.name = Edit
|
||||
|
||||
# Temp jsf
|
||||
generic.vasc.jsf.listOption.header = Searchoptions
|
||||
generic.vasc.jsf.listOption.search = Searh\:
|
||||
generic.vasc.jsf.listOption.sumbit = Search
|
||||
generic.vasc.jsf.pager.previous = Previous
|
||||
generic.vasc.jsf.pager.next = Next
|
||||
generic.vasc.jsf.table.rows = Row Numbers\:
|
||||
generic.vasc.jsf.table.pagerDirect = Go to\:
|
||||
generic.vasc.jsf.table.downloadDirect = Download\:
|
||||
generic.vasc.jsf.table.resultText = Results {0}-{1} from {2} rows
|
||||
generic.vasc.jsf.table.download.img = Save table data.
|
||||
generic.vasc.jsf.table.printer.img = Shows the table in printer friendly format.
|
||||
generic.vasc.jsf.table.export.select = ...
|
||||
generic.vasc.jsf.table.export.select.alt = Select Export
|
||||
generic.vasc.jsf.table.page.select = ...
|
||||
generic.vasc.jsf.table.page.select.alt = Select Page
|
||||
generic.vasc.jsf.table.page.name = Page:
|
||||
generic.vasc.jsf.table.page.description = Goto page:
|
||||
generic.vasc.jsf.tableHeader.fields = Fields
|
||||
generic.vasc.jsf.tableHeader.links = Links
|
||||
generic.vasc.jsf.tableHeader.actions = Actions
|
||||
generic.vasc.jsf.multiAction.selectAll = Select all:
|
||||
generic.vasc.jsf.multiAction.name = ...
|
||||
generic.vasc.jsf.multiAction.description = Select Action
|
||||
generic.vasc.jsf.action.save = Save
|
||||
generic.vasc.jsf.action.cancel = Cancel
|
||||
generic.vasc.jsf.action.back = Back
|
||||
generic.vasc.jsf.parentSelected = Selected:
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue