Kaydet (Commit) f3a1308b authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS dba24e_SRC680 (1.11.6); FILE MERGED

2007/12/19 12:28:45 oj 1.11.6.1: #i84339# handle refcount by releasing the objects as early as possible, gc is not alsways the best way to trust :-)
üst 85038dfa
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: TableWizard.java,v $ * $RCSfile: TableWizard.java,v $
* *
* $Revision: 1.11 $ * $Revision: 1.12 $
* *
* last change: $Author: ihi $ $Date: 2007-11-21 16:43:42 $ * last change: $Author: vg $ $Date: 2008-01-29 08:43:36 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -34,14 +34,15 @@ ...@@ -34,14 +34,15 @@
************************************************************************/ ************************************************************************/
package com.sun.star.wizards.table; package com.sun.star.wizards.table;
import java.util.Calendar;
import java.util.Hashtable; import java.util.Hashtable;
import com.sun.star.awt.TextEvent; import com.sun.star.awt.TextEvent;
import com.sun.star.awt.VclWindowPeerAttribute; import com.sun.star.awt.VclWindowPeerAttribute;
import com.sun.star.awt.XTextListener; import com.sun.star.awt.XTextListener;
import com.sun.star.beans.PropertyValue; import com.sun.star.beans.PropertyValue;
import com.sun.star.lang.EventObject; import com.sun.star.beans.XPropertySet;
import com.sun.star.frame.XFrame;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XInitialization; import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.sdb.CommandType; import com.sun.star.sdb.CommandType;
...@@ -75,6 +76,8 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet ...@@ -75,6 +76,8 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet
public static final int SOPRIMARYKEYPAGE = 3; public static final int SOPRIMARYKEYPAGE = 3;
public static final int SOFINALPAGE = 4; public static final int SOFINALPAGE = 4;
private String sMsgColumnAlreadyExists = ""; private String sMsgColumnAlreadyExists = "";
XComponent[] components = null;
XFrame CurFrame;
String WizardHeaderText[] = new String[8]; String WizardHeaderText[] = new String[8];
...@@ -101,7 +104,7 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet ...@@ -101,7 +104,7 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet
case SOFIELDSFORMATPAGE: case SOFIELDSFORMATPAGE:
curFieldFormatter.updateColumnofColumnDescriptor(); curFieldFormatter.updateColumnofColumnDescriptor();
String[] sfieldnames = curFieldFormatter.getFieldNames(); String[] sfieldnames = curFieldFormatter.getFieldNames();
super.setStepEnabled(this.SOFIELDSFORMATPAGE, sfieldnames.length > 0); super.setStepEnabled(SOFIELDSFORMATPAGE, sfieldnames.length > 0);
curScenarioSelector.setSelectedFieldNames(sfieldnames); curScenarioSelector.setSelectedFieldNames(sfieldnames);
break; break;
case SOPRIMARYKEYPAGE: case SOPRIMARYKEYPAGE:
...@@ -260,9 +263,9 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet ...@@ -260,9 +263,9 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet
wizardmode = curFinalizer.finish(); wizardmode = curFinalizer.finish();
if (createTable()){ if (createTable()){
if (wizardmode == Finalizer.MODIFYTABLEMODE) if (wizardmode == Finalizer.MODIFYTABLEMODE)
curTableDescriptor.switchtoDesignmode(curTableDescriptor.getComposedTableName(), com.sun.star.sdb.CommandType.TABLE); components = curTableDescriptor.switchtoDesignmode(curTableDescriptor.getComposedTableName(), com.sun.star.sdb.CommandType.TABLE,CurFrame);
else if (wizardmode == Finalizer.WORKWITHTABLEMODE) else if (wizardmode == Finalizer.WORKWITHTABLEMODE)
curTableDescriptor.switchtoDataViewmode(curTableDescriptor.getComposedTableName(), com.sun.star.sdb.CommandType.TABLE); components = curTableDescriptor.switchtoDataViewmode(curTableDescriptor.getComposedTableName(), com.sun.star.sdb.CommandType.TABLE,CurFrame);
super.xDialog.endExecute(); super.xDialog.endExecute();
} }
} }
...@@ -287,6 +290,9 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet ...@@ -287,6 +290,9 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet
xInitialization.initialize(aProperties); xInitialization.initialize(aProperties);
XJobExecutor xJobExecutor = (XJobExecutor) UnoRuntime.queryInterface(XJobExecutor.class, oFormWizard); XJobExecutor xJobExecutor = (XJobExecutor) UnoRuntime.queryInterface(XJobExecutor.class, oFormWizard);
xJobExecutor.trigger("start"); xJobExecutor.trigger("start");
XPropertySet prop = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,xJobExecutor);
components[0] = (XComponent)prop.getPropertyValue("Document");
components[1] = (XComponent)prop.getPropertyValue("DocumentDefinition");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(System.out); e.printStackTrace(System.out);
}} }}
...@@ -311,32 +317,37 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet ...@@ -311,32 +317,37 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet
} }
public void startTableWizard(XMultiServiceFactory _xMSF, PropertyValue[] CurPropertyValue){ public XComponent[] startTableWizard(XMultiServiceFactory _xMSF, PropertyValue[] CurPropertyValue){
try{ try{
curTableDescriptor = new TableDescriptor(xMSF, super.xWindow, this.sMsgColumnAlreadyExists); curTableDescriptor = new TableDescriptor(xMSF, super.xWindow, this.sMsgColumnAlreadyExists);
if (curTableDescriptor.getConnection(CurPropertyValue)){ if (curTableDescriptor.getConnection(CurPropertyValue)){
buildSteps(); if (Properties.hasPropertyValue(CurPropertyValue, "ParentFrame"))
createWindowPeer(); CurFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class,Properties.getPropertyValue(CurPropertyValue, "ParentFrame"));
curTableDescriptor.setWindowPeer(this.xControl.getPeer()); else
// setAutoMnemonic("lblDialogHeader", false); CurFrame = Desktop.getActiveFrame(xMSF);
insertFormRelatedSteps(); buildSteps();
short RetValue = executeDialog(); createWindowPeer();
boolean bdisposeDialog = true; curTableDescriptor.setWindowPeer(this.xControl.getPeer());
xComponent.dispose(); // setAutoMnemonic("lblDialogHeader", false);
switch (RetValue){ insertFormRelatedSteps();
case 0: // via Cancelbutton or via sourceCode with "endExecute" short RetValue = executeDialog();
if (wizardmode == Finalizer.STARTFORMWIZARDMODE) xComponent.dispose();
callFormWizard(); switch (RetValue){
break; case 0: // via Cancelbutton or via sourceCode with "endExecute"
case 1: if (wizardmode == Finalizer.STARTFORMWIZARDMODE)
callFormWizard();
break; break;
case 1:
break;
}
} }
} }
catch(java.lang.Exception jexception ){
jexception.printStackTrace(System.out);
}
return components;
} }
catch(java.lang.Exception jexception ){
jexception.printStackTrace(System.out);
}}
public boolean getTableResources(){ public boolean getTableResources(){
...@@ -349,16 +360,6 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet ...@@ -349,16 +360,6 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet
return true; return true;
} }
private void toggleWizardSteps(int _startStep, boolean _benable){
super.setStepEnabled(SOFIELDSFORMATPAGE, _benable);
super.setStepEnabled(SOPRIMARYKEYPAGE, _benable);
super.setStepEnabled(SOFINALPAGE, _benable);
setControlProperty("btnWizardNext", "Enabled", new Boolean(_benable));
setControlProperty("btnWizardFinish", "Enabled", new Boolean(_benable));
}
public boolean verifyfieldcount( int _icount ){ public boolean verifyfieldcount( int _icount ){
try{ try{
int maxfieldcount = curTableDescriptor.getMaxColumnsInTable(); int maxfieldcount = curTableDescriptor.getMaxColumnsInTable();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment