Search in sources :

Example 16 with IPageChangedListener

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

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

use of org.eclipse.jface.dialogs.IPageChangedListener in project tdi-studio-se by Talend.

the class AbstractDumpEditor method createPages.

/*
     * @see MultiPageEditorPart#createPages()
     */
@Override
protected final void createPages() {
    createClientPages();
    createInfoPage();
    addPageChangedListener(new IPageChangedListener() {

        @Override
        public void pageChanged(PageChangedEvent event) {
            if (event.getSelectedPage().equals(infoPage)) {
                infoPage.focusCommnentsText();
            }
        }
    });
    resourceChangeListener = new ResourceChangeListener();
    ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener);
}
Also used : IPageChangedListener(org.eclipse.jface.dialogs.IPageChangedListener) IResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener) PageChangedEvent(org.eclipse.jface.dialogs.PageChangedEvent)

Example 19 with IPageChangedListener

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

the class TSWizardDialog method firePageChanged.

/**
	 * Notifies any selection changed listeners that the selected page has
	 * changed. Only listeners registered at the time this method is called are
	 * notified.
	 * 
	 * @param event
	 *            a selection changed event
	 * 
	 * @see IPageChangedListener#pageChanged
	 * 
	 * @since 3.1
	 */
protected void firePageChanged(final PageChangedEvent event) {
    Object[] listeners = pageChangedListeners.getListeners();
    for (int i = 0; i < listeners.length; ++i) {
        final IPageChangedListener l = (IPageChangedListener) listeners[i];
        SafeRunnable.run(new SafeRunnable() {

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

Example 20 with IPageChangedListener

use of org.eclipse.jface.dialogs.IPageChangedListener in project mdw-designer by CenturyLinkCloud.

the class SearchPage method createControl.

@SuppressWarnings("restriction")
public void createControl(Composite parent) {
    // create the composite to hold the widgets
    Composite composite = new Composite(parent, SWT.NULL);
    // create the layout for this page
    GridLayout gl = new GridLayout();
    gl.numColumns = 3;
    composite.setLayout(gl);
    createSearchPatternControls(composite);
    createSearchTypeControls(composite);
    setControl(composite);
    if (searchPageContainer instanceof org.eclipse.search.internal.ui.SearchDialog) {
        org.eclipse.search.internal.ui.SearchDialog searchDialog = (org.eclipse.search.internal.ui.SearchDialog) searchPageContainer;
        searchDialog.addPageChangedListener(new IPageChangedListener() {

            public void pageChanged(PageChangedEvent event) {
                checkEnablement();
            }
        });
    }
    checkEnablement();
    searchPatternText.forceFocus();
}
Also used : IPageChangedListener(org.eclipse.jface.dialogs.IPageChangedListener) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) PageChangedEvent(org.eclipse.jface.dialogs.PageChangedEvent)

Aggregations

IPageChangedListener (org.eclipse.jface.dialogs.IPageChangedListener)27 PageChangedEvent (org.eclipse.jface.dialogs.PageChangedEvent)15 IPageChangingListener (org.eclipse.jface.dialogs.IPageChangingListener)6 SafeRunnable (org.eclipse.jface.util.SafeRunnable)6 IPageChangeProvider (org.eclipse.jface.dialogs.IPageChangeProvider)5 IWizardContainer (org.eclipse.jface.wizard.IWizardContainer)5 IWizardPage (org.eclipse.jface.wizard.IWizardPage)4 Composite (org.eclipse.swt.widgets.Composite)3 Control (org.eclipse.swt.widgets.Control)3 TreeSet (java.util.TreeSet)2 PageChangingEvent (org.eclipse.jface.dialogs.PageChangingEvent)2 WizardDialog (org.eclipse.jface.wizard.WizardDialog)2 Point (org.eclipse.swt.graphics.Point)2 IWorkbench (org.eclipse.ui.IWorkbench)2 TaskVO (com.centurylink.mdw.model.value.task.TaskVO)1 WorkflowSelectionProvider (com.centurylink.mdw.plugin.designer.WorkflowSelectionProvider)1 WorkflowPackage (com.centurylink.mdw.plugin.designer.model.WorkflowPackage)1 WorkflowProject (com.centurylink.mdw.plugin.project.model.WorkflowProject)1 TaskTemplateDocument (com.centurylink.mdw.task.TaskTemplateDocument)1 CMWizardDialog (com.cubrid.common.ui.spi.dialog.CMWizardDialog)1