Search in sources :

Example 26 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project cubrid-manager by CUBRID.

the class SetDbaPasswordPage method pageChanged.

/**
	 * Call this method when page changed
	 * 
	 * @param event the page changed event
	 */
public void pageChanged(PageChangedEvent event) {
    IWizardPage page = (IWizardPage) event.getSelectedPage();
    if (page.getName().equals(PAGENAME) && passwordText != null && !passwordText.isDisposed()) {
        passwordText.selectAll();
        passwordText.setFocus();
    }
}
Also used : IWizardPage(org.eclipse.jface.wizard.IWizardPage)

Example 27 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project cubrid-manager by CUBRID.

the class ConfigHAWizardDialog method createContents.

/**
	 * Overwrite the method. Auto add IPageChangingListener(s);
	 * 
	 * @param parent of the control.
	 * @return Control
	 */
protected Control createContents(Composite parent) {
    Control result = super.createContents(parent);
    IWizardPage[] pages = this.getWizard().getPages();
    for (IWizardPage page : pages) {
        if (page instanceof IPageChangingListener) {
            this.addPageChangingListener((IPageChangingListener) page);
        }
        if (page instanceof IPageChangedListener) {
            this.addPageChangedListener((IPageChangedListener) page);
        }
    }
    return result;
}
Also used : IPageChangedListener(org.eclipse.jface.dialogs.IPageChangedListener) Control(org.eclipse.swt.widgets.Control) IWizardPage(org.eclipse.jface.wizard.IWizardPage) IPageChangingListener(org.eclipse.jface.dialogs.IPageChangingListener)

Example 28 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project cubrid-manager by CUBRID.

the class AddShardAction method run.

/**
	 * Open a dialog to add a shard.
	 */
public void run() {
    Object[] obj = this.getSelectedObj();
    if (obj != null && obj.length > 0) {
        if (!isSupported(obj[0])) {
            this.setEnabled(false);
            return;
        }
        node = (ICubridNode) obj[0];
        server = node.getServer();
    }
    CMWizardDialog dialog = new CMWizardDialog(getShell(), new AddShardWizard(server)) {

        /**
			 * Overwrite the method. Auto add IPageChangingListener(s);
			 * 
			 * @param parent
			 *            of the control.
			 * @return Control
			 */
        protected Control createContents(Composite parent) {
            Control result = super.createContents(parent);
            IWizardPage[] pages = this.getWizard().getPages();
            for (IWizardPage page : pages) {
                if (page instanceof IPageChangingListener) {
                    this.addPageChangingListener((IPageChangingListener) page);
                }
                if (page instanceof IPageChangedListener) {
                    this.addPageChangedListener((IPageChangedListener) page);
                }
            }
            return result;
        }
    };
    dialog.setPageSize(660, 450);
    dialog.open();
}
Also used : AddShardWizard(com.cubrid.cubridmanager.ui.shard.control.AddShardWizard) IPageChangedListener(org.eclipse.jface.dialogs.IPageChangedListener) Control(org.eclipse.swt.widgets.Control) Composite(org.eclipse.swt.widgets.Composite) IWizardPage(org.eclipse.jface.wizard.IWizardPage) IPageChangingListener(org.eclipse.jface.dialogs.IPageChangingListener) CMWizardDialog(com.cubrid.common.ui.spi.dialog.CMWizardDialog)

Example 29 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project cubrid-manager by CUBRID.

the class PartitionEditRangePage method pageChanged.

/**
	 * Call this method when page changed
	 * 
	 * @param event the page changed event
	 */
public void pageChanged(PageChangedEvent event) {
    IWizardPage page = (IWizardPage) event.getSelectedPage();
    if (page.getName().equals(PAGENAME)) {
        PartitionTypePage partitionTypePage = (PartitionTypePage) getWizard().getPage(PartitionTypePage.PAGENAME);
        String partitionType = partitionTypePage.getPartitionType();
        String partitionExpr = partitionTypePage.getPartitionExpr();
        String exprDataType = partitionTypePage.getPartitionExprDataType();
        if (exprDataType == null) {
            partitionExprTypeCombo.setEnabled(true);
            if (editedPartitionInfo == null) {
                partitionExprTypeCombo.select(0);
            } else {
                partitionExprTypeCombo.setText(PartitionUtil.getMatchType(editedPartitionInfo.getPartitionExprType()));
            }
        } else {
            partitionExprTypeCombo.setText(PartitionUtil.getMatchType(exprDataType));
            partitionExprTypeCombo.setEnabled(false);
        }
        partitionTypeText.setText(partitionType);
        partitionExprText.setText(partitionExpr);
        setPageComplete(validate());
        partitionNameText.setFocus();
    }
}
Also used : IWizardPage(org.eclipse.jface.wizard.IWizardPage)

Example 30 with IWizardPage

use of org.eclipse.jface.wizard.IWizardPage in project cubrid-manager by CUBRID.

the class PartitionEditListPage method pageChanged.

/**
	 * Call this method when page changed
	 * 
	 * @param event the page changed event
	 */
public void pageChanged(PageChangedEvent event) {
    IWizardPage page = (IWizardPage) event.getSelectedPage();
    if (page.getName().equals(PAGENAME)) {
        PartitionTypePage partitionTypePage = (PartitionTypePage) getWizard().getPage(PartitionTypePage.PAGENAME);
        String partitionType = partitionTypePage.getPartitionType();
        String partitionExpr = partitionTypePage.getPartitionExpr();
        String exprDataType = partitionTypePage.getPartitionExprDataType();
        if (exprDataType == null) {
            partitionExprTypeCombo.setEnabled(true);
            if (editedPartitionInfo == null) {
                partitionExprTypeCombo.select(0);
            } else {
                partitionExprTypeCombo.setText(PartitionUtil.getMatchType(editedPartitionInfo.getPartitionExprType()));
            }
        } else {
            partitionExprTypeCombo.setText(PartitionUtil.getMatchType(exprDataType));
            partitionExprTypeCombo.setEnabled(false);
        }
        partitionTypeText.setText(partitionType);
        partitionExprText.setText(partitionExpr);
        initValuesCombo();
        setPageComplete(validate());
        partitionNameText.setFocus();
    }
}
Also used : IWizardPage(org.eclipse.jface.wizard.IWizardPage)

Aggregations

IWizardPage (org.eclipse.jface.wizard.IWizardPage)36 InvocationTargetException (java.lang.reflect.InvocationTargetException)4 Control (org.eclipse.swt.widgets.Control)4 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)3 DBClasses (com.cubrid.cubridmanager.core.cubrid.table.model.DBClasses)3 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)3 IPageChangedListener (org.eclipse.jface.dialogs.IPageChangedListener)3 IPageChangingListener (org.eclipse.jface.dialogs.IPageChangingListener)3 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)3 IOpenListener (org.eclipse.jface.viewers.IOpenListener)3 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)3 OpenEvent (org.eclipse.jface.viewers.OpenEvent)3 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)3 GridData (org.eclipse.swt.layout.GridData)3 GridLayout (org.eclipse.swt.layout.GridLayout)3 Composite (org.eclipse.swt.widgets.Composite)3 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 TableViewer (org.eclipse.jface.viewers.TableViewer)2 WizardPage (org.eclipse.jface.wizard.WizardPage)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2