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

INTEGRATION: CWS dba24e_SRC680 (1.12.62); FILE MERGED

2007/12/19 12:28:44 oj 1.12.62.1: #i84339# handle refcount by releasing the objects as early as possible, gc is not alsways the best way to trust :-)
üst ef71127f
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: QueryWizard.java,v $ * $RCSfile: QueryWizard.java,v $
* *
* $Revision: 1.13 $ * $Revision: 1.14 $
* *
* last change: $Author: vg $ $Date: 2008-01-28 15:30:16 $ * last change: $Author: vg $ $Date: 2008-01-29 08:42: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.
...@@ -31,17 +31,17 @@ ...@@ -31,17 +31,17 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA * MA 02111-1307 USA
* *
************************************************************************/package com.sun.star.wizards.query; ************************************************************************/
package com.sun.star.wizards.query;
import com.sun.star.frame.XFrame; import com.sun.star.frame.XFrame;
import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.awt.VclWindowPeerAttribute; import com.sun.star.awt.VclWindowPeerAttribute;
import com.sun.star.awt.XWindowPeer; import com.sun.star.awt.XWindowPeer;
import com.sun.star.beans.PropertyValue; import com.sun.star.beans.PropertyValue;
import com.sun.star.lang.XComponent;
import com.sun.star.wizards.common.*; import com.sun.star.wizards.common.*;
import com.sun.star.wizards.db.*; import com.sun.star.wizards.db.*;
import com.sun.star.wizards.document.OfficeDocument;
import com.sun.star.wizards.form.FormWizard.FieldSelectionListener;
import com.sun.star.sdbc.SQLException; import com.sun.star.sdbc.SQLException;
import com.sun.star.uno.*; import com.sun.star.uno.*;
import com.sun.star.wizards.ui.*; import com.sun.star.wizards.ui.*;
...@@ -50,8 +50,12 @@ import com.sun.star.uno.UnoRuntime; ...@@ -50,8 +50,12 @@ import com.sun.star.uno.UnoRuntime;
public class QueryWizard extends WizardDialog { public class QueryWizard extends WizardDialog {
public XFrame CurFrame; private XFrame CurFrame;
public XWindowPeer xWindowPeer;
public XFrame getCurFrame() {
return CurFrame;
}
public static final String SFILLUPFIELDSLISTBOX = "fillUpFieldsListbox"; public static final String SFILLUPFIELDSLISTBOX = "fillUpFieldsListbox";
public static final int SOFIELDSELECTIONPAGE = 1; public static final int SOFIELDSELECTIONPAGE = 1;
...@@ -73,7 +77,6 @@ public class QueryWizard extends WizardDialog { ...@@ -73,7 +77,6 @@ public class QueryWizard extends WizardDialog {
Finalizer CurFinalizer; Finalizer CurFinalizer;
WizardDialog CurWizardDialog; WizardDialog CurWizardDialog;
QuerySummary CurDBMetaData; QuerySummary CurDBMetaData;
Object[] CurPropertyValue;
String[][] UIRepresentation; String[][] UIRepresentation;
String reslblFieldHeader; String reslblFieldHeader;
String reslblAliasHeader; String reslblAliasHeader;
...@@ -85,6 +88,8 @@ public class QueryWizard extends WizardDialog { ...@@ -85,6 +88,8 @@ public class QueryWizard extends WizardDialog {
String reslblGroupBy; String reslblGroupBy;
String resmsgNonNumericAsGroupBy; String resmsgNonNumericAsGroupBy;
XComponent[] components = null;
//Resources Object //Resources Object
short CurTabIndex = 0; short CurTabIndex = 0;
...@@ -114,38 +119,55 @@ public class QueryWizard extends WizardDialog { ...@@ -114,38 +119,55 @@ public class QueryWizard extends WizardDialog {
} }
public void startQueryWizard(XMultiServiceFactory xMSF, PropertyValue[] CurPropertyValues) { public XComponent[] startQueryWizard(XMultiServiceFactory xMSF, PropertyValue[] CurPropertyValues) {
try { try {
if (CurDBMetaData.getConnection(CurPropertyValues)){ if (CurDBMetaData.getConnection(CurPropertyValues)){
reslblFields = oResource.getResText(UIConsts.RID_QUERY + 4); reslblFields = oResource.getResText(UIConsts.RID_QUERY + 4);
reslblFieldHeader = oResource.getResText(UIConsts.RID_QUERY + 19); //Fielnames in AliasComponent reslblFieldHeader = oResource.getResText(UIConsts.RID_QUERY + 19); //Fielnames in AliasComponent
reslblAliasHeader = oResource.getResText(UIConsts.RID_QUERY + 20); //Fieldtitles header in AliasComponent reslblAliasHeader = oResource.getResText(UIConsts.RID_QUERY + 20); //Fieldtitles header in AliasComponent
reslblSelFields = oResource.getResText(UIConsts.RID_QUERY + 50); reslblSelFields = oResource.getResText(UIConsts.RID_QUERY + 50);
reslblTables = oResource.getResText(UIConsts.RID_QUERY + 3); reslblTables = oResource.getResText(UIConsts.RID_QUERY + 3);
reslblGroupBy = oResource.getResText(UIConsts.RID_QUERY + 18); reslblGroupBy = oResource.getResText(UIConsts.RID_QUERY + 18);
resQueryWizard = oResource.getResText(UIConsts.RID_QUERY + 2); resQueryWizard = oResource.getResText(UIConsts.RID_QUERY + 2);
resmsgNonNumericAsGroupBy = oResource.getResText(UIConsts.RID_QUERY + 88); resmsgNonNumericAsGroupBy = oResource.getResText(UIConsts.RID_QUERY + 88);
Helper.setUnoPropertyValues(xDialogModel, new String[] { "Height", "Moveable", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Title", "Width" }, Helper.setUnoPropertyValues(xDialogModel, new String[] { "Height", "Moveable", "Name", "PositionX", "PositionY", "Step", "TabIndex", "Title", "Width" },
new Object[] { new Integer(210), Boolean.TRUE, "DialogQuery", new Integer(102), new Integer(41), new Integer(1), new Short((short) 0), resQueryWizard, new Integer(310)}); new Object[] { new Integer(210), Boolean.TRUE, "DialogQuery", new Integer(102), new Integer(41), new Integer(1), new Short((short) 0), resQueryWizard, new Integer(310)});
drawNaviBar(); drawNaviBar();
setRightPaneHeaders(oResource, UIConsts.RID_QUERY + 70, 8); setRightPaneHeaders(oResource, UIConsts.RID_QUERY + 70, 8);
this.setMaxStep(8); this.setMaxStep(8);
buildSteps(); buildSteps();
this.CurDBCommandFieldSelection.preselectCommand(CurPropertyValues, false); this.CurDBCommandFieldSelection.preselectCommand(CurPropertyValues, false);
CurFrame = Desktop.getActiveFrame(xMSF); if (Properties.hasPropertyValue(CurPropertyValues, "ParentFrame"))
// CurFrame = OfficeDocument.createNewFrame(xMSF, this); CurFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class,Properties.getPropertyValue(CurPropertyValues, "ParentFrame"));
// desktopFrame = Desktop.findAFrame(xMSF, CurFrame, desktopFrame); else
CurFrame = Desktop.getActiveFrame(xMSF);
xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, CurFrame.getContainerWindow()); // CurFrame = OfficeDocument.createNewFrame(xMSF, this);
this.xMSF = xMSF; // desktopFrame = Desktop.findAFrame(xMSF, CurFrame, desktopFrame);
createWindowPeer(xWindowPeer);
CurDBMetaData.setWindowPeer(this.xControl.getPeer()); XWindowPeer windowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, CurFrame.getContainerWindow());
insertQueryRelatedSteps(); this.xMSF = xMSF;
short RetValue = executeDialog(CurFrame.getContainerWindow().getPosSize()); createWindowPeer(windowPeer);
CurDBMetaData.setWindowPeer(this.xControl.getPeer());
insertQueryRelatedSteps();
executeDialog(CurFrame.getContainerWindow().getPosSize());
}
} catch (java.lang.Exception jexception) {
jexception.printStackTrace(System.out);
} }
} catch (java.lang.Exception jexception) { CurGroupFilterComponent = null;
jexception.printStackTrace(System.out); CurTitlesComponent = null;
}} CurAggregateComponent = null;
CurDBCommandFieldSelection = null;
xWindowPeer = null;
CurFrame = null;
CurFinalizer = null;
CurDBMetaData.finish();
CurDBMetaData = null;
XComponent[] ret = components;
components = null;
System.gc();
return ret;
}
public void enableRoadmapItems(String[] _FieldNames, boolean _bEnabled) { public void enableRoadmapItems(String[] _FieldNames, boolean _bEnabled) {
...@@ -187,7 +209,6 @@ public class QueryWizard extends WizardDialog { ...@@ -187,7 +209,6 @@ public class QueryWizard extends WizardDialog {
public void insertQueryRelatedSteps() { public void insertQueryRelatedSteps() {
try { try {
String[] sRMItemLabels = getRMItemLabels();
setRMItemLabels(oResource, UIConsts.RID_QUERY + 80); setRMItemLabels(oResource, UIConsts.RID_QUERY + 80);
addRoadmap(); addRoadmap();
int i = 0; int i = 0;
...@@ -213,7 +234,6 @@ public class QueryWizard extends WizardDialog { ...@@ -213,7 +234,6 @@ public class QueryWizard extends WizardDialog {
public void buildSteps() { public void buildSteps() {
try { try {
boolean bEnabled;
// curDBCommandFieldSelection = new CommandFieldSelection(this, curFormDocument.oMainFormDBMetaData, 92, slblFields, slblSelFields, slblTables, true, 34411); // curDBCommandFieldSelection = new CommandFieldSelection(this, curFormDocument.oMainFormDBMetaData, 92, slblFields, slblSelFields, slblTables, true, 34411);
// curDBCommandFieldSelection.addFieldSelectionListener(new FieldSelectionListener()); // curDBCommandFieldSelection.addFieldSelectionListener(new FieldSelectionListener());
...@@ -223,7 +243,7 @@ public class QueryWizard extends WizardDialog { ...@@ -223,7 +243,7 @@ public class QueryWizard extends WizardDialog {
CurSortingComponent = new SortingComponent(this, SOSORTINGPAGE, 95, 27, 210, 40865); CurSortingComponent = new SortingComponent(this, SOSORTINGPAGE, 95, 27, 210, 40865);
CurFilterComponent = new FilterComponent(this, xMSF, SOFILTERPAGE, 97, 27, 209, 3, CurDBMetaData, 40878); CurFilterComponent = new FilterComponent(this, xMSF, SOFILTERPAGE, 97, 27, 209, 3, CurDBMetaData, 40878);
CurFilterComponent.addNumberFormats(); CurFilterComponent.addNumberFormats();
int i = CurDBMetaData.xDBMetaData.getMaxTablesInSelect();
if (CurDBMetaData.xDBMetaData.supportsCoreSQLGrammar()) if (CurDBMetaData.xDBMetaData.supportsCoreSQLGrammar())
CurAggregateComponent = new AggregateComponent(this, CurDBMetaData, SOAGGREGATEPAGE, 97, 69, 209, 5, 40895); CurAggregateComponent = new AggregateComponent(this, CurDBMetaData, SOAGGREGATEPAGE, 97, 69, 209, 5, 40895);
if (CurDBMetaData.xDBMetaData.supportsGroupBy()) { if (CurDBMetaData.xDBMetaData.supportsGroupBy()) {
...@@ -243,7 +263,7 @@ public class QueryWizard extends WizardDialog { ...@@ -243,7 +263,7 @@ public class QueryWizard extends WizardDialog {
public void finishWizard() { public void finishWizard() {
int ncurStep = getCurrentStep(); int ncurStep = getCurrentStep();
if ((switchToStep(ncurStep, SOSUMMARYPAGE)) || (ncurStep == SOSUMMARYPAGE)) if ((switchToStep(ncurStep, SOSUMMARYPAGE)) || (ncurStep == SOSUMMARYPAGE))
CurFinalizer.finish(); components = CurFinalizer.finish();
} }
...@@ -335,7 +355,6 @@ public class QueryWizard extends WizardDialog { ...@@ -335,7 +355,6 @@ public class QueryWizard extends WizardDialog {
} }
private void searchForOutdatedFields() { private void searchForOutdatedFields() {
String[] GroupCompNames;
String[] sFieldNames = CurDBMetaData.getFieldNames(); String[] sFieldNames = CurDBMetaData.getFieldNames();
CurDBMetaData.SortFieldNames = JavaTools.removeOutdatedFields(CurDBMetaData.SortFieldNames, sFieldNames); CurDBMetaData.SortFieldNames = JavaTools.removeOutdatedFields(CurDBMetaData.SortFieldNames, sFieldNames);
CurDBMetaData.FilterConditions = JavaTools.removeOutdatedFields(CurDBMetaData.FilterConditions, sFieldNames); CurDBMetaData.FilterConditions = JavaTools.removeOutdatedFields(CurDBMetaData.FilterConditions, sFieldNames);
......
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