本文整理匯總了Java中org.eclipse.jface.wizard.WizardDialog.setTitle方法的典型用法代碼示例。如果您正苦於以下問題:Java WizardDialog.setTitle方法的具體用法?Java WizardDialog.setTitle怎麽用?Java WizardDialog.setTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.wizard.WizardDialog
的用法示例。
在下文中一共展示了WizardDialog.setTitle方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: execute
import org.eclipse.jface.wizard.WizardDialog; //導入方法依賴的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;
}
示例2: openSubJobSaveDialog
import org.eclipse.jface.wizard.WizardDialog; //導入方法依賴的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;
}
示例3: openWizard
import org.eclipse.jface.wizard.WizardDialog; //導入方法依賴的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();
}
}
示例4: openWizard
import org.eclipse.jface.wizard.WizardDialog; //導入方法依賴的package包/類
public static void openWizard(final String id, final IStructuredSelection selection) {
// First see if this is a "new wizard".
IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(id);
// If not check if it is an "import wizard".
if (descriptor == null) {
descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(id);
}
// Or maybe an export wizard
if (descriptor == null) {
descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(id);
}
try {
// Then if we have a wizard, open it.
if (descriptor != null) {
final IWorkbenchWizard wizard = descriptor.createWizard();
wizard.init(PlatformUI.getWorkbench(), selection);
final WizardDialog wd = new WizardDialog(WorkbenchHelper.getDisplay().getActiveShell(), wizard);
wd.setTitle(wizard.getWindowTitle());
wd.open();
}
} catch (final CoreException e) {
e.printStackTrace();
}
}
示例5: getReplacementText
import org.eclipse.jface.wizard.WizardDialog; //導入方法依賴的package包/類
@Override
public String getReplacementText() {
IWizardDescriptor descriptor = WizardFinder.findNewWizardDescriptor("org.eclipse.ecoretools.emf.design.wizardID");
// Then if we have a wizard, open it.
if (descriptor != null) {
// add a listener to capture the creation of the resulting project
NewProjectWorkspaceListener workspaceListener = new NewProjectWorkspaceListener();
ResourcesPlugin.getWorkspace().addResourceChangeListener(
workspaceListener);
try {
IWizard wizard = descriptor.createWizard();
// this wizard need some dedicated initialization
String newProjectName = (packageName+"."+languageName+".model").toLowerCase();
((EcoreModelerWizard) wizard).setInitialProjectName(newProjectName);
((EcoreModelerWizard) wizard).init(PlatformUI.getWorkbench(),null);
WizardDialog wd = new WizardDialog(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell(), wizard);
wd.create();
wd.setTitle(wizard.getWindowTitle());
int res = wd.open();
if (res == WizardDialog.OK) {
ResourcesPlugin.getWorkspace().removeResourceChangeListener(workspaceListener);
ecoreProject = workspaceListener.getLastCreatedProject();
}
} catch (CoreException e) {
Activator.error(e.getMessage(), e);
} finally {
// make sure to remove listener in all situations
ResourcesPlugin.getWorkspace().removeResourceChangeListener(
workspaceListener);
if(ecoreProject != null){
return getCreatedEcoreUri();
}
}
}
return "";
}
示例6: createNewEMFProject
import org.eclipse.jface.wizard.WizardDialog; //導入方法依賴的package包/類
protected void createNewEMFProject() {
// launch the appropriate wizard
// "org.eclipse.emf.importer.ui.EMFProjectWizard" = create EMFProject
// from existing Ecore file
IWizardDescriptor descriptor = WizardFinder
.findNewWizardDescriptor("org.eclipse.ecoretools.emf.design.wizardID");
// Then if we have a wizard, open it.
if (descriptor != null) {
// add a listener to capture the creation of the resulting project
NewProjectWorkspaceListener workspaceListener = new NewProjectWorkspaceListener();
ResourcesPlugin.getWorkspace().addResourceChangeListener(
workspaceListener);
try {
IWizard wizard;
wizard = descriptor.createWizard();
// this wizard need some dedicated initialization
((EcoreModelerWizard) wizard)
.setInitialProjectName(MelangeXDSMLProjectHelper
.baseProjectName(gemocLanguageIProject)
+ ".model");
((EcoreModelerWizard) wizard).init(PlatformUI.getWorkbench(),
(IStructuredSelection) PlatformUI.getWorkbench()
.getActiveWorkbenchWindow()
.getSelectionService().getSelection());
// ((EcoreModelWizard)wizard).init(PlatformUI.getWorkbench(),
// (IStructuredSelection) selection);
WizardDialog wd = new WizardDialog(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell(), wizard);
wd.create();
wd.setTitle(wizard.getWindowTitle());
int res = wd.open();
if (res == WizardDialog.OK) {
ResourcesPlugin.getWorkspace()
.removeResourceChangeListener(workspaceListener);
createdProject = workspaceListener
.getLastCreatedProject();
// update the project configuration model
if (createdProject != null) {
addEMFProjectToConf(createdProject);
}
}
} catch (CoreException e) {
Activator.error(e.getMessage(), e);
} finally {
// make sure to remove listener in all situations
ResourcesPlugin.getWorkspace().removeResourceChangeListener(
workspaceListener);
}
}
}
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:55,代碼來源:CreateDomainModelWizardContextAction.java
示例7: createNewODProject
import org.eclipse.jface.wizard.WizardDialog; //導入方法依賴的package包/類
protected void createNewODProject() {
final IWizardDescriptor descriptor = WizardFinder
.findNewWizardDescriptor(org.eclipse.gemoc.xdsmlframework.extensions.sirius.Activator.PLUGIN_ID
+ ".wizards.NewGemocDebugRepresentationWizard");
// Then if we have a wizard, open it.
if (descriptor != null) {
NewProjectWorkspaceListener workspaceListener = new NewProjectWorkspaceListener();
ResourcesPlugin.getWorkspace().addResourceChangeListener(
workspaceListener);
try {
IWorkbenchWizard wizard;
wizard = descriptor.createWizard();
((NewGemocDebugRepresentationWizard) wizard).setInitialProjectName(gemocLanguageIProject.getName());
if(melangeLanguage != null){
((NewGemocDebugRepresentationWizard) wizard)
.setInitialLanguageName(melangeLanguage.getName());
}
IWorkbench workbench = PlatformUI.getWorkbench();
wizard.init(workbench, null);
WizardDialog wd = new WizardDialog(workbench
.getActiveWorkbenchWindow().getShell(), wizard);
wd.create();
wd.setTitle(wizard.getWindowTitle());
int res = wd.open();
if (res == WizardDialog.OK) {
ResourcesPlugin.getWorkspace()
.removeResourceChangeListener(workspaceListener);
IProject createdProject = workspaceListener
.getLastCreatedProject();
// update the project configuration model
if (createdProject != null) {
/* SiriusAnimatorProject animatorProject = Xdsml_baseFactoryImpl.eINSTANCE
.createSiriusAnimatorProject();
animatorProject
.setProjectName(createdProject.getName());
addOrUpdateProjectToConf(animatorProject); */
// DVK may be we should update something the melange files ?
} else {
Activator
.error("not able to detect which project was created by wizard",
null);
}
}
} catch (CoreException e) {
Activator.error(e.getMessage(), e);
} finally {
ResourcesPlugin.getWorkspace().removeResourceChangeListener(
workspaceListener);
}
} else {
Activator
.error("wizard with id=org.eclipse.gemoc.xdsmlframework.extensions.sirius.wizards.NewGemocDebugRepresentationWizard not found",
null);
}
}
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:56,代碼來源:CreateAnimatorProjectWizardContextAction.java
示例8: createNewXTextProject
import org.eclipse.jface.wizard.WizardDialog; //導入方法依賴的package包/類
protected void createNewXTextProject() {
/*
* MessageDialog.openWarning(
* PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
* "Gemoc Language Workbench UI",
* "Action not completly implemented yet");
*/
// create xtext project from existing ecore model
// wizard id =
// org.eclipse.xtext.xtext.ui.wizard.ecore2xtext.NewXtextProjectFromEcoreWizard
// launch the appropriate wizard
IWizardDescriptor descriptor = WizardFinder
.findNewWizardDescriptor("org.eclipse.xtext.xtext.ui.wizard.ecore2xtext.NewXtextProjectFromEcoreWizard");
// Then if we have a wizard, open it.
if (descriptor != null) {
// add a listener to capture the creation of the resulting project
NewProjectWorkspaceListener workspaceListener = new NewProjectWorkspaceListener();
ResourcesPlugin.getWorkspace().addResourceChangeListener(
workspaceListener);
try {
IWizard wizard;
wizard = descriptor.createWizard();
// this wizard need some dedicated initialization
// ((EcoreModelerWizard )wizard).init(PlatformUI.getWorkbench(),
// (IStructuredSelection)
// PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection());
// ((EcoreModelWizard)wizard).init(PlatformUI.getWorkbench(),
// (IStructuredSelection) selection);
WizardDialog wd = new WizardDialog(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell(), wizard);
wd.create();
wd.setTitle(wizard.getWindowTitle());
int res = wd.open();
if (res == WizardDialog.OK) {
ResourcesPlugin.getWorkspace()
.removeResourceChangeListener(workspaceListener);
ArrayList<IProject> newlyCreatedProjects = workspaceListener
.getNewlyCreatedProjects();
// find the created project with xtext files in it
FileFinderVisitor fileFinder = new FileFinderVisitor(
"xtext");
for (Iterator<IProject> iterator = newlyCreatedProjects
.iterator(); iterator.hasNext();) {
IProject iProject = (IProject) iterator.next();
iProject.accept(fileFinder);
if (fileFinder.getFile() != null) {
createdProject = iProject;
break;
}
}
// update the project configuration model
if (createdProject != null) {
// maybe we should do something in the melange file ?
} else {
Activator
.error("not able to detect which project was created by wizard",
null);
}
}
} catch (CoreException e) {
Activator.error(e.getMessage(), e);
} finally {
// make sure to remove listener in all situations
ResourcesPlugin.getWorkspace().removeResourceChangeListener(
workspaceListener);
}
} else {
Activator
.error("wizard with id=org.eclipse.xtext.xtext.ui.wizard.ecore2xtext.NewXtextProjectFromEcoreWizard not found",
null);
}
}
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:75,代碼來源:CreateEditorProjectWizardContextAction.java
示例9: createNewODProject
import org.eclipse.jface.wizard.WizardDialog; //導入方法依賴的package包/類
protected void createNewODProject() {
final IWizardDescriptor descriptor = WizardFinder
.findNewWizardDescriptor("org.eclipse.gemoc.xdsmlframework.extensions.sirius.wizards.NewGemocSiriusProjectWizard");
// Then if we have a wizard, open it.
if (descriptor != null) {
NewProjectWorkspaceListener workspaceListener = new NewProjectWorkspaceListener();
ResourcesPlugin.getWorkspace().addResourceChangeListener(
workspaceListener);
try {
IWorkbenchWizard wizard;
wizard = descriptor.createWizard();
((NewGemocSiriusProjectWizard)wizard).setInitialProjectName(MelangeXDSMLProjectHelper
.baseProjectName(gemocLanguageIProject));
IWorkbench workbench = PlatformUI.getWorkbench();
wizard.init(workbench, null);
WizardDialog wd = new WizardDialog(workbench
.getActiveWorkbenchWindow().getShell(), wizard);
wd.create();
wd.setTitle(wizard.getWindowTitle());
int res = wd.open();
if (res == WizardDialog.OK) {
ResourcesPlugin.getWorkspace()
.removeResourceChangeListener(workspaceListener);
createdProject = workspaceListener
.getLastCreatedProject();
// update the project configuration model
if (createdProject != null) {
// maybe we should do something in the melange file ?
} else {
Activator
.error("not able to detect which project was created by wizard",
null);
}
}
} catch (CoreException e) {
Activator.error(e.getMessage(), e);
} finally {
ResourcesPlugin.getWorkspace().removeResourceChangeListener(
workspaceListener);
}
} else {
Activator
.error("wizard with id=org.eclipse.sirius.ui.specificationproject.wizard not found",
null);
}
}
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:49,代碼來源:CreateEditorProjectWizardContextAction.java
示例10: importCreatedProject
import org.eclipse.jface.wizard.WizardDialog; //導入方法依賴的package包/類
private void importCreatedProject(File targetFolder) throws CoreException {
/* open import wizard with correct setup */
IWizardDescriptor descriptor = PlatformUI.getWorkbench().getImportWizardRegistry()
.findWizard(EGradleRootProjectImportWizard.ID);
if (descriptor == null) {
throw new IllegalStateException("Import was not possible, because of missing wizard!");
}
IWizard wizard = descriptor.createWizard();
if (!(wizard instanceof EGradleRootProjectImportWizard)) {
throw new IllegalStateException("Not a root project wizard but:" + wizard);
}
outputToSystemConsole("- start import for generated project");
EGradleRootProjectImportWizard piw = (EGradleRootProjectImportWizard) wizard;
piw.setCustomRootProjectpath(targetFolder.getAbsolutePath());
piw.setCustomJavaHome(context.getJavaHome());
piw.setImportMode(RootProjectConfigMode.NEW_PROJECT_WIZARD);
WizardDialog wd = new WizardDialog(getShell(), piw);
wd.setTitle("Import generated gradle project");
EclipseUtil.safeAsyncExec(new Runnable() {
@Override
public void run() {
boolean resultOkay = false;
if (context.isSupportingHeadlessImport()) {
/* headless usage of import wizard:*/
piw.addPages();
piw.createPageControls(new Shell());
piw.setContainer(getContainer());
resultOkay = piw.performFinish();
if (resultOkay) {
outputToSystemConsole("[DONE]");
} else {
outputToSystemConsole("[CANCELED]");
}
return;
}else{
int result = wd.open();
if (MessageDialog.OK == result) {
resultOkay = true;
}
}
if (resultOkay) {
outputToSystemConsole("[DONE]");
} else {
outputToSystemConsole("[CANCELED]");
}
}
});
}