List of usage examples for org.eclipse.jface.dialogs IDialogConstants CANCEL_LABEL
String CANCEL_LABEL
To view the source code for org.eclipse.jface.dialogs IDialogConstants CANCEL_LABEL.
Click Source Link
From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorFilterDefinitionTest.java
License:Open Source License
@Test public void testExistingActorFilterDefinition() throws Exception { final String id = "test1"; final String textLabel = "Definition id *"; final String textLabelVersion = "Version *"; final String version = "1.1.0"; bot.textWithLabel(textLabel).setText(id); bot.button(IDialogConstants.FINISH_LABEL).click(); activateActorFilterDefinitonShell(); testButtonDisabled(id, textLabel);/*w w w. j a v a 2s.c o m*/ bot.textWithLabel(textLabelVersion).setText(version); bot.waitUntil(new ICondition() { @Override public boolean test() throws Exception { return bot.button(IDialogConstants.FINISH_LABEL).isEnabled(); } @Override public void init(SWTBot bot) { } @Override public String getFailureMessage() { return "changing version should enable finish button"; } }, 5000); bot.button(IDialogConstants.CANCEL_LABEL).click(); }
From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorFilterDefinitionTest.java
License:Open Source License
@Test public void testCreateExistingCategory() throws Exception { final String id = "test7"; final String version = "1.0.0"; final String categoryId = "category3"; SWTBotActorFilterUtil.createActorFilterDefinition(bot, id, version); SWTBotActorFilterUtil.createNewCategory(bot, categoryId); bot.button("New...").click(); bot.textWithLabel("Id").setText(categoryId); assertFalse("Ok button should be disabled when trying to create an existing category", bot.button(IDialogConstants.OK_LABEL).isEnabled()); bot.button(IDialogConstants.CANCEL_LABEL).click(); bot.button(IDialogConstants.FINISH_LABEL).click(); }
From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorFilterEditionTest.java
License:Open Source License
public void removeActorFilterDefinition(String name, String version) { SWTBotActorFilterUtil.activateActorFilterDefEditionShell(bot); bot.waitUntil(Conditions.widgetIsEnabled( bot.tree().expandNode("Uncategorized").getNode(name + " (" + version + ")")), 10000); bot.tree().expandNode("Uncategorized").select(name + " (" + version + ")"); assertNotNull("could not find" + name + " (" + version + ")", bot.tree().expandNode("Uncategorized").getNode(name + " (" + version + ")")); bot.tree().expandNode("Uncategorized").select(name + " (" + version + ")"); bot.button("Delete").click(); if (!FileActionDialog.getDisablePopup()) { bot.button(IDialogConstants.YES_LABEL).click(); }/*from w w w . j a v a 2s.c o m*/ bot.button(IDialogConstants.CANCEL_LABEL).click(); }
From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorFilterEditionTest.java
License:Open Source License
@Test public void testAddCategory() throws Exception { final String id = "testEdit4"; final String version = "1.0.0"; createActorFilterDefinition(id, version); SWTBotActorFilterUtil.activateActorFilterDefEditionShell(bot); bot.waitUntil(Conditions/*from w w w.j ava2 s. c om*/ .widgetIsEnabled(bot.tree().expandNode("Uncategorized").select(id + " (" + version + ")")), 10000); assertTrue(id + " does not exist in tree viewer", bot.tree().expandNode("Uncategorized").select(id + " (" + version + ")").isEnabled()); bot.tree().select("Uncategorized").expandNode("Uncategorized").select(id + " (" + version + ")"); bot.button(Messages.edit).click(); bot.treeWithLabel(org.bonitasoft.studio.connector.model.i18n.Messages.categoryLabel).select(0); bot.button(IDialogConstants.FINISH_LABEL).click(); ActorFilterDefRepositoryStore store = (ActorFilterDefRepositoryStore) RepositoryManager.getInstance() .getRepositoryStore(ActorFilterDefRepositoryStore.class); ConnectorDefinition connectorDef = store.getDefinition(id, version); assertEquals("category size should be equal to 1", connectorDef.getCategory().size(), 1); DefinitionResourceProvider messageProvider = DefinitionResourceProvider.getInstance(store, ActorsPlugin.getDefault().getBundle()); SWTBotActorFilterUtil.activateActorFilterDefEditionShell(bot); final Category category = connectorDef.getCategory().get(0); String categoryLabel = messageProvider.getCategoryLabel(category); if (categoryLabel == null) { categoryLabel = category.getId(); } final String connectorLabel = new ConnectorDefinitionTreeLabelProvider(messageProvider) .getText(connectorDef); assertNotNull("could not find " + connectorLabel, bot.tree().getTreeItem(categoryLabel).expand().getNode(connectorLabel)); bot.button(IDialogConstants.CANCEL_LABEL).click(); }
From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorFilterImplementationTest.java
License:Open Source License
@Test public void testPackageSyntax() throws Exception { final String id = "testImplementation"; final String definition = "testEdit"; final String className = "MyactorFilterImpl"; final String packageName = "org.bonita.actorFilter."; SWTBotActorFilterUtil.activateActorFilterImplementationShell(bot); selectDefinition(definition);// w ww . j a v a 2 s.co m bot.textWithLabel("Implementation id *").setText(id); bot.textWithLabel("Class name *").setText(className); bot.textWithLabel("Package *").setText(packageName); assertFalse("finish button should be desabled", bot.button(IDialogConstants.FINISH_LABEL).isEnabled()); bot.button(IDialogConstants.CANCEL_LABEL).click(); }
From source file:org.bonitasoft.studio.actors.tests.SWTbot.ActorFilterImplementationTest.java
License:Open Source License
@Test public void testActorFilterImplEditionWithSameDefandClassName() { final int nbEditorsBefore = bot.editors().size(); final String id = "testImplementation4"; final String id2 = "testImplementation5"; final String definition = "testEdit"; final String className = "MyactorFilterImpl"; final String packageName = "org.bonita.actorFilter.test"; SWTBotActorFilterUtil.activateActorFilterImplementationShell(bot); selectDefinition(definition);/*from w w w. j a v a 2 s.c o m*/ bot.textWithLabel("Implementation id *").setText(id); bot.textWithLabel("Class name *").setText(className); bot.textWithLabel("Package *").setText(packageName); bot.waitUntil(Conditions.widgetIsEnabled(bot.button(IDialogConstants.FINISH_LABEL)), 5000); bot.button(IDialogConstants.FINISH_LABEL).click(); bot.waitUntil(new ICondition() { @Override public boolean test() throws Exception { return nbEditorsBefore + 1 == bot.editors().size(); } @Override public void init(SWTBot bot) { } @Override public String getFailureMessage() { return "Editor for implementation has not been opened."; } }, 30000); SWTBotActorFilterUtil.activateActorFilterImplementationShell(bot); selectDefinition(definition); bot.textWithLabel("Implementation id *").setText(id2); bot.textWithLabel("Class name *").setText(className); bot.textWithLabel("Package *").setText(packageName); bot.waitUntil(new ICondition() { @Override public boolean test() throws Exception { return !bot.button(IDialogConstants.FINISH_LABEL).isEnabled(); } @Override public void init(SWTBot bot) { } @Override public String getFailureMessage() { return "Finish button should be disabled"; } }); bot.button(IDialogConstants.CANCEL_LABEL).click(); removeImplementation(id); }
From source file:org.bonitasoft.studio.application.dialog.ExitDialog.java
License:Open Source License
public static ExitDialog openExitDialog(final Shell parentShell) { final ExitDialog exitDialog = new ExitDialog(parentShell, IDEWorkbenchMessages.PromptOnExitDialog_shellTitle, null, null, WARNING, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0, IDEWorkbenchMessages.PromptOnExitDialog_choice, false); exitDialog.open();/* ww w . j a v a2 s . c o m*/ return exitDialog; }
From source file:org.bonitasoft.studio.application.test.wizards.TestOpenProcessWizard.java
License:Open Source License
public void testShow() throws Throwable { assertThat(wizard, is(notNullValue())); bot.button(IDialogConstants.CANCEL_LABEL).click(); assertThat(Conditions.shellCloses(target).test(), is(true)); }
From source file:org.bonitasoft.studio.common.diagram.tools.CustomDiagramGraphicalViewerKeyHandler.java
License:Open Source License
@Override public boolean keyPressed(KeyEvent event) { if (event.keyCode == 127) { GraphicalEditPart part = (GraphicalEditPart) getFocusEditPart(); Widget widget = (Widget) part.resolveSemanticElement(); String[] buttonList = { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }; List<Object> widgetSelected = new ArrayList<Object>(); widgetSelected.add(widget);/* w w w . ja va 2 s .c o m*/ OutlineDialog dialog = new OutlineDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.deleteFormFieldDialogTitle, Display.getCurrent().getSystemImage(SWT.ICON_WARNING), Messages.bind(Messages.askConfirmationForDeleting, widget.getName()), MessageDialog.CONFIRM, buttonList, 1, widgetSelected); int ok = 0; RemoveWidgetReferencesOperation op = new RemoveWidgetReferencesOperation( ModelHelper.getPageFlow(widget), widget); if (ok == dialog.open()) { CompoundCommand cc = new CompoundCommand(); op.setCompoundCommand(cc); op.updateReferencesInScripts(); IProgressService service = PlatformUI.getWorkbench().getProgressService(); try { service.busyCursorWhile(op); } catch (InvocationTargetException e) { BonitaStudioLog.error(e); } catch (InterruptedException e) { BonitaStudioLog.error(e); } if (!op.isCanExecute()) { event.doit = false; return false; } } else { event.doit = false; return false; } } return super.keyPressed(event); }
From source file:org.bonitasoft.studio.common.jface.dialog.FinishAndAddCustomWizardDialog.java
License:Open Source License
private Button moveCancelButton() { final Button cancelButton = getButton(IDialogConstants.CANCEL_ID); cancelButton.setText(IDialogConstants.CANCEL_LABEL); cancelButton.moveBelow(null);/*from w ww. jav a 2 s . co m*/ return cancelButton; }