當前位置: 首頁>>代碼示例>>Java>>正文


Java IDialogConstants.YES_ID屬性代碼示例

本文整理匯總了Java中org.eclipse.jface.dialogs.IDialogConstants.YES_ID屬性的典型用法代碼示例。如果您正苦於以下問題:Java IDialogConstants.YES_ID屬性的具體用法?Java IDialogConstants.YES_ID怎麽用?Java IDialogConstants.YES_ID使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.eclipse.jface.dialogs.IDialogConstants的用法示例。


在下文中一共展示了IDialogConstants.YES_ID屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: askDeleteScript

public void askDeleteScript(IFile f) {
    String mode = mainPrefs.getString(DB_UPDATE_PREF.DELETE_SCRIPT_AFTER_CLOSE);
    // if select "YES" with toggle
    if (mode.equals(MessageDialogWithToggle.ALWAYS)){
        deleteFile(f);
        // if not select "NO" with toggle, show choice message dialog
    } else if (!mode.equals(MessageDialogWithToggle.NEVER)){
        MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoQuestion(getSite().getShell(),
                Messages.SqlEditor_script_delete_dialog_title, MessageFormat.format(
                        Messages.SqlEditor_script_delete_dialog_message, f.getName()),
                Messages.remember_choice_toggle, false, mainPrefs, DB_UPDATE_PREF.DELETE_SCRIPT_AFTER_CLOSE);
        if(dialog.getReturnCode() == IDialogConstants.YES_ID){
            deleteFile(f);
        }
    }
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:16,代碼來源:SQLEditor.java

示例2: askPerspectiveChange

private void askPerspectiveChange(IEditorSite site) {
    String mode = mainPrefs.getString(PG_EDIT_PREF.PERSPECTIVE_CHANGING_STATUS);
    // if select "YES" with toggle
    if (mode.equals(MessageDialogWithToggle.ALWAYS)){
        changePerspective(site);
        // if not select "NO" with toggle, show choice message dialog
    } else if (!mode.equals(MessageDialogWithToggle.NEVER)){
        MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoQuestion(site.getShell(),
                Messages.change_perspective_title, Messages.change_perspective_message,
                Messages.remember_choice_toggle, false, mainPrefs, PG_EDIT_PREF.PERSPECTIVE_CHANGING_STATUS);
        if(dialog.getReturnCode() == IDialogConstants.YES_ID){
            changePerspective(site);
        }
    }
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:15,代碼來源:ProjectEditorDiffer.java

示例3: showEditor

private void showEditor(Differ differ) throws PartInitException {
    if (differ.getScript().isDangerDdl(
            !mainPrefs.getBoolean(DB_UPDATE_PREF.DROP_TABLE_STATEMENT),
            !mainPrefs.getBoolean(DB_UPDATE_PREF.ALTER_COLUMN_STATEMENT),
            !mainPrefs.getBoolean(DB_UPDATE_PREF.DROP_COLUMN_STATEMENT),
            !mainPrefs.getBoolean(DB_UPDATE_PREF.RESTART_WITH_STATEMENT))){
        MessageBox mb = new MessageBox(parent.getShell(), SWT.ICON_WARNING | SWT.OK | SWT.CANCEL);
        mb.setText(Messages.sqlScriptDialog_warning);
        mb.setMessage(Messages.sqlScriptDialog_script_contains_statements_that_may_modify_data);
        if (mb.open() != SWT.OK){
            return;
        }
    }

    try {
        boolean inProj = false;
        String creationMode = mainPrefs.getString(DB_UPDATE_PREF.CREATE_SCRIPT_IN_PROJECT);
        // if select "YES" with toggle
        if (creationMode.equals(MessageDialogWithToggle.ALWAYS)) {
            inProj = true;
            // if not select "NO" with toggle, show choice message dialog
        } else if (!creationMode.equals(MessageDialogWithToggle.NEVER)) {
            MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoQuestion(parent.getShell(),
                    Messages.ProjectEditorDiffer_script_creation_title, Messages.ProjectEditorDiffer_script_creation_message,
                    Messages.remember_choice_toggle, false, mainPrefs, DB_UPDATE_PREF.CREATE_SCRIPT_IN_PROJECT);
            if (dialog.getReturnCode() == IDialogConstants.YES_ID) {
                inProj = true;
            }
        }

        String content = differ.getDiffDirect();
        String filename = generateScriptName();
        if (inProj) {
            IEditorInput file = createProjectScriptFile(content, filename);
            if (loadedRemote instanceof DbInfo) {
                SQLEditor.saveLastDb((DbInfo) loadedRemote, file);
            }
            getSite().getPage().openEditor(file, EDITOR.SQL);
        } else {
            FileUtilsUi.saveOpenTmpSqlEditor(content, filename);
        }
    } catch (CoreException | IOException ex) {
        ExceptionNotifier.notifyDefault(
                Messages.ProjectEditorDiffer_error_creating_file, ex);
    }
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:46,代碼來源:ProjectEditorDiffer.java

示例4: addRemoveType

private void addRemoveType() {
  if (!MarkerPage.isParsed()) {
    final MessageDialog parseCtrlDialog =
        new MessageDialog(MarkerActivator.getShell(), "Type Information", null,
            "You dont have any marker type registered to system! \n"
                + "Please parse an alloy file first",
                MessageDialog.INFORMATION, new String[] {"OK"}, 0);
    parseCtrlDialog.open();
    return;
  }

  final ActionSelectionDialog actionSelectionDialog =
      new ActionSelectionDialog(MarkerActivator.getShell());
  actionSelectionDialog.open();
  if (actionSelectionDialog.getReturnCode() == IDialogConstants.CANCEL_ID) {
    return;
  }

  if (selectedMarker != null && selectedMarker.exists()) {
    findCandidateToTypeChangingMarkers(selectedMarker);
    if (actionSelectionDialog.getReturnCode() == IDialogConstants.YES_ID) {
      addType(selectedMarker);
    } else if (actionSelectionDialog.getReturnCode() == IDialogConstants.NO_ID) {
      final MessageDialog warningDialog =
          new MessageDialog(MarkerActivator.getShell(), "Warning!", null,
              "If you remove marker's type, all relations of this marker has been removed! Do you want to continue to remove marker's type?",
              MessageDialog.WARNING, new String[] {"Yes", "No"}, 0);
      final int returnCode = warningDialog.open();
      if (returnCode != 0) {
        return;
      }
      removeType(selectedMarker);
    }
    // MarkerUpdater.updateTargets(selectedMarker);
    // MarkerUpdater.updateSources(selectedMarker);
  } else {
    final MessageDialog dialog =
        new MessageDialog(MarkerActivator.getShell(), "There is no marker in this position", null,
            "Please select valid marker", MessageDialog.INFORMATION, new String[] {"Ok"}, 0);
    dialog.open();
    return;
  }
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:43,代碼來源:AddRemoveTypeHandler.java

示例5: addRemoveType

private void addRemoveType() {
  if (!MarkerPage.isParsed()) {
    final MessageDialog parseCtrlDialog =
        new MessageDialog(Activator.getShell(), "Type Information", null,
            "You dont have any marker type registered to system! \n"
                + "Please parse an alloy file first",
            MessageDialog.INFORMATION, new String[] {"OK"}, 0);
    parseCtrlDialog.open();
    return;
  }

  final ActionSelectionDialog actionSelectionDialog =
      new ActionSelectionDialog(Activator.getShell());
  actionSelectionDialog.open();
  if (actionSelectionDialog.getReturnCode() == IDialogConstants.CANCEL_ID) {
    return;
  }

  IMarker selectedMarker = this.marker;
  selectedMarker = MarkUtilities.getLeaderOfMarker(selectedMarker);

  if (selectedMarker != null && selectedMarker.exists()) {
    this.findCandidateToTypeChangingMarkers(selectedMarker);
    if (actionSelectionDialog.getReturnCode() == IDialogConstants.YES_ID) {
      AddRemoveTypeCommand.addType(selectedMarker);
    } else if (actionSelectionDialog.getReturnCode() == IDialogConstants.NO_ID) {
      final MessageDialog warningDialog =
          new MessageDialog(Activator.getShell(), "Warning!", null,
              "If you remove marker's type, all relations of this marker has been removed! Do you want to continue to remove marker's type?",
              MessageDialog.WARNING, new String[] {"YES", "NO"}, 0);
      final int returnCode = warningDialog.open();
      if (returnCode != 0) {
        return;
      }
      this.removeType(selectedMarker);
    }
  } else {
    final MessageDialog dialog =
        new MessageDialog(Activator.getShell(), "There is no marker in this position", null,
            "Please select valid marker", MessageDialog.INFORMATION, new String[] {"OK"}, 0);
    dialog.open();
    return;
  }
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:44,代碼來源:AddRemoveTypeCommand.java


注:本文中的org.eclipse.jface.dialogs.IDialogConstants.YES_ID屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。