use of org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher in project jbosstools-openshift by jbosstools.
the class DisableSecureStorageRequirement method setSecureStorageMasterPasswords.
private void setSecureStorageMasterPasswords(boolean checked) {
WorkbenchPreferenceDialog preferenceDialog = new WorkbenchPreferenceDialog();
StoragePreferencePage storagePage = new StoragePreferencePage(preferenceDialog);
preferenceDialog.open();
preferenceDialog.select(storagePage);
try {
new WaitUntil(new WidgetIsFound(org.eclipse.swt.custom.CLabel.class, new WithMnemonicTextMatcher("Secure Storage")), TimePeriod.DEFAULT);
log.info("Getting master password providers");
List<PasswordProvider> items = storagePage.getMasterPasswordProviders();
for (PasswordProvider item : items) {
log.info("Uncheking table item: " + item.getDescription());
item.setEnabled(checked);
}
new WaitUntil(new JobIsRunning(), TimePeriod.DEFAULT, false);
storagePage.apply();
} catch (WaitTimeoutExpiredException exc) {
log.error("Secure Storage preferences page has timed out");
log.error(exc.getMessage());
} finally {
preferenceDialog.ok();
}
}
use of org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher in project linuxtools by eclipse.
the class RunDockerImageLaunchConfiguration method deleteRunConfiguration.
public void deleteRunConfiguration(String configuratioName) {
selectConfiguration(configuratioName);
new DefaultToolItem(DELETE_LAUNCH_CONFIGURATION_LABEL).click();
Shell deleteShell = new DefaultShell("Confirm Launch Configuration Deletion");
WidgetIsFound deleteButton = new WidgetIsFound(org.eclipse.swt.widgets.Button.class, deleteShell.getSWTWidget(), new WithMnemonicTextMatcher("Delete"));
Button button;
if (deleteButton.test()) {
// photon changed button text
button = new PushButton(deleteShell, "Delete");
} else {
button = new YesButton(deleteShell);
}
button.click();
new WaitWhile(new ShellIsAvailable(deleteShell));
new WaitUntil(new ShellIsAvailable("Run Configurations"));
}
use of org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher in project jbosstools-openshift by jbosstools.
the class CDKTestUtils method removeAccessRedHatCredentials.
// removes access redhat com credentials used for first cdk run
public static void removeAccessRedHatCredentials(String domain, String username) {
WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog();
dialog.open();
// $NON-NLS-1$ //$NON-NLS-2$
dialog.select("JBoss Tools", "Credentials");
try {
new WaitUntil(new WidgetIsFound(org.eclipse.swt.custom.CLabel.class, new WithMnemonicTextMatcher("Credentials")), // $NON-NLS-1$
TimePeriod.MEDIUM);
// $NON-NLS-1$
new DefaultCLabel("Credentials");
DefaultTree tree = new DefaultTree(1);
TreeItem item = TreeViewerHandler.getInstance().getTreeItem(tree, new String[] { domain, username });
item.select();
// $NON-NLS-1$
new PushButton(new WithTextMatcher("Remove User")).click();
new WaitUntil(new JobIsRunning(), TimePeriod.MEDIUM, false);
} catch (WaitTimeoutExpiredException exc) {
// $NON-NLS-1$
log.error("JBoss Tools - Credentials preferences page has timed out");
exc.printStackTrace();
} catch (JFaceLayerException exc) {
// $NON-NLS-1$
log.error("JBoss Tools - Credentials does not contain required username to be deleted");
exc.printStackTrace();
} finally {
dialog.ok();
}
}
use of org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher in project jbosstools-hibernate by jbosstools.
the class ProjectConfigurationFactory method convertProjectToFacetsForm.
/**
* Convert project to facet form
* @param prj given project name
*/
public static void convertProjectToFacetsForm(String prj) {
ProjectExplorer pe = new ProjectExplorer();
pe.open();
PropertyDialog pd = pe.getProject(prj).openProperties();
pd.select("Project Facets");
// convert to faceted form
new DefaultTreeItem("Project Facets").select();
new DefaultLink("Convert to faceted form...").click();
new WaitWhile(new JobIsRunning());
new WaitUntil(new WidgetIsFound(Button.class, new WithStyleMatcher(SWT.PUSH), new WithMnemonicTextMatcher("Apply")), TimePeriod.LONG);
PushButton apply = new PushButton("Apply");
new WaitUntil(new ControlIsEnabled(apply));
apply.click();
pd.ok();
}
use of org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher in project jbosstools-hibernate by jbosstools.
the class ProjectConfigurationFactory method closePreferences.
private static void closePreferences(PropertyDialog pd) {
WidgetIsFound applyAndCloseButton = new WidgetIsFound(org.eclipse.swt.widgets.Button.class, new WithMnemonicTextMatcher("Apply and Close"));
org.eclipse.reddeer.swt.api.Button btn;
if (applyAndCloseButton.test()) {
// oxygen changed button text
btn = new PushButton("Apply and Close");
} else {
btn = new OkButton();
}
btn.click();
new WaitUntil(new ShellIsAvailable("Warning"), TimePeriod.SHORT, false);
// when eclipse is build by maven some plugins are missing
while (new ShellIsAvailable("Warning").test()) {
Shell warningShell = new DefaultShell("Warning");
new PushButton(warningShell, "Yes").click();
new WaitWhile(new ShellIsAvailable(warningShell));
}
new WaitWhile(new ShellIsAvailable(pd.getShell()));
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Aggregations