summaryrefslogtreecommitdiff
path: root/odk
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-12 12:11:25 +0200
committerNoel Grandin <noel@peralex.com>2014-08-19 14:57:13 +0200
commit3a8d3519889a68ddf209ea7c83307bec51cd6da0 (patch)
treeab67ef1b6f1f65443b7c4d0e086fdcff17f84283 /odk
parent8b65a61788aa18e97de068bc75fdeecb20a23026 (diff)
java: remove unused methods
Change-Id: Ibb905e6f3e7d92a0e558f1f6562e5b472cd2717b
Diffstat (limited to 'odk')
-rw-r--r--odk/examples/DevelopersGuide/Database/Sales.java44
-rw-r--r--odk/examples/DevelopersGuide/Forms/HsqlDatabase.java18
-rw-r--r--odk/examples/DevelopersGuide/GUI/UnoDialogSample.java21
-rw-r--r--odk/examples/java/Inspector/HideableTreeModel.java36
-rw-r--r--odk/examples/java/Inspector/SourceCodeGenerator.java91
5 files changed, 1 insertions, 209 deletions
diff --git a/odk/examples/DevelopersGuide/Database/Sales.java b/odk/examples/DevelopersGuide/Database/Sales.java
index ff1ec6555761..7a983c727ec9 100644
--- a/odk/examples/DevelopersGuide/Database/Sales.java
+++ b/odk/examples/DevelopersGuide/Database/Sales.java
@@ -33,7 +33,6 @@
*************************************************************************/
import com.sun.star.uno.*;
-import com.sun.star.util.Date;
import com.sun.star.beans.XPropertySet;
import com.sun.star.sdbc.*;
@@ -108,49 +107,6 @@ public class Sales
- // inserts a row programmatically.
- private void insertRow() throws com.sun.star.uno.Exception
- {
- // example for a programmatic way to do updates.
- XStatement stmt = con.createStatement();
- XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,stmt);
- xProp.setPropertyValue("ResultSetType", new java.lang.Integer(ResultSetType.SCROLL_INSENSITIVE));
- xProp.setPropertyValue("ResultSetConcurrency", new java.lang.Integer(ResultSetConcurrency.UPDATABLE));
- XResultSet rs = stmt.executeQuery("SELECT * FROM SALES");
- XRow row = UnoRuntime.queryInterface(XRow.class,rs);
-
- // insert a new row
- XRowUpdate updateRow = UnoRuntime.queryInterface(XRowUpdate.class,rs);
- XResultSetUpdate updateRs = UnoRuntime. queryInterface(XResultSetUpdate.class,rs);
- updateRs.moveToInsertRow();
- updateRow.updateInt(1, 4);
- updateRow.updateInt(2, 102);
- updateRow.updateInt(3, 5);
- updateRow.updateString(4, "FTOP Darjeeling tea");
- updateRow.updateDate(5, new Date((short)1,(short)2,(short)2002));
- updateRow.updateFloat(6, 150);
- updateRs.insertRow();
- }
-
- // deletes a row programmatically.
- private void deleteRow() throws com.sun.star.uno.Exception
- {
- // example for a programmatic way to do updates.
- XStatement stmt = con.createStatement();
- XPropertySet xProp = UnoRuntime.queryInterface(XPropertySet.class,stmt);
- xProp.setPropertyValue("ResultSetType", new java.lang.Integer(ResultSetType.SCROLL_INSENSITIVE));
- xProp.setPropertyValue("ResultSetConcurrency", new java.lang.Integer(ResultSetConcurrency.UPDATABLE));
- XResultSet rs = stmt.executeQuery("SELECT * FROM SALES");
- XRow row = UnoRuntime.queryInterface(XRow.class,rs);
-
- XResultSetUpdate updateRs = UnoRuntime. queryInterface(XResultSetUpdate.class,rs);
- // move to the inserted row
- rs.absolute(4);
- updateRs.deleteRow();
- }
-
-
-
// displays the column names
public void displayColumnNames() throws com.sun.star.uno.Exception
{
diff --git a/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java b/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java
index 8350c9291690..311908d313dc 100644
--- a/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java
+++ b/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java
@@ -89,24 +89,6 @@ public class HsqlDatabase
storable.storeAsURL( m_databaseDocumentFile, new PropertyValue[]{} );
}
- /** returns a connection to the database
- *
- * Multiple calls to this method return the same connection. The HsqlDatabase object keeps
- * the ownership of the connection, so you don't need to (and should not) dispose/close it.
- *
- */
- private XConnection defaultConnection() throws SQLException
- {
- if ( m_connection != null )
- return m_connection;
- m_connection = m_databaseDocument.getDataSource().getConnection(new String(),new String());
- return m_connection;
- }
-
-
-
-
-
/** closes the database document
*
* Any CloseVetoExceptions fired by third parties are ignored, and any reference to the
diff --git a/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java b/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java
index 5bf285392333..3c52f56fd10e 100644
--- a/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java
+++ b/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java
@@ -70,10 +70,8 @@ import com.sun.star.awt.XToolkit;
import com.sun.star.awt.XTopWindow;
import com.sun.star.awt.XWindow;
import com.sun.star.awt.XWindowPeer;
-import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XMultiPropertySet;
import com.sun.star.beans.XPropertySet;
-import com.sun.star.configuration.theDefaultProvider;
import com.sun.star.container.XIndexContainer;
import com.sun.star.container.XNameAccess;
import com.sun.star.container.XNameContainer;
@@ -184,25 +182,6 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
- private XNameAccess getRegistryKeyContent(String _sKeyName){
- try {
- PropertyValue[] aNodePath = new PropertyValue[1];
- XMultiServiceFactory xMSFConfig = theDefaultProvider.get(m_xContext);
- aNodePath[0] = new PropertyValue();
- aNodePath[0].Name = "nodepath";
- aNodePath[0].Value = _sKeyName;
- Object oNode = xMSFConfig.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aNodePath);
- XNameAccess xNameAccess = UnoRuntime.queryInterface(XNameAccess.class, oNode);
- return xNameAccess;
- } catch (Exception exception) {
- exception.printStackTrace(System.err);
- return null;
- }
- }
-
-
-
-
protected void createDialog(XMultiComponentFactory _xMCF) {
try {
Object oDialogModel = _xMCF.createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", m_xContext);
diff --git a/odk/examples/java/Inspector/HideableTreeModel.java b/odk/examples/java/Inspector/HideableTreeModel.java
index 6fea28681b7b..dae9d0cdff0a 100644
--- a/odk/examples/java/Inspector/HideableTreeModel.java
+++ b/odk/examples/java/Inspector/HideableTreeModel.java
@@ -17,9 +17,6 @@
*/
import java.util.ArrayList;
-import java.util.Enumeration;
-
-import javax.swing.JTree;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.tree.TreeModel;
@@ -87,14 +84,6 @@ public class HideableTreeModel implements TreeModel {
- private void reload(Object node) {
- if(node != null) {
- TreePath tp = new TreePath(getPathToRoot(node));
- fireTreeStructureChanged(new TreeModelEvent(this, tp));
- }
- }
-
-
public void valueForPathChanged(TreePath path, Object newValue) {
nodeChanged(path.getLastPathComponent());
}
@@ -153,30 +142,7 @@ public class HideableTreeModel implements TreeModel {
}
}
- private void fireTreeStructureChanged(TreeModelEvent event) {
- for(TreeModelListener l : modelListeners) {
- l.treeStructureChanged(event);
- }
- }
-
-
-
-
-
- private void addExpandedPaths(JTree tree, TreePath path, ArrayList<TreePath> pathlist) {
- Enumeration aEnum = tree.getExpandedDescendants(path);
- while(aEnum.hasMoreElements()) {
- TreePath tp = (TreePath) aEnum.nextElement();
- pathlist.add(tp);
- addExpandedPaths(tree, tp, pathlist);
- }
- }
-
-
-
-
-
- public boolean isLeaf(Object _oNode) {
+ public boolean isLeaf(Object _oNode) {
if(_oNode instanceof TreeNode) {
return ((TreeNode) _oNode).isLeaf();
}
diff --git a/odk/examples/java/Inspector/SourceCodeGenerator.java b/odk/examples/java/Inspector/SourceCodeGenerator.java
index 5444c7aec8ca..2eae0ff44f22 100644
--- a/odk/examples/java/Inspector/SourceCodeGenerator.java
+++ b/odk/examples/java/Inspector/SourceCodeGenerator.java
@@ -613,23 +613,11 @@ private class UnoObjectDefinition{
}
- public void setTypeClass(TypeClass _aTypeClass){
- sVariableStemName = "";
- m_aTypeClass = _aTypeClass;
- }
-
-
public TypeClass getTypeClass(){
return m_aTypeClass;
}
- public void setTypeName(String _sTypeName){
- sVariableStemName = "";
- m_sTypeName = _sTypeName;
- }
-
-
public String getTypeName(){
return m_sTypeName;
}
@@ -1080,10 +1068,6 @@ private class UnoObjectDefinition{
return "short";
}
- public String getunsignedshortTypeDescription(){
- return "short";
- }
-
public String getlongTypeDescription(){
return "int";
}
@@ -1121,15 +1105,6 @@ private class UnoObjectDefinition{
}
}
- public String gettypeTypeDescription(boolean _bAsHeaderSourceCode){
- if (_bAsHeaderSourceCode){
- return "com.sun.star.uno.Type";
- }
- else{
- return "Type";
- }
- }
-
public String getanyTypeDescription(boolean _bAsHeaderSourceCode){
if (_bAsHeaderSourceCode){
return "";
@@ -1157,21 +1132,6 @@ private class UnoObjectDefinition{
}
- public String getArrayDeclaration(String _sVariableDeclaration){
- String sReturn = "";
- String[] sDeclarations = _sVariableDeclaration.split(" ");
- for (int i = 0; i< sDeclarations.length;i++){
- sReturn += sDeclarations[i];
- if (i == 0){
- sReturn += "[]";
- }
- if (i < (sDeclarations.length -1)){
- sReturn += " ";
- }
- }
- return sReturn;
- }
-
public String getCommentSign(){
return "//";
}
@@ -1280,10 +1240,6 @@ private class UnoObjectDefinition{
return "Integer";
}
- public String getunsignedshortTypeDescription(){
- return "Integer";
- }
-
public String getlongTypeDescription(){
return "Integer";
}
@@ -1321,15 +1277,6 @@ private class UnoObjectDefinition{
}
}
- public String gettypeTypeDescription(boolean _bAsHeaderSourceCode){
- if (_bAsHeaderSourceCode){
- return "";
- }
- else{
- return "Object";
- }
- }
-
public String getanyTypeDescription(boolean _bAsHeaderSourceCode){
if (_bAsHeaderSourceCode){
return "";
@@ -1361,21 +1308,6 @@ private class UnoObjectDefinition{
}
- public String getArrayDeclaration(String _sVariableDeclaration){
- String sReturn = "";
- String[] sDeclarations = _sVariableDeclaration.split(" ");
- for (int i = 0; i< sDeclarations.length;i++){
- sReturn += sDeclarations[i];
- if (i == 0){
- sReturn += "[]";
- }
- if (i < (sDeclarations.length -1)){
- sReturn += " ";
- }
- }
- return sReturn;
- }
-
public String getCommentSign(){
return "'";
}
@@ -1596,10 +1528,6 @@ private class UnoObjectDefinition{
return "sal_Int16";
}
- public String getunsignedshortTypeDescription(){
- return "sal_uInt16";
- }
-
public String getlongTypeDescription(){
return "sal_Int32";
}
@@ -1638,15 +1566,6 @@ private class UnoObjectDefinition{
}
}
- public String gettypeTypeDescription(boolean _bAsHeaderSourceCode){
- if (_bAsHeaderSourceCode){
- return "com/sun/star/uno/Type";
- }
- else{
- return "Type";
- }
- }
-
public String getanyTypeDescription(boolean _bAsHeaderSourceCode){
if (_bAsHeaderSourceCode){
return "com/sun/star/uno/XInterface";
@@ -1705,16 +1624,6 @@ private class UnoObjectDefinition{
return sReturn;
}
- public String getArrayDeclaration(String _sVariableDeclaration){
- this.bIncludeSequenceHeader = true;
- String sReturn = "";
- String[] sDeclarations = _sVariableDeclaration.split(" ");
- if (sDeclarations.length == 2){
- sReturn = getCSSNameSpaceString() +"::uno::Sequence<" + sDeclarations[1] + ">";
- }
- return sReturn;
- }
-
public String getCommentSign(){
return "//";
}