List of usage examples for org.eclipse.jface.dialogs IDialogConstants NEXT_LABEL
String NEXT_LABEL
To view the source code for org.eclipse.jface.dialogs IDialogConstants NEXT_LABEL.
Click Source Link
From source file:com.codesourcery.internal.installer.ui.WizardDialog.java
License:Open Source License
/** * Creates the Previous and Next buttons for this wizard dialog. Creates * standard (<code>SWT.PUSH</code>) buttons and registers for their * selection events. Note that the number of columns in the button bar * composite is incremented. These buttons are created specially to prevent * any space between them./* w w w .jav a 2 s.c o m*/ * * @param parent * the parent button bar * @return a composite containing the new buttons */ private Composite createPreviousAndNextButtons(Composite parent) { // increment the number of columns in the button bar ((GridLayout) parent.getLayout()).numColumns++; Composite composite = new Composite(parent, SWT.NONE); // create a layout with spacing and margins appropriate for the font // size. GridLayout layout = new GridLayout(); layout.numColumns = 0; // will be incremented by createButton layout.marginWidth = 0; layout.marginHeight = 0; layout.horizontalSpacing = 0; layout.verticalSpacing = 0; composite.setLayout(layout); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_CENTER); composite.setLayoutData(data); composite.setFont(parent.getFont()); backButton = createButton(composite, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false); nextButton = createButton(composite, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, false); // make sure screen readers skip visual '<', '>' chars on buttons: final String backReaderText = IDialogConstants.BACK_LABEL.replace('<', ' '); backButton.getAccessible().addAccessibleListener(new AccessibleAdapter() { public void getName(AccessibleEvent e) { e.result = backReaderText; } }); final String nextReaderText = IDialogConstants.NEXT_LABEL.replace('>', ' '); nextButton.getAccessible().addAccessibleListener(new AccessibleAdapter() { public void getName(AccessibleEvent e) { e.result = nextReaderText; } }); return composite; }
From source file:com.github.reprogrammer.swtbot.examples.EclipseBot.java
License:Open Source License
public void createNewJavaProject(String projectName) { bot.menu("File").menu("New").menu("Project...").click(); final SWTBotShell shell = activateShellWithName("New Project"); getCurrentTree().expandNode("Java").select("Java Project"); bot.button(IDialogConstants.NEXT_LABEL).click(); bot.textWithLabel("Project name:").setText(projectName); bot.button(IDialogConstants.FINISH_LABEL).click(); bot.waitUntil(new DefaultCondition() { @Override//w w w . j a v a2 s . c o m public boolean test() throws Exception { return Conditions.shellCloses(shell).test() || bot.shell("Open Associated Perspective?").isVisible(); } @Override public String getFailureMessage() { return "Failed to close the new project wizard."; } }); dismissJavaPerspectiveIfPresent(); }
From source file:com.google.dart.tools.ui.internal.dialogs.MultiElementListSelectionDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { fBackButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false); fNextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, true); fFinishButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.FINISH_LABEL, false); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }
From source file:com.nokia.tools.startuptip.ui.StartupTipDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { previousButton = createButton(parent, StartupTipDialog.PREVIOUS_ID, StartupTipDialog.PREVIOUS_LABEL, false); if (!tipSelector.previousAvailable()) { previousButton.setEnabled(false); }/*from w w w .j a v a 2 s.com*/ createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, false); createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); }
From source file:es.cv.gvcase.ide.navigator.dialogs.NavigatorSearchDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { backButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false); backButton.setEnabled(false);//w w w . j ava 2 s .c o m backButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { ISelection sel = viewer.getSelection(); if (!(sel instanceof StructuredSelection)) { return; } StructuredSelection ssel = (StructuredSelection) sel; int index = matchedObjects.lastIndexOf(ssel.getFirstElement()); if (index == 0) { index = matchedObjects.size() - 1; } index--; if (index < 0) { index = 0; } StructuredSelection ss = new StructuredSelection(matchedObjects.get(index)); viewer.setSelection(ss, true); } }); nextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, false); nextButton.setEnabled(false); nextButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { ISelection sel = viewer.getSelection(); if (!(sel instanceof StructuredSelection)) { return; } StructuredSelection ssel = (StructuredSelection) sel; int index = matchedObjects.lastIndexOf(ssel.getFirstElement()); if (index == matchedObjects.size() - 1) { index = -1; } index++; StructuredSelection ss = new StructuredSelection(matchedObjects.get(index)); viewer.setSelection(ss, true); } }); createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false); }
From source file:eu.numberfour.n4js.ui.organize.imports.MultiElementListSelectionDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { fBackButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false); // XXX: Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=279425 boolean HAS_BUG_279425 = true; fNextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, !HAS_BUG_279425); fFinishButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.FINISH_LABEL, HAS_BUG_279425); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }
From source file:kr.co.apexsoft.stella.modeler.explorer.dialog.ApexNavigatorSearchDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { backButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false); nextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, false); createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); backButton.setEnabled(false);/*from w w w. ja v a 2 s . c o m*/ nextButton.setEnabled(false); nextButton.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { } public void widgetSelected(SelectionEvent e) { if (currentIndex >= matchedObjects.size() - 1) { currentIndex = 0; } else { currentIndex++; } fireSetSelection(new StructuredSelection(matchedObjects.get(currentIndex)), true); } }); backButton.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { } public void widgetSelected(SelectionEvent e) { if (currentIndex <= 0) { currentIndex = matchedObjects.size() - 1; } else { currentIndex--; } fireSetSelection(new StructuredSelection(matchedObjects.get(currentIndex)), true); } }); }
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:org.bonitasoft.expressions.test.TestConnectorExpression.java
License:Open Source License
private void createConnectorDefinition(String id) { SWTBotConnectorTestUtil.activateConnectorDefinitionShell(bot); fillDefinition(id);/*from w w w . j a v a 2 s.c om*/ bot.button(IDialogConstants.NEXT_LABEL).click(); addInputsToConnectorDef(); bot.button(IDialogConstants.NEXT_LABEL).click(); createConnectorConfigurationWizard("connectorExpressionWizardTest"); bot.button(IDialogConstants.FINISH_LABEL).click(); }
From source file:org.bonitasoft.expressions.test.TestConnectorExpression.java
License:Open Source License
@Test public void testConnectorExpression() { final String id = "connectorExpressionTest"; createConnectorDefinition(id);/* w w w . j av a 2 s . co m*/ SWTBotConnectorTestUtil.activateConnectorTestWizard(bot); bot.text().setText(id); bot.table().select(id); // bot.tree().select("Uncategorized"); // bot.table().select(id); //bot.table().select(indices); bot.button(IDialogConstants.NEXT_LABEL).click(); bot.toolbarButtonWithId(SWTBOT_ID_EDITBUTTON, 0).click(); bot.table().select("Constant"); bot.text().setText("Hello World"); assertFalse("return type combobox should be disabled", bot.comboBoxWithLabel("Return type").isEnabled()); assertEquals("wrong return type", bot.comboBoxWithLabel("Return type").selection(), String.class.getName()); bot.button(IDialogConstants.OK_LABEL).click(); assertEquals("wrong value for input1", bot.textWithLabel("Input1").getText(), "Hello World"); editGroovyEditor(1, "Input2", Boolean.class.getName(), "booleanScriptTest", "1==1;"); editGroovyEditor(2, "Input3", Double.class.getName(), "doubleScriptTest", "(double)9.345+1.256;"); editGroovyEditor(3, "Input4", Float.class.getName(), "floatScriptTest", "(float)9.345+1.256;"); editGroovyEditor(4, "Input5", Integer.class.getName(), "integerScriptTest", "(int)9+10;"); editGroovyEditor(5, "Input6", List.class.getName(), "listScriptTest", "def list=[1,2,3];"); bot.button(IDialogConstants.CANCEL_LABEL).click(); }