summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2010-02-05 09:17:48 +0100
committersb <sb@openoffice.org>2010-02-05 09:17:48 +0100
commitab58550cee0da7295bc83d7d14f01df9ecd8bc33 (patch)
treeb8a33116f1c6c03fc5b967073c094a3e3a19d850 /wizards
parent6c017464713a9288e5817ead4cf7a50158f3e45b (diff)
parent055bc5c7f48cd556d256dedc32671f60ad30ccf4 (diff)
sb111: merged in DEV300_m71
Diffstat (limited to 'wizards')
-rw-r--r--wizards/com/sun/star/wizards/query/Finalizer.java16
-rw-r--r--wizards/com/sun/star/wizards/query/QueryWizard.java4
-rw-r--r--wizards/com/sun/star/wizards/report/IReportDocument.java2
-rw-r--r--wizards/com/sun/star/wizards/report/ReportFinalizer.java32
-rw-r--r--wizards/com/sun/star/wizards/report/ReportTextImplementation.java2
-rw-r--r--wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java29
6 files changed, 45 insertions, 40 deletions
diff --git a/wizards/com/sun/star/wizards/query/Finalizer.java b/wizards/com/sun/star/wizards/query/Finalizer.java
index 7079b1109742..0a7f0a42aec8 100644
--- a/wizards/com/sun/star/wizards/query/Finalizer.java
+++ b/wizards/com/sun/star/wizards/query/Finalizer.java
@@ -31,6 +31,7 @@ package com.sun.star.wizards.query;
import com.sun.star.wizards.common.*;
import com.sun.star.awt.XRadioButton;
+import com.sun.star.awt.XTextComponent;
import com.sun.star.wizards.db.*;
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.XComponent;
@@ -44,7 +45,7 @@ public class Finalizer
private QueryWizard CurUnoDialog;
private String resQuery;
private Object m_aTxtSummary;
- private Object m_aTxtTitle;
+ private XTextComponent m_aTxtTitle;
private XRadioButton xRadioDisplayQuery;
private XRadioButton xRadioModifyQuery;
private QuerySummary CurDBMetaData;
@@ -75,7 +76,7 @@ public class Finalizer
{
new Integer(8), reslblQueryTitle, new Integer(95), new Integer(27), new Integer(QueryWizard.SOSUMMARY_PAGE), new Short(curtabindex++), new Integer(52)
});
- m_aTxtTitle = CurUnoDialog.insertTextField("txtQueryTitle", 0, null, new String[]
+ m_aTxtTitle = CurUnoDialog.insertTextField("txtQueryTitle", "changeTitle", this, new String[]
{
"Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width"
},
@@ -128,6 +129,11 @@ public class Finalizer
});
}
+ public void changeTitle()
+ {
+ final String TitleName = m_aTxtTitle.getText();
+ CurUnoDialog.enableFinishButton(!"".equals(TitleName));
+ }
/* TODO: The title textbox always has to be updated when
a new Table has been selected if it is clear that the user has not made any input meanwhile
*/
@@ -191,11 +197,11 @@ public class Finalizer
CurUnoDialog.getCurFrame());
}
CurUnoDialog.xDialog.endExecute();
+ CurDBMetaData.oSQLQueryComposer = null;
+ CurDBMetaData = null;
+ CurUnoDialog = null;
}
}
- CurDBMetaData.oSQLQueryComposer = null;
- CurDBMetaData = null;
- CurUnoDialog = null;
}
catch (IllegalArgumentException e)
{
diff --git a/wizards/com/sun/star/wizards/query/QueryWizard.java b/wizards/com/sun/star/wizards/query/QueryWizard.java
index dcbb920e4b0d..14fe9c4757a9 100644
--- a/wizards/com/sun/star/wizards/query/QueryWizard.java
+++ b/wizards/com/sun/star/wizards/query/QueryWizard.java
@@ -298,6 +298,10 @@ public class QueryWizard extends WizardDialog
if ((switchToStep(ncurStep, SOSUMMARY_PAGE)) || (ncurStep == SOSUMMARY_PAGE))
{
components = CurFinalizer.finish();
+ if ( components == null )
+ {
+ setControlProperty("btnWizardFinish", "Enabled", false);
+ }
}
}
diff --git a/wizards/com/sun/star/wizards/report/IReportDocument.java b/wizards/com/sun/star/wizards/report/IReportDocument.java
index af8476f5c3e9..e94f93bf9d2e 100644
--- a/wizards/com/sun/star/wizards/report/IReportDocument.java
+++ b/wizards/com/sun/star/wizards/report/IReportDocument.java
@@ -204,7 +204,7 @@ public interface IReportDocument
* @param Name
* @param OpenMode
*/
- public void store(String Name, int OpenMode);
+ public void store(String Name, int OpenMode) throws com.sun.star.uno.Exception;
/**
* The current report is added to the DB View under the given name
diff --git a/wizards/com/sun/star/wizards/report/ReportFinalizer.java b/wizards/com/sun/star/wizards/report/ReportFinalizer.java
index 8c0df7c36c5c..9ffb89b768f5 100644
--- a/wizards/com/sun/star/wizards/report/ReportFinalizer.java
+++ b/wizards/com/sun/star/wizards/report/ReportFinalizer.java
@@ -244,8 +244,9 @@ public class ReportFinalizer
public void changeReportTitle()
{
- String TitleName = xTitleTextBox.getText();
+ final String TitleName = xTitleTextBox.getText();
CurReportDocument.liveupdate_updateReportTitle(TitleName);
+ CurUnoDialog.enableFinishButton(!"".equals(TitleName));
}
public int getReportOpenMode()
@@ -272,18 +273,25 @@ public class ReportFinalizer
public boolean finish()
{
StoreName = getStoreName();
- if (CurReportDocument.getRecordParser().getReportDocuments().hasByHierarchicalName(StoreName))
+ if (!CurReportDocument.getRecordParser().getReportDocuments().hasByHierarchicalName(StoreName))
{
- String sMsgReportDocumentNameDuplicate = CurUnoDialog.m_oResource.getResText(UIConsts.RID_REPORT + 76);
- String sShowMsgReportNameisDuplicate = JavaTools.replaceSubString(sMsgReportDocumentNameDuplicate, StoreName, "%REPORTNAME");
- /* int iMsg = */ CurUnoDialog.showMessageBox("ErrorBox", VclWindowPeerAttribute.OK, sShowMsgReportNameisDuplicate);
- return false;
- }
- else
- {
- CurReportDocument.store(StoreName, getReportOpenMode());
- ReportWizard.bCloseDocument = false;
- return true;
+ try
+ {
+ CurReportDocument.store(StoreName, getReportOpenMode());
+ ReportWizard.bCloseDocument = false;
+ return true;
+ }
+ catch(Exception e)
+ {
+ CurUnoDialog.showMessageBox("ErrorBox", VclWindowPeerAttribute.OK,e.getLocalizedMessage() );
+ CurUnoDialog.enableFinishButton(false);
+ return false;
+ }
}
+ String sMsgReportDocumentNameDuplicate = CurUnoDialog.m_oResource.getResText(UIConsts.RID_REPORT + 76);
+ String sShowMsgReportNameisDuplicate = JavaTools.replaceSubString(sMsgReportDocumentNameDuplicate, StoreName, "%REPORTNAME");
+ /* int iMsg = */ CurUnoDialog.showMessageBox("ErrorBox", VclWindowPeerAttribute.OK, sShowMsgReportNameisDuplicate);
+ CurUnoDialog.enableFinishButton(false);
+ return false;
}
}
diff --git a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java
index 3d79c5d2d8ac..6e0091b52ef5 100644
--- a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java
+++ b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java
@@ -480,7 +480,7 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme
return m_aDoc.xMSFDoc;
}
- public void store(String _sName, int _nOpenMode)
+ public void store(String _sName, int _nOpenMode) throws com.sun.star.uno.Exception
{
getDoc().createReportForm(ReportWizard.SOREPORTFORMNAME);
// int nOpenMode = getReportOpenMode();
diff --git a/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java b/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java
index dad827841e96..2972e8153787 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java
@@ -37,7 +37,7 @@ import com.sun.star.wizards.report.*;
import com.sun.star.awt.XWindowPeer;
import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
-import com.sun.star.container.XNameAccess;
+import com.sun.star.container.XHierarchicalNameContainer;
import com.sun.star.container.XNameContainer;
import com.sun.star.frame.XController;
import com.sun.star.frame.XDispatch;
@@ -340,7 +340,7 @@ public class ReportBuilderImplementation extends ReportImplementationHelper
throw new UnsupportedOperationException("Not supported yet.");
}
- public void store(String Name, int OpenMode)
+ public void store(String Name, int OpenMode) throws com.sun.star.uno.Exception
{
// throw new UnsupportedOperationException("Not supported yet.");
// getReportBuilderLayouter().store(Name);
@@ -351,27 +351,14 @@ public class ReportBuilderImplementation extends ReportImplementationHelper
return;
}
- try
- {
- final XNameAccess aNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, m_aReportDocument);
- final String[] aNames = aNameAccess.getElementNames();
-
-// m_xReportDefinition.storeToStorage(m_xReportDefinition.getDocumentStorage(), m_xReportDefinition.getArgs());
-
- final XCommandProcessor xProcessor = (XCommandProcessor) UnoRuntime.queryInterface(XCommandProcessor.class, m_aDocumentDefinition);
- com.sun.star.ucb.Command aCommand = new com.sun.star.ucb.Command();
- aCommand.Name = "storeOwn";
+ final XCommandProcessor xProcessor = UnoRuntime.queryInterface(XCommandProcessor.class, m_aDocumentDefinition);
+ final com.sun.star.ucb.Command aCommand = new com.sun.star.ucb.Command();
+ aCommand.Name = "storeOwn";
- final Object aObj2 = xProcessor.execute(aCommand, xProcessor.createCommandIdentifier(), null);
+ final Object aObj2 = xProcessor.execute(aCommand, xProcessor.createCommandIdentifier(), null);
- final XNameContainer aNameContainer = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, m_aReportDocument);
-// aNameContainer.insertByName(Name, m_xReportDefinition);
- aNameContainer.insertByName(Name, m_aDocumentDefinition);
- }
- catch (Exception e)
- {
- int dummy = 0;
- }
+ final XHierarchicalNameContainer aNameContainer = UnoRuntime.queryInterface(XHierarchicalNameContainer.class, m_aReportDocument);
+ aNameContainer.insertByHierarchicalName(Name, m_aDocumentDefinition);
}
public boolean liveupdate_addGroupNametoDocument(String[] GroupNames, String CurGroupTitle, Vector GroupFieldVector, ArrayList ReportPath, int iSelCount)