X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.ui%2Fsrc%2Forg%2Fargeo%2Fcms%2Fui%2Fdialogs%2FCmsWizardDialog.java;h=e4fe35d3426c72880e9d20afb968a5f45c90860c;hb=03f646fd0d7e7ce393694c836c779bc67a4eef55;hp=de41bbfe15c8b31b9b48537b9f85ea5cf700feec;hpb=088c1b517a543e935d8ab65c3b2fd2d0269b551d;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/dialogs/CmsWizardDialog.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/dialogs/CmsWizardDialog.java index de41bbfe1..e4fe35d34 100644 --- a/org.argeo.cms.ui/src/org/argeo/cms/ui/dialogs/CmsWizardDialog.java +++ b/org.argeo.cms.ui/src/org/argeo/cms/ui/dialogs/CmsWizardDialog.java @@ -2,12 +2,10 @@ package org.argeo.cms.ui.dialogs; import java.lang.reflect.InvocationTargetException; -import org.argeo.cms.CmsException; import org.argeo.cms.CmsMsg; -import org.argeo.cms.util.CmsUtils; +import org.argeo.cms.ui.util.CmsUiUtils; import org.argeo.eclipse.ui.EclipseUiUtils; import org.argeo.eclipse.ui.Selected; -import org.argeo.eclipse.ui.dialogs.LightweightDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.wizard.IWizard; import org.eclipse.jface.wizard.IWizardContainer2; @@ -24,6 +22,7 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; +/** A wizard dialog based on {@link LightweightDialog}. */ public class CmsWizardDialog extends LightweightDialog implements IWizardContainer2 { private static final long serialVersionUID = -2123153353654812154L; @@ -47,7 +46,7 @@ public class CmsWizardDialog extends LightweightDialog implements IWizardContain wizard.addPages(); currentPage = wizard.getStartingPage(); if (currentPage == null) - throw new CmsException("At least one wizard page is required"); + throw new IllegalArgumentException("At least one wizard page is required"); } @Override @@ -57,7 +56,7 @@ public class CmsWizardDialog extends LightweightDialog implements IWizardContain Composite messageArea = new Composite(parent, SWT.NONE); messageArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); { - messageArea.setLayout(CmsUtils.noSpaceGridLayout(new GridLayout(2, false))); + messageArea.setLayout(CmsUiUtils.noSpaceGridLayout(new GridLayout(2, false))); titleBar = new Label(messageArea, SWT.WRAP); titleBar.setFont(EclipseUiUtils.getBoldFont(parent)); titleBar.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, true, false)); @@ -78,7 +77,7 @@ public class CmsWizardDialog extends LightweightDialog implements IWizardContain IWizardPage[] pages = wizard.getPages(); for (int i = 0; i < pages.length; i++) { pageBodies[i] = new Composite(body, SWT.NONE); - pageBodies[i].setLayout(CmsUtils.noSpaceGridLayout()); + pageBodies[i].setLayout(CmsUiUtils.noSpaceGridLayout()); setSwitchingFormData(pageBodies[i]); pages[i].createControl(pageBodies[i]); } @@ -137,7 +136,7 @@ public class CmsWizardDialog extends LightweightDialog implements IWizardContain } } if (index < 0) - throw new CmsException("Cannot find index of wizard page " + page); + throw new IllegalArgumentException("Cannot find index of wizard page " + page); pageBodies[index].moveAbove(pageBodies[currentPageIndex]); // // clear