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


Java InputDialog.OK属性代码示例

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


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

示例1: getNewInputObject

protected String getNewInputObject(){
   String returnvalue = null;
   ProxyInputDialog inputDialog = new ProxyInputDialog(getShell());
   if (inputDialog.open() == InputDialog.OK) {
      // check for valid Input
      try {
         String name = inputDialog.getName();
         String host = inputDialog.getHost();
         String port = inputDialog.getPort();

         String inputText = name + "," + host + "," + port;

         // parse String for empty fields
         ProxyItem.createFromString(inputText);

         returnvalue = inputText;
      } catch (Exception e) {
         MessageDialog.openError(getShell(), "Wrong entry", "None of the fields must be left blank");
      }
   }
   return returnvalue;
}
 
开发者ID:nextinterfaces,项目名称:http4e,代码行数:22,代码来源:ProxyItemListEditor.java

示例2: openRefactorDialog

@Override
public void openRefactorDialog(String projectName, String resourceBundleId,String oldKey, String enumName) {
	KeyRefactoringDialog dialog = new KeyRefactoringDialog(Display.getDefault().getActiveShell());

	DialogConfiguration config = dialog.new DialogConfiguration();
	config.setPreselectedKey(oldKey);
	config.setPreselectedBundle(resourceBundleId);
	config.setProjectName(projectName);

	dialog.setDialogConfiguration(config);

	if (dialog.open() != InputDialog.OK) {
		return;
	}

	refactorKey(projectName, resourceBundleId, config.getSelectedLocale(),oldKey, config.getNewKey(), enumName);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:StandardRefactoring.java

示例3: execute

@Override
public void execute() {
	newDataset = (JRDesignDataset) originalDataset.clone();
	boolean operationAborted = false;
	try {
		while (jrDesign.getDatasetMap().containsKey(newDataset.getName()) && !operationAborted) {
			String defaultName = ModelUtils.getDefaultName(jrDesign.getDatasetMap(), "CopyOfDataset_"); //$NON-NLS-1$
			InputDialog dlg = new InputDialog(Display.getCurrent().getActiveShell(),
					Messages.CreateFieldCommand_field_name, Messages.CreateFieldCommand_field_name_text_dialog, defaultName,
					null);
			if (dlg.open() == InputDialog.OK) {
				newDataset.setName(dlg.getValue());
			} else
				operationAborted = true;
		}
		if (!operationAborted)
			jrDesign.addDataset(newDataset);
	} catch (JRException e) {
		e.printStackTrace();
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:21,代码来源:CopyDatasetCommand.java

示例4: execute

@Override
public void execute() {
	if (jrParameter == null) {
		this.jrParameter = MParameter.createJRParameter(jrDataset);
	}
	if (jrParameter != null) {
		try {
			if (index < 0 || index > jrDataset.getParametersList().size())
				jrDataset.addParameter(jrParameter);
			else
				jrDataset.addParameter(index, jrParameter);
		} catch (JRException e) {
			e.printStackTrace();
			if (e.getMessage().startsWith("Duplicate declaration")) { //$NON-NLS-1$
				String defaultName = ModelUtils.getDefaultName(jrDataset.getParametersMap(), "CopyOFParameter_"); //$NON-NLS-1$
				InputDialog dlg = new InputDialog(Display.getCurrent().getActiveShell(),
						Messages.CreateParameterCommand_parameter_name,
						Messages.CreateParameterCommand_parameter_name_dialog_text, defaultName, null);
				if (dlg.open() == InputDialog.OK) {
					jrParameter.setName(dlg.getValue());
					execute();
				}
			}
		}
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:26,代码来源:CreateParameterCommand.java

示例5: execute

@Override
public void execute() {
	if (jrStyle == null) {
		this.jrStyle = MStyle.createJRStyle(jrDesign);
	}
	if (jrStyle != null) {
		try {
			if (index < 0 || index > jrDesign.getStylesList().size())
				jrDesign.addStyle(jrStyle);
			else
				jrDesign.addStyle(index, jrStyle);
		} catch (JRException e) {
			e.printStackTrace();
			if (e.getMessage().startsWith("Duplicate declaration")) { //$NON-NLS-1$
				String defaultName = ModelUtils.getDefaultName(jrDesign.getStylesMap(), "CopyOf_"+jrStyle.getName()); //$NON-NLS-1$
				InputDialog dlg = new InputDialog(Display.getCurrent().getActiveShell(),
						Messages.CreateStyleCommand_style_name, Messages.CreateStyleCommand_style_name_dialog_text, defaultName,
						null);
				if (dlg.open() == InputDialog.OK) {
					jrStyle.setName(dlg.getValue());
					execute();
				}
			}
		}
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:26,代码来源:CreateStyleCommand.java

示例6: execute

@Override
public void execute() {
	if (jrScriptlet == null) {
		this.jrScriptlet = MScriptlet.createJRScriptlet(jrDataset);
	}
	if (jrScriptlet != null) {
		try {
			if (index >= 0 && index < jrDataset.getScriptletsList().size())
				jrDataset.addScriptlet(index, jrScriptlet);
			else
				jrDataset.addScriptlet(jrScriptlet);
		} catch (JRException e) {
			e.printStackTrace();
			if (e.getMessage().startsWith("Duplicate declaration")) { //$NON-NLS-1$
				String defaultName = ModelUtils.getDefaultName(jrDataset.getScriptletsMap(), "CopyOFScriptlet_"); //$NON-NLS-1$
				InputDialog dlg = new InputDialog(Display.getCurrent().getActiveShell(),
						Messages.CreateScriptletCommand_scriptlet_name,
						Messages.CreateScriptletCommand_scriptlet_name_dialog_text, defaultName, null);
				if (dlg.open() == InputDialog.OK) {
					jrScriptlet.setName(dlg.getValue());
					execute();
				}
			}
		}
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:26,代码来源:CreateScriptletCommand.java

示例7: promptForCommitInsideDisplayThread

private static void promptForCommitInsideDisplayThread(Shell shell, Optional<String> name) {
    InputDialog dialog = new InputDialog(
            shell, "Commit Message", "Please enter a commit message"
                    + name.map(n -> " for the diagram: " + n).orElse(StringUtils.EMPTY) + ".",
            StringUtils.EMPTY, EditorLauncherBase::isValidCommitMessage);
    dialog.setBlockOnOpen(true);
    if (dialog.open() != InputDialog.OK) {
        return;
    }
    String commitMessage = dialog.getValue();
    try {
        transformationManager.handleEditorMerge(commitMessage);
    } catch (CommitException e) {
        LOGGER.error("Failed to merge branch into master.", e);
        ErrorDialog.openError(shell, "Commit failed",
                "The requested commit failed. "
                        + "The changes stay in the temporary branch but will not appear on the master branch.",
                new Status(Status.ERROR, null, "Merging of branches failed.", e));
    }
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:20,代码来源:EditorLauncherBase.java

示例8: run

@Override
public void run(IAction action) {
    IInputValidator validator = new IInputValidator() {

        @Override
        public String isValid(String newText) {
            if (newText.trim().length() == 0) {
                return "Name cannot be empty";
            }
            return null;
        }
    };
    InputDialog d = new InputDialog(EditorUtils.getShell(), "App name",
            "Name of the django app to makemigrations on", "",
            validator);

    int retCode = d.open();
    if (retCode == InputDialog.OK) {
        createApp(d.getValue().trim());
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:21,代码来源:DjangoMakeMigrations.java

示例9: run

@Override
public void run(IAction action) {
    IInputValidator validator = new IInputValidator() {

        @Override
        public String isValid(String newText) {
            if (newText.trim().length() == 0) {
                return "Name cannot be empty";
            }
            return null;
        }
    };
    InputDialog d = new InputDialog(EditorUtils.getShell(), "App name", "Name of the django app to be created", "",
            validator);

    int retCode = d.open();
    if (retCode == InputDialog.OK) {
        createApp(d.getValue().trim());
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:20,代码来源:DjangoCreateApp.java

示例10: getNewInputObject

/**
 * Creates and returns a new item for the list.
 * <p>
 * Subclasses must implement this method.
 * </p>
 * 
 * @return a new item
 */
protected String getNewInputObject() {

	String defaultValue = "";
	if (list.getSelection().length != 0) {
		defaultValue = list.getSelection()[0];
	}

	InputDialog dialog = new InputDialog(getShell(), "New Tomcat JVM paramater", "Enter a JVM parameter", defaultValue, null);
	String param = null;
	int dialogCode = dialog.open();
	if (dialogCode == InputDialog.OK) {
		param = dialog.getValue();
		if (param != null) {
			param = param.trim();
			if (param.length() == 0)
				return null;
		}
	}
	return param;
}
 
开发者ID:dcendents,项目名称:sysdeotomcat,代码行数:28,代码来源:ListFieldEditor.java

示例11: getNewInputObject

protected String getNewInputObject(){
   String returnvalue = null;
   SSLInputDialog inputDialog = new SSLInputDialog(getShell());
   if (inputDialog.open() == InputDialog.OK) {
      // check for valid Input
      try {
         returnvalue = inputDialog.getName();
      } catch (Exception e) {
         MessageDialog.openError(getShell(), "Wrong entry", "Wrong entry");
      }
   }
   return returnvalue;
}
 
开发者ID:nextinterfaces,项目名称:http4e,代码行数:13,代码来源:SSLEditor.java

示例12: run

/**
 * Creates a window for entering the template name, checks the user's input and
 * proceeds to save the template. 
 */
public void run(IAction action) {
    
    IFile file = ((FileEditorInput)editor.getEditorInput()).getFile();
    String fullname = file.getFullPath().toString();
    
    // create dialog
    InputQueryDialog dialog = new InputQueryDialog(editor.getEditorSite().getShell(),
            TexlipsePlugin.getResourceString("templateSaveDialogTitle"),
            TexlipsePlugin.getResourceString("templateSaveDialogMessage").replaceAll("%s", fullname),
            file.getName().substring(0,file.getName().lastIndexOf('.')),
            new IInputValidator() {
        public String isValid(String newText) {
            if (newText != null && newText.length() > 0) {
                return null; // no error
            }
            return TexlipsePlugin.getResourceString("templateSaveErrorFileName");
        }});
    
    if (dialog.open() == InputDialog.OK) {
        String newName = dialog.getInput();
        
        // check existing
        boolean reallySave = true;
        if (ProjectTemplateManager.templateExists(newName)) {
            reallySave = MessageDialog.openConfirm(editor.getSite().getShell(),
                    TexlipsePlugin.getResourceString("templateSaveOverwriteTitle"),
                    TexlipsePlugin.getResourceString("templateSaveOverwriteText").replaceAll("%s", newName));
        }
        
        if (reallySave) {
            ProjectTemplateManager.saveProjectTemplate(file, newName);
        }
    }
}
 
开发者ID:eclipse,项目名称:texlipse,代码行数:38,代码来源:SaveAsTemplateAction.java

示例13: mkdir

/**
 * Create a new sub-folder into an existing directory
 * 
 * @param selection
 */
private void mkdir(IStructuredSelection selection) {
  List<DFSFolder> folders = filterSelection(DFSFolder.class, selection);
  if (folders.size() >= 1) {
    DFSFolder folder = folders.get(0);
    InputDialog dialog =
        new InputDialog(Display.getCurrent().getActiveShell(),
            "Create subfolder", "Enter the name of the subfolder", "",
            null);
    if (dialog.open() == InputDialog.OK)
      folder.mkdir(dialog.getValue());
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:17,代码来源:DFSActionImpl.java

示例14: inputNewName

private String inputNewName(Shell shell, TreeNode node) {
    final InputDialog dialog = new InputDialog(
            shell, "Rename", "Input new name:", node.name(),
            new UIHelper.EntryNameValidator(
                    Interop.or(node.parent()),
                    node.isLeaf())
            );

    if(dialog.open() == InputDialog.OK) {
        return dialog.getValue();
    }
    return null;
}
 
开发者ID:insweat,项目名称:hssd,代码行数:13,代码来源:HSSDEditorRenameEntry.java

示例15: unzip

private void unzip() {
	IProject project = getProject();
	if (project == null) {
		showError("Please select valid project");
		return;
	}
	ProjectFileList plist = new ProjectFileList(getProject());
	FileDialog dialog = new FileDialog(_getShell(), SWT.OPEN);
	dialog.setText("Unzip selected file to project["+project.getName()+"]");
	String zipAbsPath = dialog.open();
	if (zipAbsPath == null) {
		return;
	}
	try {
		if (!plist.setUnzipFilePath(zipAbsPath, null, fAT)) {
			InputDialog input = new InputDialog(_getShell(), "Input zip password", zipAbsPath + "required password to extract...", "", null);
			if (input.open() != InputDialog.OK) {
				return;
			}
			String pwd = input.getValue();
			if (!plist.setUnzipFilePath(zipAbsPath, pwd, fAT)) {
				return;
			}
		}
		PlatformUI.getWorkbench().getProgressService().run(true, true, plist);
	} catch (Exception e) {
	}
}
 
开发者ID:BeckYang,项目名称:TeamFileList,代码行数:28,代码来源:TeamFileListView.java


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