本文整理匯總了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));
}
}
示例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();
}
}
示例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();
}
}
示例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));
}
}
示例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));
}
}
示例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);
}
}
}
示例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
}
}