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;
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;
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
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));
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]);
}
}
}
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