本文整理匯總了Java中org.eclipse.jface.wizard.IWizard類的典型用法代碼示例。如果您正苦於以下問題:Java IWizard類的具體用法?Java IWizard怎麽用?Java IWizard使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IWizard類屬於org.eclipse.jface.wizard包,在下文中一共展示了IWizard類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getWizard
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
@Override
public IWizard getWizard() {
SetupWizard wizard = (SetupWizard) super.getWizard();
wizard.postRegisterState(this.getClass().getSimpleName().toLowerCase());
StringBuffer summary = new StringBuffer();
for (IWizardPage page : wizard.getPages()) {
if (page instanceof SummaryGenerator) {
summary.append(((SummaryGenerator) page).getSummary() + "\n");
}
}
summaryText.setText(summary.toString());
setPageComplete(true);
return wizard;
}
示例2: getWizard
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
@Override
public IWizard getWizard() {
IWizardPage previousPage = getPreviousPage();
setErrorMessage(null);
setMessage(getDescription());
SetupWizard wizard = (SetupWizard) super.getWizard();
wizard.postRegisterState(this.getClass().getSimpleName().toLowerCase());
if (previousPage instanceof RegistrationPage) {
RegistrationPage registrationPage = (RegistrationPage) previousPage;
if (registrationPage.isConnected()) {
if (registrationPage.register(this)) {
infoLink.setText("Online registration in progress, please wait…");
}
} else {
infoLink.setText("Studio offline. Please register manually on " + RegistrationPage.registrationLink + " and paste your PSC here.");
setErrorMessage("Studio offline! Check your proxy settings");
}
} else {
infoLink.setText("Please paste your previous PSC here and click the 'Next >' button...");
}
infoLink.getParent().layout();
return super.getWizard();
}
示例3: execute
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(ID);
if (descriptor == null) {
descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(ID);
}
if (descriptor == null) {
descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(ID);
}
try {
if (descriptor != null) {
IWizard wizard = descriptor.createWizard();
WizardDialog wd = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
wd.setTitle(wizard.getWindowTitle());
wd.open();
}
} catch (CoreException e) {
e.printStackTrace();
}
return null;
}
示例4: openSubJobSaveDialog
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
/**
* Open sub graph save dialog.
*
* @return the i file
*/
public IFile openSubJobSaveDialog() {
IFile iFile = null;
IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(Messages.JOB_WIZARD_ID);
if (descriptor != null) {
IWizard wizard = null;
try {
wizard = descriptor.createWizard();
} catch (CoreException coreException) {
logger.error("Error while opening create job wizard", coreException);
}
WizardDialog wizardDialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
wizardDialog.setTitle(wizard.getWindowTitle());
wizardDialog.open();
JobCreationPage jobCreationPage = (JobCreationPage) wizardDialog.getSelectedPage();
iFile = jobCreationPage.getNewFile();
}
return iFile;
}
示例5: cleanupReservedRoutesIfNotNeeded
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
/**
* Clean up reserved URLs except those specified in the deployment info,
* from the context of a wizard
*
* @param workingCopy
* @param wizard - the wizard
* @param server - the CloudFoundryServer
* @param reservedUrls - the list of all reserved route URLS
*/
public static void cleanupReservedRoutesIfNotNeeded(DeploymentInfoWorkingCopy workingCopy, IWizard wizard,
final CloudFoundryServer server, List<CloudApplicationURL> reservedUrls) {
List<String> urls = workingCopy.getUris();
if (urls == null) {
urls = new ArrayList<String>();
}
// Clean up unused routes that were reserved and no longer needed
for (CloudApplicationURL cloudURL : reservedUrls) {
boolean isNeeded = false;
for (String url : urls) {
if (url.equals(cloudURL.getUrl())) {
isNeeded = true;
break;
}
}
if (!isNeeded) {
deleteRoute(wizard, server, cloudURL);
}
}
reservedUrls.clear();
}
示例6: openWizard
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
public void openWizard(String id) {
IWizardDescriptor descriptor = PlatformUI.getWorkbench()
.getNewWizardRegistry().findWizard(id);
if (descriptor == null) {
descriptor = PlatformUI.getWorkbench().getImportWizardRegistry()
.findWizard(id);
}
if (descriptor == null) {
descriptor = PlatformUI.getWorkbench().getExportWizardRegistry()
.findWizard(id);
}
try {
if (descriptor != null) {
IWizard wizard = descriptor.createWizard();
WizardDialog wd = new WizardDialog(Display.getDefault()
.getActiveShell(), wizard);
wd.setTitle(wizard.getWindowTitle());
wd.open();
}
} catch (CoreException e) {
e.printStackTrace();
}
}
示例7: handleOptionSelected
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
protected void handleOptionSelected() {
storeSettings();
comboBoxDatasets.setEnabled(radioButtonUseDataset.getSelection());
if (radioButtonAddDataset.getSelection()) {
setSelectedNode(new AWizardNode() {
public IWizard createWizard() {
IWizard pwizard = WizardDatasetPage.this.getWizard();
DatasetWizard w = new DatasetWizard(pwizard, pwizard.getNextPage(WizardDatasetPage.this));
if (pwizard instanceof JSSWizard)
w.setConfig( ((JSSWizard) pwizard).getConfig() );
return w;
}
});
setPageComplete(true);
}
}
示例8: addPage
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
/**
* Adds a new page to this wizard. The page is inserted at the end of the page list.
*
* @param page
* the new page
*/
public void addPage(IWizardPage page) {
wizardPages.add(page);
page.setWizard(this);
if (page instanceof JSSWizardPage) {
((JSSWizardPage) page).addChangeListener(this);
IWizard wiz = this.getParentWizard();
while (wiz != null && wiz instanceof JSSWizard) {
JSSWizard parentw = (JSSWizard) wiz;
((JSSWizardPage) page).addChangeListener(parentw);
wiz = parentw.getParentWizard();
}
}
}
示例9: getNextPage
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
/**
* The <code>WizardSelectionPage</code> implementation of this <code>IWizardPage</code> method returns the first page
* of the currently selected wizard if there is one.
*/
@Override
public IWizardPage getNextPage() {
if (selectedNode == null) {
return super.getNextPage();
}
boolean isCreated = selectedNode.isContentCreated();
IWizard wizard = selectedNode.getWizard();
if (wizard == null) {
setSelectedNode(null);
return null;
}
if (!isCreated) {
// Allow the wizard to create its pages
wizard.addPages();
}
IWizardPage nextPage = wizard.getStartingPage();
return nextPage;
}
示例10: getInitialContents
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
protected InputStream getInitialContents()
{
IWizard wizard = getWizard();
TemplateSelectionPage templateSelectionPage = (TemplateSelectionPage) wizard
.getPage(NewFileWizard.TEMPLATE_PAGE_NAME);
if (wizard.getContainer().getCurrentPage() == templateSelectionPage)
{
String templateContent = NewFileWizard.getTemplateContent(templateSelectionPage.getSelectedTemplate(),
getContainerFullPath().append(getFileName()));
if (templateContent != null)
{
return new ReaderInputStream(new StringReader(templateContent), IOUtil.UTF_8);
}
}
return super.getInitialContents();
}
示例11: finishPressed
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
/**
* The Finish button has been pressed.
*/
protected void finishPressed() {
// Wizards are added to the nested wizards list in setWizard.
// This means that the current wizard is always the last wizard in the
// list.
// Note that we first call the current wizard directly (to give it a
// chance to
// abort, do work, and save state) then call the remaining n-1 wizards
// in the
// list (to save state).
if (wizard.performFinish()) {
// Call perform finish on outer wizards in the nested chain
// (to allow them to save state for example)
for (int i = 0; i < nestedWizards.size() - 1; i++) {
((IWizard) nestedWizards.get(i)).performFinish();
}
// Hard close the dialog.
setReturnCode(OK);
hardClose();
}
}
示例12: hardClose
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
/**
* Closes this window.
*
* @return <code>true</code> if the window is (or was already) closed, and
* <code>false</code> if it is still open
*/
private boolean hardClose() {
// inform wizards
for (int i = 0; i < createdWizards.size(); i++) {
IWizard createdWizard = (IWizard) createdWizards.get(i);
try {
createdWizard.dispose();
} catch (Exception e) {
Status status = new Status(IStatus.ERROR, Policy.JFACE, IStatus.ERROR, e.getMessage(), e);
Policy.getLog().log(status);
}
// Remove this dialog as a parent from the managed wizard.
// Note that we do this after calling dispose as the wizard or
// its pages may need access to the container during
// dispose code
createdWizard.setContainer(null);
}
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=202534
// disposing the wizards could cause the image currently set in
// this dialog to be disposed. A subsequent repaint event during
// close would then fail. To prevent this case, we null out the image.
setTitleImage(null);
return super.close();
}
示例13: updateSizeForWizard
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
/**
* Computes the correct dialog size for the given wizard and resizes its shell if necessary.
*
* @param sizingWizard the wizard
*/
private void updateSizeForWizard(IWizard sizingWizard) {
Point delta = new Point(0, 0);
IWizardPage[] pages = sizingWizard.getPages();
for (int i = 0; i < pages.length; i++) {
// ensure the page container is large enough
Point pageDelta = calculatePageSizeDelta(pages[i]);
delta.x = Math.max(delta.x, pageDelta.x);
delta.y = Math.max(delta.y, pageDelta.y);
}
if (delta.x > 0 || delta.y > 0) {
// increase the size of the shell
Shell shell = getShell();
Point shellSize = shell.getSize();
setShellSize(shellSize.x + delta.x, shellSize.y + delta.y);
}
}
示例14: getNextPage
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
public IWizardPage getNextPage()
{
IWizard wiz = getWizard();
IWizardPage nextPage;
switch(info.getDatabaseType())
{
case DatabaseMeta.TYPE_DATABASE_ORACLE:
nextPage = wiz.getPage("oracle"); // Oracle //$NON-NLS-1$
break;
case DatabaseMeta.TYPE_DATABASE_INFORMIX:
nextPage = wiz.getPage("ifx"); // Informix //$NON-NLS-1$
break;
default:
nextPage = wiz.getPage("2"); // page 2 //$NON-NLS-1$
break;
}
return nextPage;
}
示例15: getNextPage
import org.eclipse.jface.wizard.IWizard; //導入依賴的package包/類
public IWizardPage getNextPage()
{
IWizard wiz = getWizard();
IWizardPage nextPage;
if (databaseMeta.getDatabaseInterface() instanceof OracleDatabaseMeta) {
nextPage = wiz.getPage("oracle"); // Oracle //$NON-NLS-1$
} else if (databaseMeta.getDatabaseInterface() instanceof InformixDatabaseMeta) {
nextPage = wiz.getPage("ifx"); // Informix //$NON-NLS-1$
} else
{
nextPage = wiz.getPage("2"); // page 2 //$NON-NLS-1$
}
return nextPage;
}