use of org.eclipse.jface.wizard.WizardPage in project webtools.servertools by eclipse.
the class GenericServerTemplate method addPages.
public void addPages(Wizard wizard) {
WizardPage page = createPage(0);
page.setTitle(Messages.pageTitle);
page.setDescription(Messages.pageDescription);
wizard.addPage(page);
markPagesAdded();
}
use of org.eclipse.jface.wizard.WizardPage in project jbosstools-openshift by jbosstools.
the class WizardHandleAwareFragment method getWizardContainer.
/**
* Helper method to extract wizard container from the handle.
* May return null, if composite is not yet created or if wizard is disposed.
*
* @return
*/
protected IWizardContainer getWizardContainer() {
if (!(handle instanceof WizardPage)) {
return null;
}
WizardPage page = (WizardPage) handle;
if (page.getShell() == null || page.getShell().isDisposed()) {
return null;
}
IWizard wizard = page.getWizard();
return (wizard == null) ? null : wizard.getContainer();
}
use of org.eclipse.jface.wizard.WizardPage in project pentaho-kettle by pentaho.
the class CreateDatabaseWizard method createAndRunDatabaseWizard.
/**
* Shows a wizard that creates a new database connection...
*
* @param shell
* @param props
* @param databases
* @return DatabaseMeta when finished or null when canceled
*/
public DatabaseMeta createAndRunDatabaseWizard(Shell shell, PropsUI props, List<DatabaseMeta> databases) {
DatabaseMeta newDBInfo = new DatabaseMeta();
final CreateDatabaseWizardPage1 page1 = new CreateDatabaseWizardPage1("1", props, newDBInfo, databases);
final CreateDatabaseWizardPageInformix pageifx = new CreateDatabaseWizardPageInformix("ifx", props, newDBInfo);
final CreateDatabaseWizardPageJDBC pagejdbc = new CreateDatabaseWizardPageJDBC("jdbc", props, newDBInfo);
final CreateDatabaseWizardPageOCI pageoci = new CreateDatabaseWizardPageOCI("oci", props, newDBInfo);
final CreateDatabaseWizardPageODBC pageodbc = new CreateDatabaseWizardPageODBC("odbc", props, newDBInfo);
final CreateDatabaseWizardPageOracle pageoracle = new CreateDatabaseWizardPageOracle("oracle", props, newDBInfo);
final CreateDatabaseWizardPageGeneric pageGeneric = new CreateDatabaseWizardPageGeneric("generic", props, newDBInfo);
final CreateDatabaseWizardPage2 page2 = new CreateDatabaseWizardPage2("2", props, newDBInfo);
for (PluginInterface pluginInterface : PluginRegistry.getInstance().getPlugins(DatabasePluginType.class)) {
try {
Object plugin = PluginRegistry.getInstance().loadClass(pluginInterface);
if (plugin instanceof WizardPageFactory) {
WizardPageFactory factory = (WizardPageFactory) plugin;
additionalPages.add(factory.createWizardPage(props, newDBInfo));
}
} catch (KettlePluginException kpe) {
// Don't do anything
}
}
// set to false for safety only
wizardFinished = false;
Wizard wizard = new Wizard() {
/**
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
public boolean performFinish() {
wizardFinished = true;
return true;
}
/**
* @see org.eclipse.jface.wizard.Wizard#canFinish()
*/
public boolean canFinish() {
return page2.canFinish();
}
};
wizard.addPage(page1);
wizard.addPage(pageoci);
wizard.addPage(pageodbc);
wizard.addPage(pagejdbc);
wizard.addPage(pageoracle);
wizard.addPage(pageifx);
wizard.addPage(pageGeneric);
for (WizardPage page : additionalPages) {
wizard.addPage(page);
}
wizard.addPage(page2);
WizardDialog wd = new WizardDialog(shell, wizard);
WizardDialog.setDefaultImage(GUIResource.getInstance().getImageWizard());
wd.setMinimumPageSize(700, 400);
wd.updateSize();
wd.open();
if (!wizardFinished) {
newDBInfo = null;
}
return newDBInfo;
}
use of org.eclipse.jface.wizard.WizardPage in project dbeaver by serge-rider.
the class AbstractNativeToolWizard method updateErrorMessage.
void updateErrorMessage() {
WizardPage currentPage = (WizardPage) getStartingPage();
if (isNativeClientHomeRequired()) {
String clientHomeId = getSettings().getDataSourceContainer().getConnectionConfiguration().getClientHomeId();
List<DBPNativeClientLocation> nativeClientLocations = getSettings().getDataSourceContainer().getDriver().getNativeClientLocations();
if (CommonUtils.isEmpty(clientHomeId)) {
if (nativeClientLocations != null && !nativeClientLocations.isEmpty()) {
settings.setClientHome(nativeClientLocations.get(0));
} else {
settings.setClientHome(null);
}
if (settings.getClientHome() == null) {
currentPage.setErrorMessage(TaskNativeUIMessages.tools_wizard_message_no_client_home);
getContainer().updateMessage();
return;
}
} else {
DBPNativeClientLocation clientHome = DBUtils.findObject(nativeClientLocations, clientHomeId);
if (clientHome == null) {
clientHome = getSettings().findNativeClientHome(clientHomeId);
}
if (clientHome == null) {
// Make local client home from location
clientHome = new LocalNativeClientLocation(clientHomeId, clientHomeId);
}
settings.setClientHome(clientHome);
}
if (settings.getClientHome() == null) {
currentPage.setErrorMessage(NLS.bind(TaskNativeUIMessages.tools_wizard_message_client_home_not_found, clientHomeId));
} else {
currentPage.setErrorMessage(null);
}
getContainer().updateMessage();
}
}
use of org.eclipse.jface.wizard.WizardPage in project yamcs-studio by yamcs.
the class NewOPIImageLibExampleWizard method addPages.
@Override
public void addPages() {
super.addPages();
setWindowTitle(WINDOW_TITLE);
addPage(new WizardPage(WIZARD_PAGE) {
@Override
public void createControl(Composite parent) {
setTitle(WIZARD_PAGE_TITLE);
setDescription(WIZARD_PAGE_DESCRIPTION);
var container = new Composite(parent, SWT.None);
container.setLayout(new GridLayout());
setControl(container);
var label = new Label(container, SWT.WRAP);
var gd = new GridData();
gd.widthHint = 500;
label.setLayoutData(gd);
label.setText("OPI Image Library will be imported to your workspace. " + NLS.bind("If there is already a project named \"{0}\" in your workspace," + "the import will fail. ", InstallOPIImageLibraryAction.PROJECT_NAME) + "Please rename or delete it and import again.");
}
});
}
Aggregations