diff options
author | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2010-01-21 11:54:03 +0100 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2010-01-21 11:54:03 +0100 |
commit | ff323b9a64db6a9977b5cdf33cf7b58e6915b9b7 (patch) | |
tree | 4f5ed7f9a286ab7fc4c2a9ccafed9c7ecba434ea /wizards/com | |
parent | e2d9dd6fb86e50b45f2e7e838b5b0cd230bebef4 (diff) | |
parent | 4e40ca1e8ba821e164c32578aeee43673d0d4966 (diff) |
dba33e: merge to m70
Diffstat (limited to 'wizards/com')
15 files changed, 83 insertions, 61 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java index 23dec6a80191..82f767a61ca4 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java +++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java @@ -459,7 +459,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog running = false; } - public void finishWizard() { + public boolean finishWizard() { boolean bSaveSuccess = false; // pesimistic :( XTextDocument xTextDocument; @@ -480,7 +480,7 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog int answer = SystemDialog.showMessageBox(xMSF, xControl.getPeer(), "MessBox", VclWindowPeerAttribute.YES_NO + VclWindowPeerAttribute.DEF_NO, resources.resFileExists); if (answer == 3) // user said: no, do not overwrite.... - return; + return false; } agendaTemplate.xTextDocument.lockControllers(); @@ -550,10 +550,11 @@ public class AgendaWizardDialogImpl extends AgendaWizardDialog } } else { agendaTemplate.xTextDocument.unlockControllers(); - return; + return false; } xDialog.endExecute(); running = false; + return true; } private void closeDocument() { diff --git a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java index db5ccd32b8f7..10677558488c 100644 --- a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java +++ b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java @@ -292,7 +292,7 @@ public class SQLQueryComposer return sFromClause; } - public boolean setQueryCommand(String QueryName, XWindow _xParentWindow, boolean _bincludeGrouping, boolean _baddAliasFieldNames) + public boolean setQueryCommand(XWindow _xParentWindow, boolean _bincludeGrouping, boolean _baddAliasFieldNames) { try { diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java index a8dbe94e5db0..fe726c430a9b 100644 --- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.java @@ -212,7 +212,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog running = false; } - public void finishWizard() + public boolean finishWizard() { switchToStep(getCurrentStep(), getMaxStep()); myFaxDoc.setWizardTemplateDocInfo(resources.resFaxWizardDialog_title, resources.resTemplateDescription); @@ -239,7 +239,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog int answer = SystemDialog.showMessageBox(xMSF, xControl.getPeer(), "MessBox", VclWindowPeerAttribute.YES_NO + VclWindowPeerAttribute.DEF_NO, resources.resOverwriteWarning); if (answer == 3) // user said: no, do not overwrite.... { - return; + return false; } } } @@ -297,7 +297,7 @@ public class FaxWizardDialogImpl extends FaxWizardDialog xDialog.endExecute(); running = false; } - + return true; } public void closeDocument() diff --git a/wizards/com/sun/star/wizards/form/FormWizard.java b/wizards/com/sun/star/wizards/form/FormWizard.java index 5b0a7939f6c2..678e5d55f3b1 100644 --- a/wizards/com/sun/star/wizards/form/FormWizard.java +++ b/wizards/com/sun/star/wizards/form/FormWizard.java @@ -308,7 +308,7 @@ public class FormWizard extends WizardDialog } // @Override - public void finishWizard() + public boolean finishWizard() { int ncurStep = getCurrentStep(); if ((switchToStep(ncurStep, SOSTORE_PAGE)) || (ncurStep == SOSTORE_PAGE)) @@ -326,6 +326,7 @@ public class FormWizard extends WizardDialog { bcreateForm = true; xDialog.endExecute(); + return true; } } } @@ -335,6 +336,7 @@ public class FormWizard extends WizardDialog showMessageBox("WarningBox", com.sun.star.awt.VclWindowPeerAttribute.OK, smessage); } } + return false; } // @Override diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java index 1a47712ca213..5e5ce985c0c4 100644 --- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java +++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java @@ -253,7 +253,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog running = false; } - public void finishWizard() + public boolean finishWizard() { switchToStep(getCurrentStep(), getMaxStep()); try @@ -279,7 +279,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog int answer = SystemDialog.showMessageBox(xMSF, xControl.getPeer(), "MessBox", VclWindowPeerAttribute.YES_NO + VclWindowPeerAttribute.DEF_NO, resources.resOverwriteWarning); if (answer == 3) // user said: no, do not overwrite.... { - return; + return false; } } } @@ -356,7 +356,7 @@ public class LetterWizardDialogImpl extends LetterWizardDialog xDialog.endExecute(); running = false; } - + return true; } public void closeDocument() diff --git a/wizards/com/sun/star/wizards/query/Finalizer.java b/wizards/com/sun/star/wizards/query/Finalizer.java index 7079b1109742..f690102ea49f 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 */ @@ -171,7 +177,7 @@ public class Finalizer { CurDBMetaData.oSQLQueryComposer = new SQLQueryComposer(CurDBMetaData); String queryname = getTitle(); - boolean bsuccess = CurDBMetaData.oSQLQueryComposer.setQueryCommand(queryname, CurUnoDialog.xWindow, true, true); + boolean bsuccess = CurDBMetaData.oSQLQueryComposer.setQueryCommand(CurUnoDialog.xWindow, true, true); if (bsuccess) { bsuccess = CurDBMetaData.createQuery(CurDBMetaData.oSQLQueryComposer, queryname); @@ -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..6d6fd34f0a88 100644 --- a/wizards/com/sun/star/wizards/query/QueryWizard.java +++ b/wizards/com/sun/star/wizards/query/QueryWizard.java @@ -292,13 +292,16 @@ public class QueryWizard extends WizardDialog } } - public void finishWizard() + public boolean finishWizard() { int ncurStep = getCurrentStep(); - if ((switchToStep(ncurStep, SOSUMMARY_PAGE)) || (ncurStep == SOSUMMARY_PAGE)) + if ( ( ncurStep == SOSUMMARY_PAGE ) + || ( switchToStep( ncurStep, SOSUMMARY_PAGE ) ) + ) { components = CurFinalizer.finish(); } + return ( components != null ); } protected void enterStep(int nOldStep, int nNewStep) 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/report/ReportWizard.java b/wizards/com/sun/star/wizards/report/ReportWizard.java index a4b4e3af18ad..a959c2dfd183 100644 --- a/wizards/com/sun/star/wizards/report/ReportWizard.java +++ b/wizards/com/sun/star/wizards/report/ReportWizard.java @@ -329,7 +329,7 @@ public class ReportWizard extends WizardDialog implements XTextListener, XComple boolean bQueryCreated = false; if (this.CurDBCommandFieldSelection.getSelectedCommandType() == CommandType.TABLE) { - bQueryCreated = CurReportDocument.getRecordParser().oSQLQueryComposer.setQueryCommand(sMsgWizardName, this.xWindow, false, false); + bQueryCreated = CurReportDocument.getRecordParser().oSQLQueryComposer.setQueryCommand(this.xWindow, false, false); CurReportDocument.setCommandType(CommandType.COMMAND); String sQuery = CurReportDocument.getRecordParser().oSQLQueryComposer.getQuery(); @@ -520,7 +520,7 @@ public class ReportWizard extends WizardDialog implements XTextListener, XComple enableNavigationButtons(false, false, false); } - public void finishWizard() + public boolean finishWizard() { final int ncurStep = getCurrentStep(); if ((switchToStep(ncurStep, SOSTOREPAGE)) || (ncurStep == SOSTOREPAGE)) @@ -532,9 +532,11 @@ public class ReportWizard extends WizardDialog implements XTextListener, XComple nReportMode = CurReportFinalizer.getReportOpenMode(); m_sReportName = CurReportFinalizer.getStoreName(); xDialog.endExecute(); + return true; } } } + return false; } public void cancelWizard() 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) diff --git a/wizards/com/sun/star/wizards/table/TableWizard.java b/wizards/com/sun/star/wizards/table/TableWizard.java index 9144dc607a9a..bee58c071546 100644 --- a/wizards/com/sun/star/wizards/table/TableWizard.java +++ b/wizards/com/sun/star/wizards/table/TableWizard.java @@ -289,7 +289,7 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet return bIsSuccessfull; } - public void finishWizard() + public boolean finishWizard() { super.switchToStep(super.getCurrentStep(), SOFINALPAGE); tablename = curFinalizer.getTableName(curScenarioSelector.getFirstTableName()); @@ -314,6 +314,7 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet components = curTableDescriptor.switchtoDataViewmode(curTableDescriptor.getComposedTableName(), com.sun.star.sdb.CommandType.TABLE, CurFrame); } super.xDialog.endExecute(); + return true; } } else @@ -323,6 +324,7 @@ public class TableWizard extends WizardDialog implements XTextListener, XComplet curFinalizer.setFocusToTableNameControl(); } } + return false; } private void callFormWizard() diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.java b/wizards/com/sun/star/wizards/ui/WizardDialog.java index 15b840fa9c89..01d97c4278ed 100644 --- a/wizards/com/sun/star/wizards/ui/WizardDialog.java +++ b/wizards/com/sun/star/wizards/ui/WizardDialog.java @@ -685,7 +685,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL } } - public abstract void finishWizard(); + public abstract boolean finishWizard(); /** * This function will call if the finish button is pressed on the UI. @@ -693,8 +693,18 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL public void finishWizard_1() { enableFinishButton(false); - finishWizard(); - removeTerminateListener(); + boolean success = false; + try + { + success = finishWizard(); + } + finally + { + if ( !success ) + enableFinishButton( true ); + } + if ( success ) + removeTerminateListener(); } public int getMaximalStep() diff --git a/wizards/com/sun/star/wizards/web/WWD_Events.java b/wizards/com/sun/star/wizards/web/WWD_Events.java index e396a46ddd30..88b986bb631c 100644 --- a/wizards/com/sun/star/wizards/web/WWD_Events.java +++ b/wizards/com/sun/star/wizards/web/WWD_Events.java @@ -942,9 +942,10 @@ public abstract class WWD_Events extends WWD_Startup /** * the user clicks the finish/create button. */ - public void finishWizard() + public boolean finishWizard() { finishWizard(true); + return true; } /** |