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


Java Window.CANCEL属性代码示例

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


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

示例1: createCriteriasFromSelection

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,代码行数:26,代码来源:HtmlConnectorDesignComposite.java

示例2: selectRevision

public String selectRevision(Shell shell, ScmUrl scmUrl, String scmRevision) {
  String svnUrl = getSvnUrl(scmUrl.getUrl());
  ISVNRepositoryLocation location = SubclipseUtils.getRepositoryLocation(svnUrl);
  if(location==null) {
    // TODO ask if we should add new repository
    return null;
  }
  
  String path = svnUrl.substring(location.getUrl().toString().length());
  ISVNRemoteFolder remoteFolder = location.getRemoteFolder(path);
  
  HistoryDialog dialog = new HistoryDialog(shell, remoteFolder);
  // dialog.getShell().setSize(300, 200);

  if(dialog.open() != Window.CANCEL) {
    ILogEntry[] selectedEntries = dialog.getSelectedLogEntries();
    if(selectedEntries.length > 0) {
      return Long.toString(selectedEntries[0].getRevision().getNumber());
    }
  }
  
  return null;
}
 
开发者ID:subclipse,项目名称:m2e,代码行数:23,代码来源:SubclipseHandlerUi.java

示例3: createSelectTypeDialog

/**
 * createSelectTypeDialog
 *  
 * @param applicableTypeList void
 */
