当前位置: 首页>>代码示例>>Java>>正文


Java WizardDialog.OK属性代码示例

本文整理汇总了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;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:17,代码来源:SetupAction.java

示例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();        		
    	}
    }
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:24,代码来源:BranchTagAction.java

示例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
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:9,代码来源:CreateDSAWizardContextActionDSA.java

示例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);
		  }
    	}
	}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:28,代码来源:RepositoryBranchTagAction.java

示例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;
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:11,代码来源:HandleDefaultsAction.java

示例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 ""; 
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:41,代码来源:CreateEcoreProposal.java

示例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


注:本文中的org.eclipse.jface.wizard.WizardDialog.OK属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。