use of org.eclipse.jface.wizard.IWizardPage in project translationstudio8 by heartsome.
the class NewTmDbBaseInfoPage method getNextPage.
public IWizardPage getNextPage() {
WizardPage nextPage = (WizardPage) super.getNextPage();
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
if (canCreateDb(monitor) != null) {
throw new InterruptedException();
}
}
};
try {
getContainer().run(true, true, runnable);
} catch (InvocationTargetException e) {
e.printStackTrace();
return null;
} catch (InterruptedException e) {
e.printStackTrace();
return null;
}
nextPage.setErrorMessage(null);
return nextPage;
}
use of org.eclipse.jface.wizard.IWizardPage in project cubrid-manager by CUBRID.
the class ImportDataWizardDialog method createContents.
/**
* Overwrite the method. Auto add IPageChangingListener(s);
*
* @param parent of the control.
* @return Control
*/
protected Control createContents(Composite parent) {
Control result = super.createContents(parent);
IWizardPage[] pages = this.getWizard().getPages();
for (IWizardPage page : pages) {
if (page instanceof IPageChangingListener) {
this.addPageChangingListener((IPageChangingListener) page);
}
if (page instanceof IPageChangedListener) {
this.addPageChangedListener((IPageChangedListener) page);
}
}
return result;
}
use of org.eclipse.jface.wizard.IWizardPage in project dbeaver by serge-rider.
the class MultiPageWizardDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
wizard.addPages();
wizardSash = new SashForm(composite, SWT.HORIZONTAL);
wizardSash.setLayoutData(new GridData(GridData.FILL_BOTH));
pagesTree = new Tree(wizardSash, SWT.SINGLE);
pagesTree.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite pageContainer = UIUtils.createPlaceholder(wizardSash, 2);
// Vertical separator
new Label(pageContainer, SWT.SEPARATOR | SWT.VERTICAL).setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, true));
pageArea = UIUtils.createPlaceholder(pageContainer, 1);
GridData gd = new GridData(GridData.FILL_BOTH);
pageArea.setLayoutData(gd);
pageArea.setLayout(new GridLayout(1, true));
wizardSash.setWeights(new int[] { 300, 700 });
Point maxSize = new Point(0, 0);
IWizardPage[] pages = wizard.getPages();
for (IWizardPage page : pages) {
addPage(null, page, maxSize);
}
gd = (GridData) pageArea.getLayoutData();
gd.widthHint = 500;
gd.heightHint = 400;
pagesTree.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
changePage();
}
});
// Select first page
pagesTree.select(pagesTree.getItem(0));
changePage();
// Set title and image from first page
IDialogPage firstPage = (IDialogPage) pagesTree.getItem(0).getData();
setTitle(firstPage.getTitle());
setTitleImage(firstPage.getImage());
setMessage(firstPage.getMessage());
// Horizontal separator
new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR).setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// Progress monitor
monitorPart = new ProgressMonitorPart(composite, null, true) {
@Override
public void setCanceled(boolean b) {
super.setCanceled(b);
if (b) {
cancelCurrentOperation();
}
}
};
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.grabExcessHorizontalSpace = true;
gd.horizontalIndent = 20;
gd.verticalIndent = 0;
monitorPart.setLayoutData(gd);
monitorPart.setVisible(false);
return composite;
}
use of org.eclipse.jface.wizard.IWizardPage in project cubrid-manager by CUBRID.
the class SelectBrokerPage method pageChanged.
/**
* @see org.eclipse.jface.dialogs.IPageChangedListener#pageChanged(org.eclipse.jface.dialogs.PageChangedEvent)
* @param event PageChangedEvent
*/
/**
* @see org.eclipse.jface.dialogs.IPageChangedListener#pageChanged(org.eclipse.jface.dialogs.PageChangedEvent)
* @param event PageChangedEvent
*/
public void pageChanged(PageChangedEvent event) {
IWizardPage page = (IWizardPage) event.getSelectedPage();
if (page.getName().equals(PAGENAME)) {
AddHostAndDbWizard wizard = ((AddHostAndDbWizard) getWizard());
SetHostInfoPage setHostInfoPage = (SetHostInfoPage) getWizard().getPage(SetHostInfoPage.PAGENAME);
if (setHostInfoPage == null) {
hostNode = wizard.getSelectedHostNode();
} else {
hostNode = setHostInfoPage.getHostNode();
}
serverInfo = CMHostNodePersistManager.getInstance().getServerInfo(hostNode.getIp(), Integer.parseInt(hostNode.getPort()), hostNode.getUserName());
BrokerInfos brokerInfos = serverInfo.getBrokerInfos();
brokerInfoList = (brokerInfos == null || brokerInfos.getBorkerInfoList() == null) ? null : brokerInfos.getBorkerInfoList().getBrokerInfoList();
BrokerInfo brokerInfo = null;
brokerNameCombo.removeAll();
for (int i = 0; brokerInfos != null && i < brokerInfoList.size(); i++) {
if (i == 0) {
brokerInfo = brokerInfoList.get(i);
}
brokerNameCombo.add(brokerInfoList.get(i).getName());
}
if (brokerNameCombo.getItemCount() > 0) {
brokerNameCombo.select(0);
brokerStatusText.setText(brokerInfo.getState());
nickNameText.setText(brokerInfo.getName());
addButton.setEnabled(true);
} else {
addButton.setEnabled(false);
}
brokerNameCombo.setFocus();
}
}
use of org.eclipse.jface.wizard.IWizardPage in project cubrid-manager by CUBRID.
the class SelectDbPage method pageChanged.
/**
* @see org.eclipse.jface.dialogs.IPageChangedListener#pageChanged(org.eclipse.jface.dialogs.PageChangedEvent)
* @param event PageChangedEvent
*/
/**
* @see org.eclipse.jface.dialogs.IPageChangedListener#pageChanged(org.eclipse.jface.dialogs.PageChangedEvent)
* @param event PageChangedEvent
*/
public void pageChanged(PageChangedEvent event) {
IWizardPage page = (IWizardPage) event.getSelectedPage();
if (page.getName().equals(PAGENAME)) {
AddHostAndDbWizard wizard = ((AddHostAndDbWizard) getWizard());
SetHostInfoPage setHostInfoPage = (SetHostInfoPage) getWizard().getPage(SetHostInfoPage.PAGENAME);
if (setHostInfoPage == null) {
hostNode = wizard.getSelectedHostNode();
} else {
hostNode = setHostInfoPage.getHostNode();
}
serverInfo = CMHostNodePersistManager.getInstance().getServerInfo(hostNode.getIp(), Integer.parseInt(hostNode.getPort()), hostNode.getUserName());
List<DatabaseInfo> dbInfoList = serverInfo.getLoginedUserInfo().getDatabaseInfoList();
dbNameCombo.removeAll();
for (int i = 0; i < dbInfoList.size(); i++) {
dbNameCombo.add(dbInfoList.get(i).getDbName());
}
if (dbNameCombo.getItemCount() > 0) {
dbNameCombo.select(0);
nickNameText.setText(dbNameCombo.getText());
addButton.setEnabled(true);
} else {
addButton.setEnabled(false);
}
changeHAModeBtnStatus();
dbNameCombo.setFocus();
}
}
Aggregations