private void createSelectTypeDialog(ArrayList<Type> applicableTypeList) {
    TypeSelectDialog dialog = new TypeSelectDialog(null, TypeSelectDialogType.RETURN_TYPE, getData());
    dialog.setElements(applicableTypeList.toArray());
    int returnCode = dialog.open();
    switch (returnCode) {
        case Window.OK:
            selectedElement = (Element) dialog.getFirstResult();
        case Window.CANCEL:
            return;
        case IDialogConstants.FINISH_ID:
            return;
        default:
            return;
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:20,代码来源:NameOfNotationGeneralSection.java

示例4: openDialogBox

/**
 * @see org.eclipse.jface.viewers.DialogCellEditor#openDialogBox(org.eclipse.swt.widgets.Control)
 */
@Override
protected Object openDialogBox(Control cellEditorWindow) {
    TypeSelectDialog dialog = new TypeSelectDialog(table.getShell(), TypeSelectDialogType.PROPERTY, element);
    int returnCode = dialog.open();

    if (keyListener != null) {
        table.removeKeyListener(keyListener);
    }
    switch (returnCode) {
        case Window.OK:
            firstResult = dialog.getFirstResult();
            return dialog.getFirstResult();
        case Window.CANCEL:
            return this.type;
        case IDialogConstants.FINISH_ID:
            return false;
        default:
            return null;
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:23,代码来源:UMLTypeCellEditor.java

示例5: promptDatasetSelection

/**
 * This method renders a pop-up box with a drop down menu. The options are
 * input data sets that the Boa program in the current active editor can be
 * ran against.
 *
 * @param event
 * @param client
 */
public static InputHandle promptDatasetSelection(final ExecutionEvent event, final BoaClient client) {
	try {
		final String[] items = client.getDatasetNames();

		final InputSelectionDialog dlg = new InputSelectionDialog(HandlerUtil.getActiveWorkbenchWindow(event).getShell(), "Boa", "Select the input dataset to query:", items, items[0], null);
		if (dlg.open() == Window.CANCEL)
			return null;

		return client.getDataset(dlg.getValue());
	} catch (final BoaException e) {
		e.printStackTrace();
		showError(event,
				"Job submission failed: Unable to obtain list of input datasets: " + e.getLocalizedMessage() + "\n\n"
				+ "Verify your Boa username/password are correct and your internet connection is stable.");
	}

	return null;
}
 
开发者ID:boalang,项目名称:xtext-ide,代码行数:26,代码来源:SubmitToBoaHandler.java

示例6: saveList

protected void saveList() {
    ClosedPart[] partList = tabArea.getClosedPartList();
    List/*<EditorInfo>*/ infos = new ArrayList();
    for (int i = 0; i < partList.length; i++) {
        EditorInfo info = partList[i].getEditorInfo();
        if(info != null && info.isConsistent()){
            info.setNumber(i);
            infos.add(info);
        }
    }
    if(infos.isEmpty()){
        // TODO show message
        return;
    }
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    InputDialog dialog = new InputDialog(window.getShell(), "Save session",
            "Enter session name", null, new SessionNameValidator(true));
    int result = dialog.open();
    if(result == Window.CANCEL){
        return;
    }
    Sessions.getInstance().createSession(dialog.getValue(), infos);
}
 
开发者ID:iloveeclipse,项目名称:skin4eclipse,代码行数:23,代码来源:ClosedPartListControl.java

示例7: saveList

protected void saveList() {
    IPresentablePart[] partList = tabArea.getPartList();
    VSStackPresentation presentation = tabArea.getPresentation();
    List/*<EditorInfo>*/ infos = new ArrayList();
    for (int i = 0; i < partList.length; i++) {
        EditorInfo info = presentation.createEditorInfo(partList[i]);
        if(info != null){
            infos.add(info);
        }
    }
    if(infos.isEmpty()){
        // TODO show message
        return;
    }
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    InputDialog dialog = new InputDialog(window.getShell(), "Save session",
            "Enter session name", null, new SessionNameValidator(true));
    int result = dialog.open();
    if(result == Window.CANCEL){
        return;
    }
    Sessions.getInstance().createSession(dialog.getValue(), infos);
}
 
开发者ID:iloveeclipse,项目名称:skin4eclipse,代码行数:23,代码来源:PartListControl.java

示例8: run

public void run() {
    IPresentablePart[] partList = site.getPartList();
    List/*<EditorInfo>*/ infos = new ArrayList();
    for (int i = 0; i < partList.length; i++) {
        EditorInfo info = presentation.createEditorInfo(partList[i]);
        if(info != null){
            infos.add(info);
        }
    }
    if(infos.isEmpty()){
        // TODO show message
        return;
    }
    boolean createNew = sessionName == null;
    if(createNew){
        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        InputDialog dialog = new InputDialog(window.getShell(), "Save session",
                "Enter session name", null, new SessionNameValidator(true));
        int result = dialog.open();
        if(result == Window.CANCEL){
            return;
        }
        sessionName = dialog.getValue();
    }
    Sessions.getInstance().createSession(sessionName, infos, !createNew);
}
 
开发者ID:iloveeclipse,项目名称:skin4eclipse,代码行数:26,代码来源:SystemMenuSaveSession.java

示例9: showDialog

public int showDialog() {
	if(!ExpressionEditorSupportUtil.isExpressionEditorDialogOpen()) {
		JRExpressionEditor wizard = new JRExpressionEditor();
		wizard.setValue(JRCloneUtils.nullSafeClone(originalExpression));
		ExpressionContext ec = ModelUtils.getElementExpressionContext((JRDesignTextField) textField.getValue(), textField);
		wizard.setExpressionContext(ec);

		WizardDialog dialog = ExpressionEditorSupportUtil.getExpressionEditorWizardDialog(UIUtils.getShell(), wizard);
		if (dialog.open() == Dialog.OK) {
			isExpressionChanged = true;
			newExpression=wizard.getValue();
			return Window.OK;
		}
	}
	isExpressionChanged=false;
	return Window.CANCEL;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:EditTextFieldExpressionCommand.java

示例10: run

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,代码行数:40,代码来源:DatabaseObjectCreateAction.java

示例11: run

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,代码行数:40,代码来源:MobileComponentCreateAction.java

示例12: createExtractionRuleFromSelection

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,代码行数:27,代码来源:HtmlConnectorDesignComposite.java

示例13: createStatementFromSelection

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,代码行数:31,代码来源:HtmlConnectorDesignComposite.java

示例14: run

public void run(IAction action) {
    if(name != null){
        Sessions.getInstance().createSession(name, true);
        return;
    }
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    InputDialog dialog = new InputDialog(window.getShell(), "Save session",
            "Enter session name", null, new SessionNameValidator(true));
    int result = dialog.open();
    if (result == Window.CANCEL) {
        return;
    }
    Sessions.getInstance().createSession(dialog.getValue());
}
 
开发者ID:iloveeclipse,项目名称:skin4eclipse,代码行数:14,代码来源:SaveSessionAction.java

示例15: execute

@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
	if (new PickWorkspaceDialog().open() != Window.CANCEL) {
		PlatformUI.getWorkbench().restart();
	}
	return null;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:7,代码来源:SwitchWorkspaceHandler.java


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