2
0
Fork 0

[svn r229] init add vasc

This commit is contained in:
willemc 2007-03-22 01:01:07 +01:00
parent 5684546942
commit d62b09bd3b
39 changed files with 1804 additions and 0 deletions

18
.classpath Normal file
View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="tests"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/junit-4.1.jar"/>
<classpathentry kind="lib" path="lib/idcanet-x4o-bin.jar"/>
<classpathentry kind="lib" path="lib/juel-2.1.0-rc1.jar"/>
<classpathentry kind="lib" path="lib/juel-2.1.0-rc1-impl.jar"/>
<classpathentry kind="lib" path="lib/idcanet-xtes-bin.jar"/>
<classpathentry kind="lib" path="lib/idcanet-serv5-bin.jar"/>
<classpathentry kind="lib" path="lib/hibernate3.jar"/>
<classpathentry kind="con" path="SWT_CONTAINER/PLATFORM"/>
<classpathentry kind="lib" path="lib/jgoodies-binding.jar"/>
<classpathentry kind="lib" path="lib/swtbinding-20051212111010.jar"/>
<classpathentry kind="lib" path="lib/org.eclipse.jface_3.2.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

17
.project Normal file
View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.idcanet.vasc</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

11
build/vasc-bin-jar.xml Normal file
View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="vasc-bin-jar" default="doBuildBinJar" basedir="../." >
<property name="destination" value="." />
<property name="source" value="bin"/>
<property name="destinationFile" value="idcanet-vasc-bin.jar"/>
<target name="doBuildBinJar">
<jar destfile="${destination}/${destinationFile}" basedir="${source}" includes="**"></jar>
</target>
</project>

21
build/vasc-javadocs.xml Normal file
View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="vasc-javadocs" default="javadoc" basedir="../." >
<target name="javadoc">
<javadoc access="public"
author="true"
classpath=""
destdir="doc/javadoc"
nodeprecated="false"
nodeprecatedlist="false"
noindex="false"
nonavbar="false"
notree="false"
packagenames="com.idcanet.vasc/*"
source="1.5"
sourcepath="src"
splitindex="true"
use="true"
version="true"
/>
</target>
</project>

13
build/vasc-src-jar.xml Normal file
View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="vasc-src-jar" default="doBuildSrcJar" basedir="../." >
<property name="destination" value="." />
<property name="source" value="src"/>
<property name="destinationFile" value="idcanet-vasc-src.jar"/>
<target name="doBuildSrcJar">
<jar destfile="${destination}/${destinationFile}" basedir="${source}" includes="**">
<include name="tests/*.java"/>
</jar>
</target>
</project>

4
doc/README.txt Normal file
View file

@ -0,0 +1,4 @@
---- Object tree:

BIN
lib/hibernate3.jar Normal file

Binary file not shown.

BIN
lib/idcanet-serv5-bin.jar Normal file

Binary file not shown.

BIN
lib/idcanet-x4o-bin.jar Normal file

Binary file not shown.

BIN
lib/idcanet-xtes-bin.jar Normal file

Binary file not shown.

BIN
lib/jgoodies-binding.jar Normal file

Binary file not shown.

BIN
lib/juel-2.1.0-rc1-impl.jar Normal file

Binary file not shown.

BIN
lib/juel-2.1.0-rc1.jar Normal file

Binary file not shown.

BIN
lib/junit-4.1.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,45 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.core;
import java.util.List;
import com.idcanet.xtes.xpql.query.Query;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public interface VascDataSource {
public List<Object> executeQuery(Query query) throws Exception;
public void persist(Object object) throws Exception;
}

View file

@ -0,0 +1,40 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.core;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public interface VascRecordCreator {
public Object newRecord(VascTable table) throws Exception;
public Class getObjectClass();
}

View file

