本文整理汇总了Java中org.eclipse.jface.wizard.IWizardContainer类的典型用法代码示例。如果您正苦于以下问题:Java IWizardContainer类的具体用法?Java IWizardContainer怎么用?Java IWizardContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IWizardContainer类属于org.eclipse.jface.wizard包,在下文中一共展示了IWizardContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveModel
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
protected void saveModel(final IFile file) throws InvocationTargetException, InterruptedException {
WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
@Override
protected void execute(IProgressMonitor progressMonitor) {
try {
EObject model = createInitialModel();
EcoreIOUtil.saveModelAs(model, file);
} finally {
progressMonitor.done();
}
}
};
IWizardContainer container = getContainer();
container.run(false, false, operation);
}
示例2: validateHostname
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
/**
* Run the host name validator in the context of the wizard container and
* provide a custom error message
* @param appUrl
* @param server
* @param container
* @param message - override with custom error message
* @return
*/
public static HostnameValidationResult validateHostname(CloudApplicationURL appUrl, CloudFoundryServer server,
IWizardContainer container, String message) {
HostnameValidator val = message == null ? new HostnameValidator(appUrl, server)
: new HostnameValidator(appUrl, server, message);
try {
container.run(true, true, val);
}
catch (Exception e) {
CloudFoundryPlugin.logWarning("Hostname taken validation was not completed. " + e.getMessage()); //$NON-NLS-1$
IStatus status = new Status(IStatus.ERROR, CloudFoundryServerUiPlugin.PLUGIN_ID,
Messages.CloudApplicationUrlPart_ERROR_UNABLE_TO_CHECK_HOSTNAME);
return new HostnameValidationResult(status, val.isRouteCreated());
}
return new HostnameValidationResult(val.getStatus(), val.isRouteCreated());
}
示例3: createModelFile
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
public IFile createModelFile(IWizardContainer context, IPackageFragmentRoot packageFragmentRoot,
IPackageFragment packageFragment, String typeName, boolean isXtxtUml) {
try {
String filename;
StringBuilder contentBuilder = new StringBuilder();
if (isXtxtUml) {
filename = buildXtxtUmlModelFileContent(packageFragment, typeName, contentBuilder);
} else {
filename = buildJavaModelFileContent(packageFragment, typeName, contentBuilder);
}
if (createFile(context, packageFragmentRoot, packageFragment, contentBuilder.toString(), filename)) {
return (IFile) resource;
}
} catch (Throwable e) {
Logger.sys.error("Error while creating package/model-info file", e);
}
return null;
}
示例4: carefullyDisplayErrorDialog
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
private void carefullyDisplayErrorDialog(String message) {
if(message == null) {
message = "Unknown error.";
}
int errorCode = MessageDialog.ERROR;
IWizardContainer container = getContainer();
Shell shell = null;
if(container != null) {
shell = container.getShell();
}
// get a shell if the current one is null, we need to show the error.
if(shell == null) {
shell = WidgetUtils.getShell();
}
MessageDialog.open(errorCode, shell,
getErrorDialogTitle(), "Error encountered while " + getExportingActionVerb() + " " + getOutputProductNameSingular() + ": "
+ message, SWT.SHEET);
}
示例5: openPlanEditorFromWizard
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
public static IEditorPart openPlanEditorFromWizard(final IFile planFile, final IWorkbench workbench, IWizardContainer container) {
final IEditorPart[] result = new IEditorPart[1];
try {
container.run(false, false, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) {
try {
monitor.beginTask("Opening " + planFile.getName() + " in editor", IProgressMonitor.UNKNOWN);
result[0] = openEditorOnPlanFile(planFile, workbench);
} finally {
monitor.done();
}
}
});
} catch (Exception e) {
LogUtil.error(e);
}
return result[0];
}
示例6: setErrorMessage
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
/**
* Sets the error message for the active wizard page.
*
* Note that this method has no effect if the current page doesn't support error messages.
*/
private void setErrorMessage(String message) {
IWizardContainer container = getContainer();
if (container != null) {
IWizardPage currentPage = container.getCurrentPage();
if (currentPage instanceof DialogPage) {
((DialogPage) currentPage).setErrorMessage(message);
}
}
}
示例7: setContainer
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
@Override
public void setContainer(IWizardContainer wizardContainer) {
IWizardContainer oldContainer = this.getContainer();
if (oldContainer instanceof WizardDialog) {
((WizardDialog) oldContainer).removePageChangedListener(pageListener);
}
if (wizardContainer instanceof WizardDialog) {
WizardDialog wizDialog = (WizardDialog) wizardContainer;
wizDialog.addPageChangedListener(pageListener);
}
super.setContainer(wizardContainer);
}
示例8: setUseTemplate
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
public void setUseTemplate(boolean useTemplate){
fUseTemplate.setSelection(useTemplate);
wizardSelectionViewer.getControl().setEnabled(useTemplate);
if (!useTemplate)
setDescription(""); //$NON-NLS-1$
setDescriptionEnabled(useTemplate);
IWizardContainer container = getContainer();
if(container.getCurrentPage() != null){
container.updateButtons();
}
}
示例9: resetPageState
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
/**
* Resets the current page state by clearing the error message and making
* the page complete, thereby allowing users to flip to the next page.
*/
protected void resetPageState() {
if (pages.size() == 0)
return;
WizardPage firstPage = pages.get(0).page;
IWizardContainer container = firstPage.getWizard().getContainer();
WizardPage currentPage = (WizardPage) container.getCurrentPage();
currentPage.setErrorMessage(null);
currentPage.setPageComplete(true);
}
示例10: createXtxtUmlFile
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
public IFile createXtxtUmlFile(IWizardContainer context, IPackageFragmentRoot packageFragmentRoot,
IPackageFragment packageFragment, String filename) {
try {
StringBuilder contentBuilder = new StringBuilder();
buildXtxtUmlFileContent(packageFragment, contentBuilder);
if (createFile(context, packageFragmentRoot, packageFragment, contentBuilder.toString(), filename)) {
return (IFile) resource;
}
} catch (Throwable e) {
Logger.sys.error("Error while creating XtxtUML file", e);
}
return null;
}
示例11: setContainer
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
@Override
public void setContainer(IWizardContainer wizardContainer) {
super.setContainer(wizardContainer);
if (wizardContainer instanceof WizardDialog) {
WizardDialog wizardDialog = (WizardDialog) wizardContainer;
wizardDialog.addPageChangingListener(new ChangingListener());
wizardDialog.addPageChangedListener(new ChangedListener(wizardDialog));
wizardDialog.setHelpAvailable(true);
}
}
示例12: setContainer
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
@Override
public void setContainer(IWizardContainer wizardContainer)
{
if(getContainer() instanceof IPageChangeProvider) {
((IPageChangeProvider)getContainer()).removePageChangedListener(mPageChangedListener);
}
super.setContainer(wizardContainer);
if(getContainer() instanceof IPageChangeProvider) {
((IPageChangeProvider)getContainer()).addPageChangedListener(mPageChangedListener);
}
}
示例13: setContainer
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
@Override
public void setContainer(IWizardContainer wizardContainer) {
super.setContainer(wizardContainer);
if (wizardContainer != null) {
final WizardDialog wizardDialog = (WizardDialog)wizardContainer;
wizardDialog.addPageChangingListener(authenticationWizardPage);
wizardDialog.addPageChangedListener(workspaceWizardPage);
}
}
示例14: setContainer
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
@Override
public void setContainer(IWizardContainer wizardContainer) {
super.setContainer(wizardContainer);
if (wizardContainer != null) {
final WizardDialog wizardDialog = (WizardDialog)wizardContainer;
wizardDialog.addPageChangingListener(authenticationWizardPage);
wizardDialog.addPageChangedListener(projectWizardPage);
}
}
示例15: pageChanged
import org.eclipse.jface.wizard.IWizardContainer; //导入依赖的package包/类
/**
* Called whenever the wizard page has changed and forces its container
* to resize its content.
*
* @see org.eclipse.jface.dialogs.IPageChangedListener#pageChanged(org.eclipse.jface.dialogs.PageChangedEvent)
*/
public void pageChanged( PageChangedEvent event )
{
if ( this.wizardPage == event.getSelectedPage( ) )
{
// force size update
IWizardContainer container = getContainer( );
if ( container instanceof IWizardContainer2 )
{
( (IWizardContainer2) container ).updateSize( );
}
}
}