diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-05 09:54:58 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-05 11:31:50 +0200 |
commit | 0c5f51ebbcb7e22baa913e2012e3dcfcc6cf7897 (patch) | |
tree | 3d441110176e37c1a6ba2d15a3653d5023863075 /odk | |
parent | d26540bb05b0443e7988da34372c86f88cbf1f6c (diff) |
java: remove commented out code
Change-Id: I44e2043e5da23bc9421c03e550ef1d8b7ebaad36
Diffstat (limited to 'odk')
16 files changed, 2 insertions, 209 deletions
diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java index 32473a3ce10a..74f53fdaef2c 100644 --- a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java +++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java @@ -65,7 +65,6 @@ import com.sun.star.test.XTestDialogHandler; // ComponentBase, see implementation of TestComponentA. public class DialogComponent { - // public static class _DialogComponent extends WeakBase public static class _DialogComponent implements XTypeProvider, XServiceInfo, XTestDialogHandler, XDialogEventHandler { diff --git a/odk/examples/DevelopersGuide/Config/ConfigExamples.java b/odk/examples/DevelopersGuide/Config/ConfigExamples.java index cac019463982..37debea990ff 100644 --- a/odk/examples/DevelopersGuide/Config/ConfigExamples.java +++ b/odk/examples/DevelopersGuide/Config/ConfigExamples.java @@ -863,8 +863,6 @@ public class ConfigExamples String sSampleDataSourceName = "SampleTextDatabase"; String sSampleDataSourceURL = "sdbc:flat:$(userurl)/database/SampleTextDatabase"; - // String sSampleDataSourceURL = "sdbc:flat:file:///usr/local/database/SampleTextDatabase"; - // String sSampleDataSourceURL = "sdbc:flat:file:///C:/data/database/SampleTextDatabase"; com.sun.star.beans.NamedValue [] aSettings = new com.sun.star.beans.NamedValue [2]; aSettings[0] = new com.sun.star.beans.NamedValue("HeaderLine",new Boolean(true)); diff --git a/odk/examples/DevelopersGuide/Database/Sales.java b/odk/examples/DevelopersGuide/Database/Sales.java index c90ae134b3b1..12f68e9f6b45 100644 --- a/odk/examples/DevelopersGuide/Database/Sales.java +++ b/odk/examples/DevelopersGuide/Database/Sales.java @@ -32,7 +32,6 @@ * *************************************************************************/ -// import com.sun.star.bridge.XUnoUrlResolver; import com.sun.star.uno.*; import com.sun.star.util.Date; import com.sun.star.beans.XPropertySet; diff --git a/odk/examples/DevelopersGuide/Database/SalesMan.java b/odk/examples/DevelopersGuide/Database/SalesMan.java index 0eaa3cdab070..5aead056c4c6 100644 --- a/odk/examples/DevelopersGuide/Database/SalesMan.java +++ b/odk/examples/DevelopersGuide/Database/SalesMan.java @@ -32,7 +32,6 @@ * *************************************************************************/ -// import com.sun.star.bridge.XUnoUrlResolver; import com.sun.star.uno.*; import com.sun.star.util.Date; import com.sun.star.sdbc.*; diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java index 0bc329cd26a7..ac8d6430874b 100644 --- a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java +++ b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java @@ -161,159 +161,3 @@ public class FirstLoadComponent { } } - - -// import com.sun.star.uno.UnoRuntime; -// import com.sun.star.uno.XComponentContext; -// import com.sun.star.lang.XMultiComponentFactory; -// import com.sun.star.lang.XComponent; -// import com.sun.star.beans.XPropertySet; -// import com.sun.star.beans.PropertyValue; -// import com.sun.star.sheet.XSpreadsheetDocument; -// import com.sun.star.sheet.XSpreadsheets; -// import com.sun.star.sheet.XSpreadsheet; -// import com.sun.star.sheet.XSpreadsheetView; -// import com.sun.star.sheet.XCellRangesQuery; -// import com.sun.star.sheet.XSheetCellRanges; -// import com.sun.star.sheet.XCellAddressable; -// import com.sun.star.table.XCell; -// import com.sun.star.frame.XModel; -// import com.sun.star.frame.XController; -// import com.sun.star.frame.XComponentLoader; -// import com.sun.star.container.XEnumeration; -// import com.sun.star.container.XEnumerationAccess; - -// import com.sun.star.uno.AnyConverter; - -// public class FirstLoadComponent { - -// /** Creates a new instance of FirstLoadComponent */ -// public FirstLoadComponent() { -// } - -// /** -// * @param args the command line arguments -// */ -// private XComponentContext xRemoteContext = null; -// private XMultiComponentFactory xRemoteServiceManager = null; - -// public static void main(String[] args) { -// FirstLoadComponent firstLoadComponent1 = new FirstLoadComponent(); -// try { -// firstLoadComponent1.useConnection(); -// } -// catch (java.lang.Exception e){ -// System.out.println(e.getMessage()); -// e.printStackTrace(); -// } -// finally { -// System.exit(0); -// } -// } - -// private void useConnection() throws java.lang.Exception { -// try { -// // get the remote office component context -// xRemoteContext = com.sun.star.comp.helper.Bootstrap.bootstrap(); -// System.out.println("Connected to a running office ..."); - -// xRemoteServiceManager = xRemoteContext.getServiceManager(); -// } -// catch( Exception e) { -// e.printStackTrace(); -// System.exit(1); -// } - -// try { -// Object desktop = xRemoteServiceManager.createInstanceWithContext( -// "com.sun.star.frame.Desktop", xRemoteContext); -// XComponentLoader xComponentLoader = (XComponentLoader) -// UnoRuntime.queryInterface(XComponentLoader.class, desktop); - -// PropertyValue[] loadProps = new PropertyValue[0]; -// XComponent xSpreadsheetComponent = xComponentLoader.loadComponentFromURL("private:factory/scalc", "_blank", 0, loadProps); - -// XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument) -// UnoRuntime.queryInterface(XSpreadsheetDocument.class, -// xSpreadsheetComponent); - -// XSpreadsheets xSpreadsheets = xSpreadsheetDocument.getSheets(); -// xSpreadsheets.insertNewByName("MySheet", (short)0); -// com.sun.star.uno.Type elemType = xSpreadsheets.getElementType(); - -// System.out.println(elemType.getTypeName()); -// Object sheet = xSpreadsheets.getByName("MySheet"); -// XSpreadsheet xSpreadsheet = (XSpreadsheet)UnoRuntime.queryInterface( -// XSpreadsheet.class, sheet); - -// XCell xCell = xSpreadsheet.getCellByPosition(0, 0); -// xCell.setValue(21); -// xCell = xSpreadsheet.getCellByPosition(0, 1); -// xCell.setValue(21); -// xCell = xSpreadsheet.getCellByPosition(0, 2); -// xCell.setFormula("=sum(A1:A2)"); - -// XPropertySet xCellProps = (XPropertySet)UnoRuntime.queryInterface( -// XPropertySet.class, xCell); -// xCellProps.setPropertyValue("CellStyle", "Result"); - -// XModel xSpreadsheetModel = (XModel)UnoRuntime.queryInterface( -// XModel.class, xSpreadsheetComponent); -// XController xSpreadsheetController = xSpreadsheetModel.getCurrentController(); -// XSpreadsheetView xSpreadsheetView = (XSpreadsheetView) -// UnoRuntime.queryInterface(XSpreadsheetView.class, -// xSpreadsheetController); -// xSpreadsheetView.setActiveSheet(xSpreadsheet); - -// // ********************************************************* -// // example for use of enum types -// xCellProps.setPropertyValue("VertJustify", -// com.sun.star.table.CellVertJustify.TOP); - - -// // ********************************************************* -// // example for a sequence of PropertyValue structs -// // create an array with one PropertyValue struct, it contains -// // references only -// loadProps = new PropertyValue[1]; - -// // instantiate PropertyValue struct and set its member fields -// PropertyValue asTemplate = new PropertyValue(); -// asTemplate.Name = "AsTemplate"; -// asTemplate.Value = new Boolean(true); - -// // assign PropertyValue struct to array of references for PropertyValue -// // structs -// loadProps[0] = asTemplate; - -// // load calc file as template -// //xSpreadsheetComponent = xComponentLoader.loadComponentFromURL( -// // "file:///c:/temp/DataAnalysys.ods", "_blank", 0, loadProps); - -// // ********************************************************* -// // example for use of XEnumerationAccess -// XCellRangesQuery xCellQuery = (XCellRangesQuery) -// UnoRuntime.queryInterface(XCellRangesQuery.class, sheet); -// XSheetCellRanges xFormulaCells = xCellQuery.queryContentCells( -// (short)com.sun.star.sheet.CellFlags.FORMULA); -// XEnumerationAccess xFormulas = xFormulaCells.getCells(); -// XEnumeration xFormulaEnum = xFormulas.createEnumeration(); - -// while (xFormulaEnum.hasMoreElements()) { -// Object formulaCell = xFormulaEnum.nextElement(); -// xCell = (XCell)UnoRuntime.queryInterface(XCell.class, formulaCell); -// XCellAddressable xCellAddress = (XCellAddressable) -// UnoRuntime.queryInterface(XCellAddressable.class, xCell); -// System.out.println("Formula cell in column " + -// xCellAddress.getCellAddress().Column -// + ", row " + xCellAddress.getCellAddress().Row -// + " contains " + xCell.getFormula()); -// } - -// } -// catch( com.sun.star.lang.DisposedException e ) { //works from Patch 1 -// xRemoteContext = null; -// throw e; -// } -// } -// } diff --git a/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java b/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java index a5097b1d0621..10bdcc37f2b8 100644 --- a/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java +++ b/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java @@ -60,7 +60,6 @@ import com.sun.star.awt.XItemEventBroadcaster; import com.sun.star.awt.XItemListener; import com.sun.star.awt.XKeyListener; import com.sun.star.awt.XListBox; -//import com.sun.star.awt.XMessageBoxFactory; import com.sun.star.awt.XMouseListener; import com.sun.star.awt.XPointer; import com.sun.star.awt.XReschedule; diff --git a/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetDocHelper.java b/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetDocHelper.java index 5cc0b4a1ac04..dbdbc8004df2 100644 --- a/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetDocHelper.java +++ b/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetDocHelper.java @@ -51,7 +51,6 @@ public class SpreadsheetDocHelper private com.sun.star.uno.XComponentContext mxRemoteContext; private com.sun.star.lang.XMultiComponentFactory mxRemoteServiceManager; -// private com.sun.star.lang.XMultiServiceFactory mxMSFactory; private com.sun.star.sheet.XSpreadsheetDocument mxDocument; diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/EditorFrame.java b/odk/examples/java/EmbedDocument/EmbeddedObject/EditorFrame.java index e75d1eec3f4e..4c9dc1b23d62 100644 --- a/odk/examples/java/EmbedDocument/EmbeddedObject/EditorFrame.java +++ b/odk/examples/java/EmbedDocument/EmbeddedObject/EditorFrame.java @@ -34,7 +34,6 @@ public class EditorFrame extends JFrame { public void windowClosing( WindowEvent e ) { - // m_aBufImage = m_aTextArea.getGraphicsConfiguration().createCompatibleImage( m_aTextArea.getWidth(), m_aTextArea.getHeight() ); m_aBufImage = new BufferedImage( m_aTextArea.getWidth(), m_aTextArea.getHeight(), BufferedImage.TYPE_INT_RGB ); Graphics2D aGr = m_aBufImage.createGraphics(); m_aTextArea.paintAll( aGr ); @@ -54,7 +53,6 @@ public class EditorFrame extends JFrame add( "Center", m_aTextArea ); pack(); - // setResizable( false ); } public String getText() @@ -82,8 +80,6 @@ public class EditorFrame extends JFrame setSize( aToSet ); validate(); - - // pack(); } public byte[] getReplacementImage() diff --git a/odk/examples/java/Inspector/Inspector.java b/odk/examples/java/Inspector/Inspector.java index 62c8f195b300..34624936466d 100644 --- a/odk/examples/java/Inspector/Inspector.java +++ b/odk/examples/java/Inspector/Inspector.java @@ -81,8 +81,6 @@ public class Inspector{ private HashMap<String, String> aApplicationHashMap = new HashMap<String, String>(); private String sTitle = "Object Inspector"; private ArrayList<XComponent> aHiddenDocuments = new ArrayList<XComponent>(); -// private String[] sApplicationDocUrls = new String[]{"private:factory/swriter", "private:factory/scalc", "private:factory/simpress", "private:factory/sdraw", "private:factory/sbase"}; -// private String[] sApplicationDocNames = new String[]{"Text Document", "Spreadsheet", "Presentation", "Drawing", "Database"}; private XComponentContext m_xComponentContext; private HashMap<String, InspectorPane> aInspectorPanes = new HashMap<String, InspectorPane>(); private XDialogProvider m_oSwingDialogProvider; @@ -100,7 +98,6 @@ public class Inspector{ aApplicationHashMap.put("private:factory/sdraw", "Drawing"); aApplicationHashMap.put("private:factory/smath", "Formula"); m_oSwingDialogProvider = new SwingDialogProvider(this, sTitle); -// aApplicationHashMap.put("private:factory/sbase", "Database"); } diff --git a/odk/examples/java/Inspector/InspectorAddon.java b/odk/examples/java/Inspector/InspectorAddon.java index b32bde1d2dfc..bf84f25a46c4 100644 --- a/odk/examples/java/Inspector/InspectorAddon.java +++ b/odk/examples/java/Inspector/InspectorAddon.java @@ -220,7 +220,4 @@ public class InspectorAddon { return Factory.writeRegistryServiceInfo(InspectorAddonImpl.class.getName(), InspectorAddonImpl.getServiceNames(), regKey); } -// __create( XComponentContext ){ - -// } } diff --git a/odk/examples/java/Inspector/InspectorPane.java b/odk/examples/java/Inspector/InspectorPane.java index 2f0d2c5c66ec..f3812d7ccff4 100644 --- a/odk/examples/java/Inspector/InspectorPane.java +++ b/odk/examples/java/Inspector/InspectorPane.java @@ -613,14 +613,11 @@ import com.sun.star.uno.XComponentContext; public void showPopUpMenu(Object _invoker, int x, int y) throws ClassCastException{ XUnoNode oUnoNode = getSelectedNode(); boolean bdoEnableInvoke = oUnoNode instanceof XUnoMethodNode; -// boolean bdoEnableSourceCodeGeneration = true; if (bdoEnableInvoke){ XUnoMethodNode oUnoMethodNode = (XUnoMethodNode) oUnoNode; bdoEnableInvoke = oUnoMethodNode.isInvokable(); -// bdoEnableSourceCodeGeneration = bdoEnableInvoke; } m_xDialogProvider.enablePopupMenuItem(XDialogProvider.SINVOKE, bdoEnableInvoke); -// m_xDialogProvider.enablePopupMenuItem(XDialogProvider.SADDTOSOURCECODE, bdoEnableSourceCodeGeneration); m_xDialogProvider.showPopUpMenu(_invoker, x, y); } } diff --git a/odk/examples/java/Inspector/SourceCodeGenerator.java b/odk/examples/java/Inspector/SourceCodeGenerator.java index 8ccba8bba944..7e158afd04ad 100644 --- a/odk/examples/java/Inspector/SourceCodeGenerator.java +++ b/odk/examples/java/Inspector/SourceCodeGenerator.java @@ -768,7 +768,6 @@ class UnoObjectDefinition{ } else{ bleaveloop = true; - // throw new NullPointerException("SourceCode Variable " + _sStemVariableName + " not defined"); } } } @@ -965,7 +964,6 @@ class UnoObjectDefinition{ bIsPropertyUnoObjectDefined = true; } sReturn += _sReturnVariableName + " = (" + sShortTypeName + ") AnyConverter.toObject(" + sShortTypeName + ".class, oUnoObject);"; -// this.bAddTypeImport = true; break; } if (!bAddAnyConverter){ @@ -1008,7 +1006,6 @@ class UnoObjectDefinition{ sReturn += ";"; sReturn = "\t" + sReturn; return sReturn; -// return "\t" + _sReturnVariableName + " = " + _sIncomingObjectName + ".getPropertyValue(\"" + _sPropertyName + "\");"; } @@ -1461,7 +1458,7 @@ class UnoObjectDefinition{ private String getHeaderOfClass(String _sClassName){ - return "#include \"" + _sClassName.replace('.', '/') + ".hpp\"\n"; // #include <com/sun/star/uno/XComponentContext.hpp> + return "#include \"" + _sClassName.replace('.', '/') + ".hpp\"\n"; } @@ -1682,7 +1679,6 @@ class UnoObjectDefinition{ public String getVariableDeclaration(String _sTypeString, String _sVariableName, boolean bIsArray, TypeClass _aTypeClass, boolean _bInitialize){ boolean bIsPrimitive = Introspector.isPrimitive(_aTypeClass); - // uno::Reference< frame::XDispatch > m_xDispatch String sReturn = ""; if (bIsArray){ bIncludeSequenceHeader = true; diff --git a/odk/examples/java/Inspector/SwingDialogProvider.java b/odk/examples/java/Inspector/SwingDialogProvider.java index 5f5a31b8818d..29774f93a6ca 100644 --- a/odk/examples/java/Inspector/SwingDialogProvider.java +++ b/odk/examples/java/Inspector/SwingDialogProvider.java @@ -423,7 +423,6 @@ public class SwingDialogProvider implements XDialogProvider{ else{ m_jInspectorDialog.pack(); } -// m_jInspectorDialog.paint(m_jInspectorDialog.getGraphics()); m_jInspectorDialog.setVisible(true); } diff --git a/odk/examples/java/Inspector/TestInspector.java b/odk/examples/java/Inspector/TestInspector.java index 804ad755630a..d1282ea7bacf 100644 --- a/odk/examples/java/Inspector/TestInspector.java +++ b/odk/examples/java/Inspector/TestInspector.java @@ -81,6 +81,5 @@ public class TestInspector { System.err.println( e + e.getMessage()); e.printStackTrace(); } -// System.exit( 0 ); } } diff --git a/odk/examples/java/Inspector/UnoNode.java b/odk/examples/java/Inspector/UnoNode.java index 7846dbd6a649..da182dd28dfe 100644 --- a/odk/examples/java/Inspector/UnoNode.java +++ b/odk/examples/java/Inspector/UnoNode.java @@ -228,20 +228,6 @@ public class UnoNode{ } -// public static String getServiceDescription(Object _oUnoObject){ -// String sClassName = ""; -// XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, _oUnoObject); -// if (xServiceInfo != null){ -// String[] sChildServiceNames = removeMandatoryServiceNames(xServiceInfo.getSupportedServiceNames()); -// if (sChildServiceNames.length > 0){ -// sClassName = sChildServiceNames[0]; -// } -// } -// return sClassName; -// } - - - private static String[] getMandatoryServiceNames(String _sServiceName){ String[] sMandatoryServiceNames = new String[]{}; try { diff --git a/odk/examples/java/Inspector/UnoTreeRenderer.java b/odk/examples/java/Inspector/UnoTreeRenderer.java index 67080baceba9..fb3295ca3899 100644 --- a/odk/examples/java/Inspector/UnoTreeRenderer.java +++ b/odk/examples/java/Inspector/UnoTreeRenderer.java @@ -81,28 +81,19 @@ public class UnoTreeRenderer extends DefaultTreeCellRenderer{ String sLabelText = (String)node.getUserObject(); if (sLabelText != null){ if (sLabelText.equals(XUnoFacetteNode.SCONTAINERDESCRIPTION)){ -// setIcon(m_oContainerIcon); } else if (sLabelText.equals(XUnoFacetteNode.SCONTENTDESCRIPTION)){ -// setIcon(m_oContentIcon); } else if (sLabelText.equals(XUnoFacetteNode.SINTERFACEDESCRIPTION)){ -// setIcon(m_oInterfaceIcon); } else if (sLabelText.equals(XUnoFacetteNode.SMETHODDESCRIPTION)){ -// setIcon(m_oMethodIcon); } else if (sLabelText.equals(XUnoFacetteNode.SPROPERTYDESCRIPTION)){ -// setIcon(m_oPropertyIcon); } else if (sLabelText.startsWith(XUnoFacetteNode.SPROPERTYINFODESCRIPTION)){ -// setIcon(m_oPropertyIcon); } else if (sLabelText.equals(XUnoFacetteNode.SPROPERTYVALUEDESCRIPTION)){ -// setIcon(m_oPropertyValueIcon); } else if (sLabelText.equals(XUnoFacetteNode.SSERVICEDESCRIPTION)){ -// setIcon(m_oServiceIcon); } else{ setText(sLabelText); rc.validate(); } - setSize(getPreferredSize()); //fm.stringWidth(sLabelText), (int) getSize().getHeight()); + setSize(getPreferredSize()); rc.validate(); -// nWidth = (int) rc.getPreferredSize().getWidth(); doLayout(); } } catch (RuntimeException e) { @@ -123,8 +114,6 @@ public class UnoTreeRenderer extends DefaultTreeCellRenderer{ x = getIcon().getIconWidth() + getIconTextGap(); } g.setColor(getForeground()); -// g.fillRect(x,y,x + fm.stringWidth(getText()),y); -// System.out.println("Text: " + getText()); super.paintComponent(g); } } |