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


Java WizardDialog.getReturnCode方法代码示例

本文整理汇总了Java中org.eclipse.jface.wizard.WizardDialog.getReturnCode方法的典型用法代码示例。如果您正苦于以下问题:Java WizardDialog.getReturnCode方法的具体用法?Java WizardDialog.getReturnCode怎么用?Java WizardDialog.getReturnCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.wizard.WizardDialog的用法示例。


在下文中一共展示了WizardDialog.getReturnCode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createCriteriasFromSelection

import org.eclipse.jface.wizard.WizardDialog; //导入方法依赖的package包/类
public void createCriteriasFromSelection(Document dom) throws EngineException {
	String className = "com.twinsoft.convertigo.beans.core.Criteria";
	
	// Retrieve selected criterias xpath
	String criteriaXpath = xpathEvaluator.getSelectionXpath();

	// Retrieve parent ScreenClass
	HtmlScreenClass parentObject = getParentHtmlScreenClass();

	NewObjectWizard newObjectWizard = new NewObjectWizard(parentObject, className, criteriaXpath, dom);
	WizardDialog wzdlg = new WizardDialog(Display.getCurrent().getActiveShell(), newObjectWizard);
	wzdlg.setPageSize(850, 650);
	wzdlg.open();
	if (wzdlg.getReturnCode() != Window.CANCEL) {
		Criteria criteria = (Criteria)newObjectWizard.newBean;

		// Reload parent ScreenClass in Tree
		fireObjectChanged(new CompositeEvent(parentObject));

		// Set selection on last created criteria (will expand tree to new criteria)
		if (criteria != null) fireObjectSelected(new CompositeEvent(criteria));

		// Set back selection on parent ScreenClass
		fireObjectSelected(new CompositeEvent(parentObject));
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:27,代码来源:HtmlConnectorDesignComposite.java

示例2: run

import org.eclipse.jface.wizard.WizardDialog; //导入方法依赖的package包/类
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		TreeObject parentTreeObject = null;
   		DatabaseObject databaseObject = null;
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			parentTreeObject = explorerView.getFirstSelectedTreeObject();
   			
   			if (parentTreeObject instanceof ObjectsFolderTreeObject) {
   				parentTreeObject = ((ObjectsFolderTreeObject) parentTreeObject).getParent();
   				databaseObject  = (DatabaseObject) parentTreeObject.getObject();
   			}
   			else {
   				databaseObject = (DatabaseObject) parentTreeObject.getObject();
   			}
   			
   			NewObjectWizard newObjectWizard = new NewObjectWizard(databaseObject, databaseObjectClassName);
       		WizardDialog wzdlg = new WizardDialog(shell, newObjectWizard);
       		wzdlg.setPageSize(850, 650);
       		wzdlg.open();
       		int result = wzdlg.getReturnCode();
       		if ((result != Window.CANCEL) && (newObjectWizard.newBean != null)) {
       			postCreate(parentTreeObject, newObjectWizard.newBean);
       		}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to create a new database object '"+ databaseObjectClassName +"'!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:41,代码来源:DatabaseObjectCreateAction.java

示例3: run

import org.eclipse.jface.wizard.WizardDialog; //导入方法依赖的package包/类
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		TreeObject parentTreeObject = null;
   		DatabaseObject databaseObject = null;
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			parentTreeObject = explorerView.getFirstSelectedTreeObject();
   			
   			if (parentTreeObject instanceof ObjectsFolderTreeObject) {
   				parentTreeObject = ((ObjectsFolderTreeObject) parentTreeObject).getParent();
   				databaseObject  = (DatabaseObject) parentTreeObject.getObject();
   			}
   			else {
   				databaseObject = (DatabaseObject) parentTreeObject.getObject();
   			}
   			
   			ComponentObjectWizard newObjectWizard = new ComponentObjectWizard(databaseObject, databaseObjectClassName);
       		WizardDialog wzdlg = new WizardDialog(shell, newObjectWizard);
       		wzdlg.setPageSize(850, 650);
       		wzdlg.open();
       		int result = wzdlg.getReturnCode();
       		if ((result != Window.CANCEL) && (newObjectWizard.newBean != null)) {
       			postCreate(parentTreeObject, newObjectWizard.newBean);
       		}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to create a new database object '"+ databaseObjectClassName +"'!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:41,代码来源:MobileComponentCreateAction.java

示例4: createExtractionRuleFromSelection

import org.eclipse.jface.wizard.WizardDialog; //导入方法依赖的package包/类
public void createExtractionRuleFromSelection(Document dom) throws EngineException {
	String className = "com.twinsoft.convertigo.beans.core.ExtractionRule";
	
	// Retrieve selected extraction rule xpath
	String extractionrulesXpath = xpathEvaluator.getSelectionXpath();

	// Retrieve parent ScreenClass
	HtmlScreenClass parentObject = getParentHtmlScreenClass();

	// Add extraction rule to screen class
	NewObjectWizard newObjectWizard = new NewObjectWizard(parentObject, className, extractionrulesXpath, dom);
	WizardDialog wzdlg = new WizardDialog(Display.getCurrent().getActiveShell(), newObjectWizard);
	wzdlg.setPageSize(850, 650);
	wzdlg.open();
	if (wzdlg.getReturnCode() != Window.CANCEL) {
		HtmlExtractionRule extractionrule = (HtmlExtractionRule)newObjectWizard.newBean;
		
		// Reload parent ScreenClass in Tree
		fireObjectChanged(new CompositeEvent(parentObject));

		// Set selection on new extraction rule (will expand tree to new extraction rule)
		if (extractionrule != null) fireObjectSelected(new CompositeEvent(extractionrule));

		// Set back selection on parent ScreenClass
		fireObjectSelected(new CompositeEvent(parentObject));		
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:28,代码来源:HtmlConnectorDesignComposite.java

示例5: createStatementFromSelection

import org.eclipse.jface.wizard.WizardDialog; //导入方法依赖的package包/类
public void createStatementFromSelection() {
	String className = "com.twinsoft.convertigo.beans.core.Statement";
	
	// Retrieve selected statement xpath
	String statementXpath = xpathEvaluator.getSelectionXpath();

	// Retrieve parent Statement
	Statement parentObject = getParentStatement();
	if (parentObject == null) {
		ConvertigoPlugin.errorMessageBox("Unable to create a new statement.\nThe selected handler belongs to a different HTML connector.");
		return;
	}
	
	// Add statement to parent statement
	NewObjectWizard newObjectWizard = new NewObjectWizard(parentObject, className, statementXpath, null);
	WizardDialog wzdlg = new WizardDialog(Display.getCurrent().getActiveShell(), newObjectWizard);
	wzdlg.setPageSize(850, 650);
	wzdlg.open();
	if (wzdlg.getReturnCode() != Window.CANCEL) {
		Statement statement = (Statement)newObjectWizard.newBean;
		
		// Reload parent statement in Tree
		fireObjectChanged(new CompositeEvent(parentObject));

		// Set selection on new statement (will expand tree to new statement)
		if (statement != null) fireObjectSelected(new CompositeEvent(statement));

		// Set back selection on parent statement
		fireObjectSelected(new CompositeEvent(parentObject));
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:32,代码来源:HtmlConnectorDesignComposite.java

示例6: createScreenClassFromSelection

import org.eclipse.jface.wizard.WizardDialog; //导入方法依赖的package包/类
public void createScreenClassFromSelection() throws EngineException {
	String className = "com.twinsoft.convertigo.beans.core.ScreenClass";
	
	// Retrieve selected criteria xpath
	String criteriaXpath = xpathEvaluator.getSelectionXpath();

	// Retrieve parent ScreenClass
	HtmlScreenClass parentObject = getParentHtmlScreenClass();
	
	NewObjectWizard newObjectWizard = new NewObjectWizard(parentObject, className);
	WizardDialog wzdlg = new WizardDialog(Display.getCurrent().getActiveShell(), newObjectWizard);
	wzdlg.setPageSize(850, 650);
	wzdlg.open();
	if (wzdlg.getReturnCode() != Window.CANCEL) {
		HtmlScreenClass htmlScreenClass = (HtmlScreenClass)newObjectWizard.newBean;
		if (htmlScreenClass != null) {
			String screenClassName = htmlScreenClass.getName();
			
			// Add criteria to screen class
			createCriteria(htmlScreenClass, criteriaXpath);
			
			// Set detected ScreenClass to newly created one
			if (htmlConnector.isLearning()) {
				detectedScreenClass = htmlScreenClass;
				ConvertigoPlugin.logDebug2("(HtmlConnectorDesignComposite) Detected screen class is set to newly created one named '"+ screenClassName +"'");
			}
			else {
				ConvertigoPlugin.logDebug2("(HtmlConnectorDesignComposite) New screen class named '"+ screenClassName +"' has been added");
			}

			// Reload parent ScreenClass in Tree
			fireObjectChanged(new CompositeEvent(parentObject));

			// Set selection on newly created screenclass
			fireObjectSelected(new CompositeEvent(htmlScreenClass));

			// Highlight new detected ScreenClass in Tree
			if (htmlConnector.isLearning())
				Engine.theApp.fireObjectDetected(new EngineEvent(htmlScreenClass));

			//TODO:toolScreenclass.setEnabled(false);
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:45,代码来源:HtmlConnectorDesignComposite.java

示例7: createStatementFromGenerator

import org.eclipse.jface.wizard.WizardDialog; //导入方法依赖的package包/类
public void createStatementFromGenerator(Document dom) {
	// Retrieve selected statement generator xpath
	String statementGeneratorXpath = xpathEvaluator.getSelectionXpath();
	
	// retrieve element on which generate a statement 
	// every test has been done before activating the button, no need to do them again
	Element element = (Element)(dom.getDocumentElement().getChildNodes().item(0));
	boolean clickable = false, valuable = false, checkable = false, selectable = false, radioable = false, formable = false;

	if(element.getTagName().equalsIgnoreCase("A")){
		clickable = true;
	}else if(element.getTagName().equalsIgnoreCase("INPUT")){
		String type = element.getAttribute("type");
		clickable = Arrays.binarySearch( new String[]{"button", "checkbox", "radio", "submit"}, type)>-1; //warning, must be sort
		valuable = Arrays.binarySearch( new String[]{"", "password", "text"}, type)>-1; //warning, must be sort
		checkable = Arrays.binarySearch( new String[]{"checkbox", "radio"}, type)>-1; //warning, must be sort
		radioable = type.equals("radio");
	}else if(element.getTagName().equalsIgnoreCase("TEXTAREA")){
		valuable = true;
	}else if(element.getTagName().equalsIgnoreCase("SELECT")){
		selectable = true;
	}else if(element.getTagName().equalsIgnoreCase("FORM")){
		formable = true;
	}
	
	// Retrieve parent Statement
	StatementWithExpressions parentObject = getParentStatement();
	
	// launch wizard
	StatementGeneratorWizard statementGeneratorWizard = new StatementGeneratorWizard(parentObject, 
																					statementGeneratorXpath, 
																					new boolean[] {	clickable, 
																									valuable, 
																									checkable, 
																									selectable, 
																									radioable, 
																									formable
																								}
																					);
	
	WizardDialog wzdlg = new WizardDialog(Display.getCurrent().getActiveShell(), statementGeneratorWizard);
	wzdlg.open();
	if (wzdlg.getReturnCode() != Window.CANCEL) {
		// TODO
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:47,代码来源:HtmlConnectorDesignComposite.java


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