@ -0,0 +1,326 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.core;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import com.idcanet.vasc.core.actions.ColumnVascAction;
import com.idcanet.vasc.core.actions.GlobalVascAction;
import com.idcanet.vasc.core.actions.RowVascAction;
import com.idcanet.vasc.core.column.VascTableColumn;
import com.idcanet.xtes.xpql.query.Query;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public class VascTable {
private String name = null;
private String headerName = null;
private String description = null;
private String toolTip = null;
private List<VascTableColumn> tableColumns = null;
private List<RowVascAction> rowActions = null;
private List<ColumnVascAction> columnActions = null;
private List<GlobalVascAction> globalActions = null;
private VascDataSource vascDataSource = null;
private Query query = null;
private List<Object> tableData = null;
private Object selectedObject = null;
private VascRecordCreator vascRecordCreator = null;
private VascViewRenderer vascViewRenderer = null;
private VascTextValue vascTextValue = null;
private List<VascUserOption> userOptions = null;
private String helpId = null;
public VascTable() {
tableColumns = new ArrayList<VascTableColumn>(6);
rowActions = new ArrayList<RowVascAction>(6);
columnActions = new ArrayList<ColumnVascAction>(6);
globalActions = new ArrayList<GlobalVascAction>(6);
tableData = new ArrayList<Object>(6);
userOptions = new ArrayList<VascUserOption>(6);
}
/**
* @return the columnActions
*/
public List<ColumnVascAction> getColumnActions() {
return columnActions;
}
/**
* @param columnActions the columnActions to set
*/
public void addColumnActions(ColumnVascAction columnAction) {
columnActions.add(columnAction);
}
/**
* @return the description
*/
public String getDescription() {
return description;
}
/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return the globalActions
*/
public List<GlobalVascAction> getGlobalActions() {
return globalActions;
}
/**
* @param globalActions the globalActions to set
*/
public void addGlobalActions(GlobalVascAction globalAction) {
globalActions.add(globalAction);
}
/**
* @return the headerName
*/
public String getHeaderName() {
return headerName;
}
/**
* @param headerName the headerName to set
*/
public void setHeaderName(String headerName) {
this.headerName = headerName;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the query
*/
public Query getQuery() {
return query;
}
/**
* @param query the query to set
*/
public void setQuery(Query query) {
this.query = query;
}
/**
* @return the rowActions
*/
public List<RowVascAction> getRowActions() {
return rowActions;
}
/**
* @param rowActions the rowActions to set
*/
public void addRowActions(RowVascAction rowAction) {
rowActions.add(rowAction);
}
/**
* @return the selectedObject
*/
public Object getSelectedObject() {
return selectedObject;
}
/**
* @param selectedObject the selectedObject to set
*/
public void setSelectedObject(Object selectedObject) {
this.selectedObject = selectedObject;
}
/**
* @return the tableColumns
*/
public List<VascTableColumn> getTableColumns() {
return tableColumns;
}
/**
* @param tableColumns the tableColumns to set
*/
public void addTableColumns(VascTableColumn tableColumn) {
tableColumns.add(tableColumn);
}
/**
* @return the tableData
*/
public List<Object> getTableData() {
return tableData;
}
/**
* @param tableData the tableData to set
*/
public void setTableData(List<Object> tableData) {
this.tableData = tableData;
}
/**
* @return the toolTip
*/
public String getToolTip() {
return toolTip;
}
/**
* @param toolTip the toolTip to set
*/
public void setToolTip(String toolTip) {
this.toolTip = toolTip;
}
/**
* @return the userOptions
*/
public List<VascUserOption> getUserOptions() {
return userOptions;
}
/**
* @param userOptions the userOptions to set
*/
public void addUserOptions(VascUserOption userOption) {
userOptions.add(userOption);
}
/**
* @return the vascDataSource
*/
public VascDataSource getVascDataSource() {
return vascDataSource;
}
/**
* @param vascDataSource the vascDataSource to set
*/
public void setVascDataSource(VascDataSource vascDataSource) {
this.vascDataSource = vascDataSource;
}
/**
* @return the vascRecordCreator
*/
public VascRecordCreator getVascRecordCreator() {
return vascRecordCreator;
}
/**
* @param vascRecordCreator the vascRecordCreator to set
*/
public void setVascRecordCreator(VascRecordCreator vascRecordCreator) {
this.vascRecordCreator = vascRecordCreator;
}
/**
* @return the vascTextValue
*/
public VascTextValue getVascTextValue() {
return vascTextValue;
}
/**
* @param vascTextValue the vascTextValue to set
*/
public void setVascTextValue(VascTextValue vascTextValue) {
this.vascTextValue = vascTextValue;
}
/**
* @return the vascViewRenderer
*/
public VascViewRenderer getVascViewRenderer() {
return vascViewRenderer;
}
/**
* @param vascViewRenderer the vascViewRenderer to set
*/
public void setVascViewRenderer(VascViewRenderer vascViewRenderer) {
this.vascViewRenderer = vascViewRenderer;
}
/**
* @return the helpId
*/
public String getHelpId() {
return helpId;
}
/**
* @param helpId the helpId to set
*/
public void setHelpId(String helpId) {
this.helpId = helpId;
}
static public Integer getTotalColumnSize(VascTable table) {
int result = 0;
for(VascTableColumn c:table.getTableColumns()) {
if(c.getWidth()==null) {
Logger.getLogger(VascTable.class.getName()).finer("Column no size: "+c.getName());
return null;
}
result=+c.getWidth();
}
return result;
}
}

View file

@ -0,0 +1,39 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.core;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public interface VascTextValue {
public String getTextValue(String text);
}

View file

@ -0,0 +1,39 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.core;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public interface VascUserOption {
public Object createUserOptionRenderer(VascTable table);
}

View file

@ -0,0 +1,39 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.core;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public interface VascViewRenderer {
public void renderView(VascTable table);
}

View file

@ -0,0 +1,40 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.core.actions;
import com.idcanet.vasc.core.VascTable;
import com.idcanet.vasc.core.column.VascTableColumn;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public interface ColumnVascAction extends VascAction {
public void doColumnAction(VascTable table,VascTableColumn column);
}

View file

@ -0,0 +1,39 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.core.actions;
import com.idcanet.vasc.core.VascTable;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public interface GlobalVascAction extends VascAction {
public void doGlobalAction(VascTable table);
}

View file

@ -0,0 +1,39 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.core.actions;
import com.idcanet.vasc.core.VascTable;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public interface RowVascAction extends VascAction {
public void doRowAction(VascTable table,Object rowObject);
}

View file

@ -0,0 +1,42 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.core.actions;
import com.idcanet.vasc.core.VascTable;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public interface VascAction {
public String getName();
public String getToolTip();
public Object createActionObject(VascTable table);
}

View file

@ -0,0 +1,37 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.core.column;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public interface VascColumnEditor {
public Object createColumnEditor(VascTableColumn column);
}

View file

@ -0,0 +1,37 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.core.column;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public interface VascColumnRenderer {
public Object createColumnRender(VascTableColumn column);
}

View file

@ -0,0 +1,37 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.core.column;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public interface VascColumnValue {
public Object getValue(VascTableColumn column);
}

View file

@ -0,0 +1,178 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.core.column;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public class VascTableColumn {
private String name = null;
private String toolTip = null;
private Object defaultValue = null;
private Integer width = null;
private String helpId = null;
private VascColumnValue vascColumnValue = null;
private VascColumnRenderer vascColumnRenderer = null;
private VascColumnEditor vascColumnEditor = null;
private Object columnRenderer = null;
private Object columnEditor = null;
/**
* @return the defaultValue
*/
public Object getDefaultValue() {
return defaultValue;
}
/**
* @param defaultValue the defaultValue to set
*/
public void setDefaultValue(Object defaultValue) {
this.defaultValue = defaultValue;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the toolTip
*/
public String getToolTip() {
return toolTip;
}
/**
* @param toolTip the toolTip to set
*/
public void setToolTip(String toolTip) {
this.toolTip = toolTip;
}
/**
* @return the vascColumnEditor
*/
public VascColumnEditor getVascColumnEditor() {
return vascColumnEditor;
}
/**
* @param vascColumnEditor the vascColumnEditor to set
*/
public void setVascColumnEditor(VascColumnEditor vascColumnEditor) {
this.vascColumnEditor = vascColumnEditor;
}
/**
* @return the vascColumnRenderer
*/
public VascColumnRenderer getVascColumnRenderer() {
return vascColumnRenderer;
}
/**
* @param vascColumnRenderer the vascColumnRenderer to set
*/
public void setVascColumnRenderer(VascColumnRenderer vascColumnRenderer) {
this.vascColumnRenderer = vascColumnRenderer;
}
/**
* @return the vascColumnValue
*/
public VascColumnValue getVascColumnValue() {
return vascColumnValue;
}
/**
* @param vascColumnValue the vascColumnValue to set
*/
public void setVascColumnValue(VascColumnValue vascColumnValue) {
this.vascColumnValue = vascColumnValue;
}
/**
* @return the width
*/
public Integer getWidth() {
return width;
}
/**
* @param width the width to set
*/
public void setWidth(Integer width) {
this.width = width;
}
/**
* @return the columnEditor
*/
public Object getColumnEditor() {
return columnEditor;
}
/**
* @param columnEditor the columnEditor to set
*/
public void setColumnEditor(Object columnEditor) {
this.columnEditor = columnEditor;
}
/**
* @return the columnRenderer
*/
public Object getColumnRenderer() {
return columnRenderer;
}
/**
* @param columnRenderer the columnRenderer to set
*/
public void setColumnRenderer(Object columnRenderer) {
this.columnRenderer = columnRenderer;
}
/**
* @return the helpId
*/
public String getHelpId() {
return helpId;
}
/**
* @param helpId the helpId to set
*/
public void setHelpId(String helpId) {
this.helpId = helpId;
}
}

View file

@ -0,0 +1,59 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.impl;
import com.idcanet.vasc.core.VascRecordCreator;
import com.idcanet.vasc.core.VascTable;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public class BeanVascRecordCreator implements VascRecordCreator {
private Class objectClass = null;
public BeanVascRecordCreator() {
}
public BeanVascRecordCreator(Class objectClass) {
setObjectClass(objectClass);
}
public Object newRecord(VascTable table) throws Exception {
return objectClass.newInstance();
}
public Class getObjectClass() {
return objectClass;
}
public void setObjectClass(Class objectClass) {
this.objectClass=objectClass;
}
}

View file

@ -0,0 +1,41 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.impl;
import com.idcanet.vasc.core.VascTextValue;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public class DefaultVascTextValue implements VascTextValue {
public String getTextValue(String text) {
return text;
}
}

View file

@ -0,0 +1,73 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.impl.column;
import com.idcanet.vasc.core.column.VascColumnValue;
import com.idcanet.vasc.core.column.VascTableColumn;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public class BeanPropertyVascColumnValue implements VascColumnValue {
private String property = null;
public BeanPropertyVascColumnValue() {
}
public BeanPropertyVascColumnValue(String property) {
setProperty(property);
}
public Object getValue(VascTableColumn column) {
if(getProperty()==null) {
return null;
}
if(getProperty().equals("")) {
return "";
}
return getProperty();
}
/**
* @return the property
*/
public String getProperty() {
return property;
}
/**
* @param property the property to set
*/
public void setProperty(String property) {
this.property = property;
}
}

View file

@ -0,0 +1,42 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.impl.column;
import com.idcanet.vasc.core.column.VascColumnValue;
import com.idcanet.vasc.core.column.VascTableColumn;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public class NullVascColumnValue implements VascColumnValue {
public Object getValue(VascTableColumn column) {
return null;
}
}

View file

@ -0,0 +1,110 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.impl.serv5;
import java.util.List;
import java.util.logging.Level;
import com.idcanet.serv5.services.hibernate3.Hibernate3Factory;
import com.idcanet.vasc.core.VascDataSource;
import com.idcanet.xtes.xpql.query.Query;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public class Serv5HibernateVascDataSource implements VascDataSource {
private String session = null;
public Serv5HibernateVascDataSource() {
}
public Serv5HibernateVascDataSource(String session) {
setSession(session);
}
public List<Object> executeQuery(Query query) throws Exception {
try {
/*
Query q = Hibernate3Factory.getSession("flowstats").createQuery(query.toString());
q.setMaxResults(crudTable.getQueryLimit());
if(crudTable.getViewOnly()) {
q.setReadOnly(true);
}
for(CrudParameterOption para:crudTable.getQueryParameterOptions().values()) {
if(para.getValueHolder().getValue()==null) {
logger.finer("Value is null of parameter: "+para.getName());
return;
}
try {
Object value = para.getValueHolder().getValue();
logger.finer("Setting parameter: "+para.getName()+" with: "+value);
if(para.getValueProperty()!=null) {
q.setParameter(para.getName(),BeanUtils.getValue(value,BeanUtils.getPropertyDescriptor(value,para.getValueProperty())));
} else {
q.setParameter(para.getName(),value);
}
} catch (Exception e) {
logger.log(Level.WARNING,e.getMessage(),e);
}
}
List data = q.list();
logger.info("Query returned: "+data.size()+" of: "+crudTable.getQueryName());
crudTable.getSelectionInList().setList(data);
*/
return null;
} finally {
Hibernate3Factory.getSession("flowstats").close(); // close session in threads
}
}
public void persist(Object object) throws Exception {
try {
Hibernate3Factory.getSession(getSession()).persist(object);
} finally {
Hibernate3Factory.getSession(getSession()).close();
}
}
/**
* @return the session
*/
public String getSession() {
return session;
}
/**
* @param session the session to set
*/
public void setSession(String session) {
this.session = session;
}
}

View file

@ -0,0 +1,236 @@
/*
* Copyright 2004-2007 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.impl.swt;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.logging.Logger;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import com.idcanet.vasc.core.VascTable;
import com.idcanet.vasc.core.VascUserOption;
import com.idcanet.vasc.core.VascViewRenderer;
import com.idcanet.vasc.core.actions.RowVascAction;
import com.idcanet.vasc.core.column.VascTableColumn;
import fr.jayasoft.binding.jface.adapter.JFaceComponentFactory;
import fr.jayasoft.binding.jface.utils.table.AbstractColumn;
import fr.jayasoft.binding.jface.utils.table.PropertyColumn;
/**
*
* @author Willem Cazander
* @version 1.0 Mar 21, 2007
*/
public class SwtVascViewRenderer implements VascViewRenderer {
private Logger logger = null;
private Composite parent = null;
private VascTable table = null;
public SwtVascViewRenderer(Composite parent) {
logger = Logger.getLogger(SwtVascViewRenderer.class.getName());
this.parent=parent;
}
public void renderView(VascTable table) {
this.table=table;
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
parent.setLayout(layout);
Composite header = new Composite(parent, SWT.NONE);
GridLayout headerLayout = new GridLayout();
headerLayout.numColumns = 6;
header.setLayout(headerLayout);
header.setLayoutData(new GridData(SWT.NONE));
Composite body = new Composite(parent, SWT.NONE);
GridLayout bodyLayout = new GridLayout();
bodyLayout.numColumns = 1;
body.setLayout(bodyLayout);
body.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite footer = new Composite(parent, SWT.NONE);
GridLayout footerLayout = new GridLayout();
footerLayout.numColumns = 6;
footer.setLayout(footerLayout);
footer.setLayoutData(new GridData(SWT.NONE));
createHeader(header);
createBody(body);
createFooter(footer);
// should be last
partCreated();
}
public void createHeader(Composite header) {
logger.finest("Creating header");
header.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Color c = new Color(header.getDisplay(),255,255,255);
header.setBackground(c);
if(table.getHeaderName()!=null) {
Font headerFont = new Font(header.getDisplay(), "verdana", 16, SWT.BOLD);
Label l = new Label(header, SWT.CENTER);
l.setFont(headerFont);
l.setText(table.getVascTextValue().getTextValue(table.getHeaderName()));
l.setBackground(c);
}
// create options
for(VascUserOption option:table.getUserOptions()) {
/*
if(option.getLabelText()!=null) {
Label l = new Label(header,SWT.WRAP);
l.setText(crudTable.i18n(cpo.getLabelText()));
l.setBackground(c);
}
// create ValueHolder
cpo.setValueHolder(new ValueHolder(null));
// create control
cpo.setTempObjectPropertyControl(cpo.getPropertyEditor().createPropertyEditor(header,cpo.getValueHolder()));
cpo.getValueHolder().addPropertyChangeListener(this);
*/
}
}
public void createBody(Composite body) {
logger.finer("Creating body");
final TableViewer tableViewer = JFaceComponentFactory.createTableViewer(body,table.getSelectionInList(),getTableColumns(crudTable),false);
final Table table2 = tableViewer.getTable();
table2.setLayoutData(new GridData(GridData.FILL_BOTH));
table2.setHeaderVisible(true);
table2.setLinesVisible(true);
//Add sort indicator and sort data when column selected
Listener sortListener = new Listener() {
public void handleEvent(Event e) {
// determine new sort column and direction
TableColumn sortColumn = table2.getSortColumn();
TableColumn currentColumn = (TableColumn) e.widget;
int dir = table2.getSortDirection();
if (sortColumn == currentColumn) {
dir = dir == SWT.UP ? SWT.DOWN : SWT.UP;
} else {
table2.setSortColumn(currentColumn);
dir = SWT.UP;
}
// sort the data based on column and direction
String prop = (String)currentColumn.getData("PROP");
List l = new ArrayList(10);
/*
for(int i=0;i<crudTable.getSelectionInList().getSize();i++) {
l.add(crudTable.getSelectionInList().getElementAt(i));
}
BeanPropertyComparator c = new BeanPropertyComparator();
c.setAscending(dir!=SWT.DOWN);
c.setProperty(prop);
Collections.sort(l,c);
crudTable.getSelectionInList().setList(l);
*/
}
};
Integer totalSize = VascTable.getTotalColumnSize(table);
logger.finer("Total size: "+totalSize);
TableColumn[] columns = table2.getColumns();
for (int i = 0; i < columns.length; i++) {
columns[i].pack();
columns[i].setMoveable(true);
columns[i].setResizable(true);
columns[i].addListener(SWT.Selection, sortListener);
//columns[i].setData("PROP",table.getTableColumns().get(i)....);
if(totalSize!=null) {
Integer cWidth = table.getTableColumns().get(i).getWidth();
columns[i].setWidth(cWidth);
/*
columns[i].setWidth((int)((double)tableWidth/(double)totalSize)*cWidth);
logger.finest("Setting column width: "+(int)((double)tableWidth/(double)totalSize)*cWidth+" total: "+totalSize+" c: "+cWidth+" of column: "+i);
*/
}
}
logger.fine("Table with columns created: "+table2.getColumnCount());
}
private static AbstractColumn[] getTableColumns(VascTable crudTable) {
AbstractColumn[] cols = new AbstractColumn[crudTable.getCrudTableColumns().size()];
int i=0;
for(VascTableColumn c:crudTable.getTableColumns()) {
AbstractColumn ac = new PropertyColumn(crudTable.i18n(c.getName()),c.getObjectProperty());
ac.setEditable(false);
ac.setReorderable(true);
ac.setSortable(true);
cols[i]=ac;
i++;
}
return cols;
}
public void createFooter(Composite footer) {
logger.finest("Creating footer");
for(RowVascAction action:table.getRowActions()) {
//action.createActionObject(table);
//Button ton = new Button(footer, SWT.NONE);
//addButton.setText(crudTable.i18n("generic.add"));
//addButton.setImage(crudTable.getImageDescriptor("icons/fam/table_add.png").createImage());
//addButton.addSelectionListener(new AddEvent(crudTable));
//action.
}
}
/**
* Is called when all createPartControl is done with creating Parts
*/
public void partCreated() {
}
}

View file

@ -0,0 +1,20 @@
#
#
# Specify the handlers to create in the root logger
# (all loggers are children of the root logger)
# The following creates two handlers
handlers = java.util.logging.ConsoleHandler
# Set the default logging level for new ConsoleHandler instances
java.util.logging.ConsoleHandler.level = ALL
# Set the default logging level for the root logger
.level = ALL
com.idcanet.x4o = ALL
# Java 6 has internal logging on many builtin libs
sun.level=OFF
java.level=OFF
javax.level=OFF

View file

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<xtes xmlns="http://xtes.idcanet.com/eld/xtes-lang.eld"
xmlns:x4o="http://x4o.idcanet.com/eld/x4o-lang.eld"
>
<query name="limit">
<sql>
LIMIT <parameter name="limit"/>
</sql>
<parameterValue name="limit" value="10" defaultValue="200" type="parameter"/>
</query>
<query name="paging" type="hql">
<sql>
OFFSET <parameter name="offset"/>
<include name="limit"/>
</sql>
<parameterValue name="offset" value="0" defaultValue="0" type="parameter"/>
</query>
<query name="baseSelect">
<x4o:property name="executionTimeout" value="200"/>
<x4o:property name="cacheTimeout" value="99"/>
<x4o:property name="jdniConnection" value="somewhere"/>
<sql>
SELECT
USERS.USERNAME AS USERNAME
USERS.PASSWD AS PASSWORD
FROM
USERS
</sql>
<comment>Bla bla</comment>
<comment>Also see this site http://www.google.com</comment>
</query>
<query name="testUsers2" type="hql">
<x4o:property name="persistanceSession" value="sessionName"/>
<sql>
<!-- SOME COMMENT -->
<include name="baseSelect"/>
<parameter name="extra_where"/>
AND role is in <parameter name="roles"/>
<include name="paging"/>
</sql>
<parameterValue name="extra_where" defaultValue="WHERE true=true" type="raw"/>
<parameterValue name="roles" value="1,12,99,200" type="parameterList"/>
<parameterValue name="limit" value="15"/>
<parameterValue name="offset" value="25"/>
</query>
</xtes>

View file

@ -0,0 +1,115 @@
/*
* Copyright 2004-2006 IDCA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* 2. 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 IDCA 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 IDCA 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.
*
* The views and conclusions contained in the software and documentation are those of the authors and
* should not be interpreted as representing official policies, either expressed or implied, of IDCA.
*/
package com.idcanet.vasc.tests;
import java.io.InputStream;
import java.util.logging.LogManager;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.idcanet.vasc.core.VascTable;
import com.idcanet.vasc.core.column.VascTableColumn;
import com.idcanet.vasc.impl.BeanVascRecordCreator;
import com.idcanet.vasc.impl.DefaultVascTextValue;
import com.idcanet.vasc.impl.column.BeanPropertyVascColumnValue;
import com.idcanet.vasc.impl.serv5.Serv5HibernateVascDataSource;
import com.idcanet.vasc.impl.swt.SwtVascViewRenderer;
import com.idcanet.xtes.core.TemplateStore;
import com.idcanet.xtes.core.XTESParser;
import com.idcanet.xtes.xpql.query.Query;
import junit.framework.TestCase;
/**
* Tests a simple x4o xml language.
*
* @author Willem Cazander
* @version 1.0 Jul 24, 2006
*/
public class SimpleTest extends TestCase {
public void setUp() throws Exception {
// enable all logs
InputStream loggingProperties = this.getClass().getResourceAsStream("/META-INF/logging.properties");
LogManager.getLogManager().readConfiguration( loggingProperties );
loggingProperties.close();
// load xtes queries
}
public void tearDown() throws Exception {
}
public void testAll() throws Exception {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Hello, world!");
XTESParser parser = new XTESParser();
parser.parseResource("/META-INF/xtes/tests.xml");
TemplateStore store = XTESParser.getTemplateStore(parser.getElementContext());
Query query = store.getQuery("testUsers2");
VascTable table = new VascTable();
table.setName("Testje");
table.setHeaderName("TableHeader");
table.setToolTip("tooltip text");
table.setDescription("en de omscheiving");
table.setHelpId("someKey");
table.setVascDataSource(new Serv5HibernateVascDataSource("flowstats"));
table.setVascTextValue(new DefaultVascTextValue());
table.setVascViewRenderer(new SwtVascViewRenderer(shell));
table.setQuery(query);
table.setVascRecordCreator(new BeanVascRecordCreator());
VascTableColumn column = new VascTableColumn();
column.setName("test");
column.setToolTip("tooltip");
column.setDefaultValue("DEFFFFFF");
column.setHelpId("helpColumnKey");
column.setWidth(200);
//column.setVascColumnEditor(vascColumnEditor);
//column.setVascColumnRenderer(vascColumnRenderer);
column.setVascColumnValue(new BeanPropertyVascColumnValue("someValue"));
table.addTableColumns(column);
table.getV
shell.open();
// Set up the event loop.
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
// If no more entries in event queue
display.sleep();
}
}
display.dispose();
}
}