Example usage for org.eclipse.jface.dialogs IDialogConstants NEXT_ID

List of usage examples for org.eclipse.jface.dialogs IDialogConstants NEXT_ID

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IDialogConstants NEXT_ID.

Prototype

int NEXT_ID

To view the source code for org.eclipse.jface.dialogs IDialogConstants NEXT_ID.

Click Source Link

Document

Button id for a "Next" button (value 15).

Usage

From source file:net.refractions.udig.catalog.tests.ui.workflow.ConnectionFileTest.java

License:Open Source License

@Test
public void testWorkbenchSelection() {
    // create a workbench selection
    try {//from  ww w. j  a v a  2s. c o  m
        URL url = CatalogTestsUIPlugin.getDefault().getBundle().getEntry("data/");
        url = FileLocator.toFileURL(new URL(url, "streams.shp"));

        workflow.setContext(url);
    } catch (Exception e) {
        e.printStackTrace();
        fail();
    }

    Assertion a1 = new Assertion() {
        @Override
        public void run() {
            Button next = DialogDriver.findButton(dialog, IDialogConstants.NEXT_ID);
            fail = !next.isEnabled();
        }
    };
    Object[] actions = new Object[] { a1, IDialogConstants.CANCEL_ID };

    DialogDriver driver = new DialogDriver(dialog, actions);
    driver.schedule();

    dialog.open();

    assertFalse(a1.fail);
    driver.cancel();
}

From source file:net.refractions.udig.catalog.tests.ui.workflow.ConnectionFileTest.java

License:Open Source License

@Test
public void testConnection() {
    //create a workbench selection
    try {/* ww w .ja va 2 s  .co  m*/
        URL url = CatalogTestsUIPlugin.getDefault().getBundle().getEntry("data/");
        url = FileLocator.toFileURL(new URL(url, "streams.shp"));
        workflow.setContext(url);
    } catch (Exception e) {
        e.printStackTrace();
        fail();
    }

    Object[] actions = new Object[] { IDialogConstants.NEXT_ID, IDialogConstants.CANCEL_ID };

    DialogDriver driver = new DialogDriver(dialog, actions);
    driver.schedule();

    dialog.open();
    driver.cancel();

    assertNotNull(state.getServices());
    assertFalse(state.getServices().isEmpty());

}

From source file:net.refractions.udig.catalog.ui.FileConnectionPage.java

License:Open Source License

private void selectAndContinueWizard() {
    boolean okPressed;
    list.clear();/*from  w  ww . j ava2s. c o m*/
    okPressed = openFileDialog(comp);
    viewer.setInput(list);
    getContainer().updateButtons();

    /*
     * XXX I'm not liking this. I think the workflow should be used to drive the pages because
     * by trying to put the buttons it is dependent the implementation of
     * ConnectionPageDecorator's isPageComplete method as well as what order the
     * WorkflowWizard's canFinish method is implemented. IE if canFinish does not call
     * isPageComplete before calling dryRun() the finish button will not be activated.
     */
    if (okPressed) {
        if (findButton(getShell().getChildren(), IDialogConstants.FINISH_ID).isEnabled()) {
            pushButton(IDialogConstants.FINISH_ID);
        } else {
            pushButton(IDialogConstants.NEXT_ID);
        }
    } else {
        pushButton(IDialogConstants.BACK_ID);
    }

}

From source file:net.refractions.udig.internal.ui.TipDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, false);
    createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, true);
}

From source file:net.refractions.udig.internal.ui.TipDialog.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {
    if (IDialogConstants.NEXT_ID == buttonId) {
        next(-1);//from w ww  . ja  v a 2  s .com
        updateTip();
    }
    if (buttonId == IDialogConstants.CLOSE_ID) {
        IPreferenceStore store = UiPlugin.getDefault().getPreferenceStore();
        store.setValue(PreferenceConstants.P_SHOW_TIPS, check.getSelection());
        okPressed();
    }
}

From source file:org.bonitasoft.studio.connector.model.definition.dialog.ConnectorDefinitionWizardDialog.java

License:Open Source License

