Search in sources :

Example 1 with IPageChangingListener

use of org.eclipse.jface.dialogs.IPageChangingListener in project translationstudio8 by heartsome.

the class TSWizardDialog method firePageChanging.

/**
	 * Notifies any page changing listeners that the currently selected dialog
	 * page is changing. Only listeners registered at the time this method is
	 * called are notified.
	 * 
	 * @param event
	 *            a selection changing event
	 * 
	 * @see IPageChangingListener#handlePageChanging(PageChangingEvent)
	 * @since 3.3
	 */
protected void firePageChanging(final PageChangingEvent event) {
    Object[] listeners = pageChangingListeners.getListeners();
    for (int i = 0; i < listeners.length; ++i) {
        final IPageChangingListener l = (IPageChangingListener) listeners[i];
        SafeRunnable.run(new SafeRunnable() {

            public void run() {
                l.handlePageChanging(event);
            }
        });
    }
}
Also used : SafeRunnable(org.eclipse.jface.util.SafeRunnable) IPageChangingListener(org.eclipse.jface.dialogs.IPageChangingListener) Point(org.eclipse.swt.graphics.Point)

Example 2 with IPageChangingListener

use of org.eclipse.jface.dialogs.IPageChangingListener in project cubrid-manager by CUBRID.

the class ImportDataWizardDialog 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 3 with IPageChangingListener

use of org.eclipse.jface.dialogs.IPageChangingListener 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 4 with IPageChangingListener

use of org.eclipse.jface.dialogs.IPageChangingListener 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)

Aggregations

IPageChangingListener (org.eclipse.jface.dialogs.IPageChangingListener)4 IPageChangedListener (org.eclipse.jface.dialogs.IPageChangedListener)3 IWizardPage (org.eclipse.jface.wizard.IWizardPage)3 Control (org.eclipse.swt.widgets.Control)3 CMWizardDialog (com.cubrid.common.ui.spi.dialog.CMWizardDialog)1 AddShardWizard (com.cubrid.cubridmanager.ui.shard.control.AddShardWizard)1 SafeRunnable (org.eclipse.jface.util.SafeRunnable)1 Point (org.eclipse.swt.graphics.Point)1 Composite (org.eclipse.swt.widgets.Composite)1