本文整理匯總了Java中org.eclipse.jface.wizard.WizardDialog.OK屬性的典型用法代碼示例。如果您正苦於以下問題:Java WizardDialog.OK屬性的具體用法?Java WizardDialog.OK怎麽用?Java WizardDialog.OK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.jface.wizard.WizardDialog
的用法示例。
在下文中一共展示了WizardDialog.OK屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: runSetup
public static boolean runSetup() {
Display display = Display.getDefault();
WizardDialog wizardDialog = new WizardDialog(display.getActiveShell(), new SetupWizard()) {
@Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setSize(730, 700);
setReturnCode(WizardDialog.CANCEL);
}
};
int ret = wizardDialog.open();
return ret == WizardDialog.OK;
}
示例2: execute
protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
if (action != null && !action.isEnabled()) {
action.setEnabled(true);
}
else {
IResource[] resources = getSelectedResources();
BranchTagWizard wizard = new BranchTagWizard(resources);
SizePersistedWizardDialog dialog = new SizePersistedWizardDialog(getShell(), wizard, "BranchTag"); //$NON-NLS-1$
wizard.setParentDialog(dialog);
if (dialog.open() == WizardDialog.OK) {
SVNUrl[] sourceUrls = wizard.getUrls();
SVNUrl destinationUrl = wizard.getToUrl();
String message = wizard.getComment();
boolean createOnServer = wizard.isCreateOnServer();
BranchTagOperation branchTagOperation = new BranchTagOperation(getTargetPart(), getSelectedResources(), sourceUrls, destinationUrl, createOnServer, wizard.getRevision(), message);
branchTagOperation.setMakeParents(wizard.isMakeParents());
branchTagOperation.setMultipleTransactions(wizard.isSameStructure());
branchTagOperation.setNewAlias(wizard.getNewAlias());
branchTagOperation.switchAfterTagBranchOperation(wizard.isSwitchAfterBranchTag());
branchTagOperation.setSvnExternals(wizard.getSvnExternals());
branchTagOperation.run();
}
}
}
示例3: selectExistingDSAProject
public void selectExistingDSAProject(){
// launch the appropriate wizard
SelectDSAIProjectDialog dialog = new SelectDSAIProjectDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
int res = dialog.open();
if(res == WizardDialog.OK){
// update the project model
// maybe we should update melange model
}
}
示例4: selectExistingEMFProject
protected void selectExistingEMFProject() {
// launch the appropriate wizard
SelectEMFIProjectDialog dialog = new SelectEMFIProjectDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
int res = dialog.open();
if (res == WizardDialog.OK) {
// update the project model
addEMFProjectToConf(((IProject) dialog.getResult()[0]));
}
}
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:10,代碼來源:CreateDomainModelWizardContextAction.java
示例5: execute
protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
ISVNRemoteResource[] resources = getSelectedRemoteResources();
BranchTagWizard wizard = new BranchTagWizard(resources);
WizardDialog dialog = new SizePersistedWizardDialog(getShell(), wizard, "BranchTag"); //$NON-NLS-1$
if (dialog.open() == WizardDialog.OK) {
SVNUrl[] sourceUrls = wizard.getUrls();
SVNUrl destinationUrl = wizard.getToUrl();
String message = wizard.getComment();
SVNRevision revision = wizard.getRevision();
boolean makeParents = wizard.isMakeParents();
ISVNClientAdapter client = null;
try {
ISVNRepositoryLocation repository = SVNProviderPlugin.getPlugin().getRepository(sourceUrls[0].toString());
if (repository != null)
client = repository.getSVNClient();
if (client == null)
client = SVNProviderPlugin.getPlugin().getSVNClientManager().getSVNClient();
RepositoryBranchTagOperation branchTagOperation = new RepositoryBranchTagOperation(getTargetPart(), client, sourceUrls, destinationUrl, revision, message, makeParents);
branchTagOperation.setMultipleTransactions(wizard.isSameStructure());
branchTagOperation.run();
} catch (Exception e) {
MessageDialog.openError(getShell(), Policy.bind("BranchTagDialog.title"), e.getMessage());
} finally {
// BranchTagCommand will dispose.
// SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
}
}
}
示例6: widgetSelected
@Override
public void widgetSelected(SelectionEvent e) {
JrxmlFilterDialog filterDialog = new JrxmlFilterDialog(UIUtils.getShell(), false);
if (filterDialog.open() == WizardDialog.OK){
for(Object result : filterDialog.getResult()){
IFile file = (IFile) result;
DefaultManager.INSTANCE.addDefaultFile(file.getRawLocation().toOSString(), false);
}
refreshItemList = true;
}
}
示例7: getReplacementText
@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 "";
}
示例8: createNewEMFProject
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,代碼行數:54,代碼來源:CreateDomainModelWizardContextAction.java
示例9: createNewODProject
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,代碼行數:55,代碼來源:CreateAnimatorProjectWizardContextAction.java
示例10: createNewXTextProject
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,代碼行數:74,代碼來源:CreateEditorProjectWizardContextAction.java
示例11: createNewODProject
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,代碼行數:48,代碼來源:CreateEditorProjectWizardContextAction.java