@Override
public void showPage(IWizardPage page) {
    super.showPage(page);
    if (page instanceof PageWidgetsWizardPage) {
        ExtensibleWizard wizard = (ExtensibleWizard) getWizard();
        wizard.addAdditionalPage(page);//from   w  w  w .  j a  va  2  s.  c o  m
        updateButtons();
        getButton(IDialogConstants.FINISH_ID).setText(Messages.apply);
        getButton(IDialogConstants.NEXT_ID).setVisible(false);
        getButton(IDialogConstants.BACK_ID).setVisible(false);
    } else {
        getButton(IDialogConstants.NEXT_ID).setVisible(true);
        getButton(IDialogConstants.BACK_ID).setVisible(true);
        getButton(IDialogConstants.FINISH_ID).setText(IDialogConstants.FINISH_LABEL);
    }
}

From source file:org.bonitasoft.studio.contract.ui.wizard.AddInputContractFromDataWizardDialog.java

License:Open Source License

@Override
public void updateButtons() {
    super.updateButtons();
    final Button nextButton = getButton(IDialogConstants.NEXT_ID);
    if (getCurrentPage() instanceof CreateContractInputFromBusinessObjectWizardPage) {
        nextButton.setText(Messages.preview);
    } else {/*w  w w . j a v a 2  s  .  c om*/
        nextButton.setText(IDialogConstants.NEXT_LABEL);
    }

}

From source file:org.eclipse.b3.build.ui.commands.ConfigurableWizardDialog.java

License:Open Source License

public void configureButtonsForEndPage() {
    // disable Cancel
    Button b = getButton(IDialogConstants.CANCEL_ID);
    b.setEnabled(false);//  ww  w.j  ava2 s. c  o  m

    // modify label of finish
    b = getButton(IDialogConstants.FINISH_ID);
    b.setText("Close");

    // hide next and previous buttons (if available
    b = getButton(IDialogConstants.NEXT_ID);
    if (b != null)
        b.setVisible(false);
    b = getButton(IDialogConstants.BACK_ID);
    if (b != null)
        b.setVisible(false);

}

From source file:org.eclipse.birt.core.ui.frameworks.taskwizard.WizardBaseDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.BACK_ID, Messages.getString("WizardBase.Back"), //$NON-NLS-1$
            false);//  w ww .j a  va 2s . c  o  m
    createButton(parent, IDialogConstants.NEXT_ID, Messages.getString("WizardBase.Next"), //$NON-NLS-1$
            false);
    createButton(parent, IDialogConstants.FINISH_ID, Messages.getString("WizardBase.Finish"), //$NON-NLS-1$
            this.wizardBase.bEnterClosed);
    createButton(parent, IDialogConstants.CANCEL_ID, Messages.getString("WizardBase.Cancel"), //$NON-NLS-1$
            false);

    for (int i = 0; i < this.wizardBase.buttonList.size(); i++) {
        IButtonHandler buttonHandler = this.wizardBase.buttonList.get(i);
        // Make sure the same id was not registered.
        assert getButton(buttonHandler.getId()) == null;
        buttonHandler.setButton(createButton(parent, buttonHandler.getId(), buttonHandler.getLabel(), false));
    }

    // Update buttons status
    int taskIndex = this.wizardBase.vTaskIDs.indexOf(this.wizardBase.sCurrentActiveTask);
    if (taskIndex > 0) {
        getButton(IDialogConstants.BACK_ID).setEnabled(true);
    } else {
        getButton(IDialogConstants.BACK_ID).setEnabled(false);
    }
    if (taskIndex < this.wizardBase.vTaskIDs.size() - 1) {
        getButton(IDialogConstants.NEXT_ID).setEnabled(true);
    } else {
        getButton(IDialogConstants.NEXT_ID).setEnabled(false);
    }
}

From source file:org.eclipse.birt.core.ui.frameworks.taskwizard.WizardBaseDialog.java

License:Open Source License

protected void buttonPressed(int buttonId) {
    if (IDialogConstants.FINISH_ID == buttonId) {
        okPressed();//from   w  w w . ja  v  a 2 s  .  c  o  m
    } else if (IDialogConstants.CANCEL_ID == buttonId) {
        cancelPressed();
    } else if (IDialogConstants.BACK_ID == buttonId) {
        backPressed();
    } else if (IDialogConstants.NEXT_ID == buttonId) {
        nextPressed();
    }

    for (int i = 0; i < this.wizardBase.buttonList.size(); i++) {
        IButtonHandler buttonHandler = this.wizardBase.buttonList.get(i);
        if (buttonId == buttonHandler.getId()) {
            buttonHandler.run();
            break;
        }
    }
}