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


Java SwingTools.showInputDialog方法代码示例

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


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

示例1: createOperator

import com.rapidminer.gui.tools.SwingTools; //导入方法依赖的package包/类
@Override
public Operator createOperator() throws OperatorCreationException {
	MetaData metaData = inputPort.getMetaData();
	if ((metaData == null) || !(metaData instanceof ExampleSetMetaData)) {
		return null;
	}

	ChangeAttributeRole car = OperatorService.createOperator(ChangeAttributeRole.class);

	Object[] options = (((ExampleSetMetaData) metaData).getAttributeNamesByType(Ontology.VALUE_TYPE)).toArray();
	if (options.length > 0) {
		Object option = SwingTools.showInputDialog("quickfix.replace_by_dictionary", options, options[0], car
				.getParameters().getParameterType(ChangeAttributeRole.PARAMETER_NAME).getDescription());
		if (option != null) {
			car.setParameter(ChangeAttributeRole.PARAMETER_NAME, option.toString());
			car.setParameter(ChangeAttributeRole.PARAMETER_TARGET_ROLE, role);
			return car;
		} else {
			return null;
		}
	} else {
		return car;
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:25,代码来源:ChangeAttributeRoleQuickFix.java

示例2: renameFile

import com.rapidminer.gui.tools.SwingTools; //导入方法依赖的package包/类
private void renameFile() {
	this.response = SwingTools.showInputDialog("file_chooser.rename", this.fileName, (isDirectory() ? "directory"
			: "file") + " " + this.fileName);
	try {
		if (this.response.equals("") || this.response == null) {
			SwingTools.showVerySimpleErrorMessage("file_chooser.rename.invalid");
		} else {
			if (this.file.renameTo(new File(this.file.getParentFile(), this.response))) {
				this.file = new File(this.file.getParentFile(), this.response);
				getFileData();
				this.parentPane.filePane.rescanDirectory();
				this.repaint();
			} else {
				SwingTools.showVerySimpleErrorMessage("file_chooser.rename.error");
			}
		}
	} catch (Exception exp) {
		// do nothing
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:21,代码来源:Item.java

示例3: createNameDialog

import com.rapidminer.gui.tools.SwingTools; //导入方法依赖的package包/类
private String createNameDialog(String oldName) {
	String newName = SwingTools.showInputDialog("plotter.configuration_dialog.color_scheme_dialog.rename", oldName);
	if (newName != null) {
		boolean success = currentColorSchemes.get(newName) == null;
		if (newName.equals(oldName)) {
			success = true;
		}
		if (!success) {
			SwingTools.showVerySimpleErrorMessage("cannot_rename_entry", oldName, newName);
			return oldName;
		}
		return newName;
	}
	return null;

}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:17,代码来源:ColorSchemeDialog.java

示例4: actionPerformed

import com.rapidminer.gui.tools.SwingTools; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
	final String currentColumnName = metaData.getColumnMetaData(columnIndex).getName();
	String type = DataImportWizardUtils.getNameForColumnType(metaData.getColumnMetaData(columnIndex).getType());
	String roleName = metaData.getColumnMetaData(columnIndex).getRole();

	String newColumnName = SwingTools.showInputDialog(ApplicationFrame.getApplicationFrame(),
			"io.dataimport.step.data_column_configuration.rename", currentColumnName, new InputValidator<String>() {

		@Override
		public String validateInput(String inputString) {
			if (inputString == null || inputString.trim().isEmpty()) {
				return ERROR_EMPTY_COLUMN_NAME;
			} else if (!inputString.trim().equals(currentColumnName) && validator.isNameUsed(inputString.trim())) {
				return ERROR_DUPLICATE_COLUMN_NAME;
			} else {
				return null;
			}
		}
	});
	if (newColumnName == null || newColumnName.trim().equals(currentColumnName)) {
		// user cancelled dialog or did not change the name
		return;
	}

	newColumnName = newColumnName.trim();
	metaData.getColumnMetaData(columnIndex).setName(newColumnName);
	validator.validate(columnIndex);
	ConfigureDataTableHeader.this.setToolTipText(createTooltip(newColumnName, type, roleName));
	ConfigureDataTableHeader.this.nameLabel.setText(newColumnName);
	ConfigureDataTableHeader.this.table.getTableHeader().revalidate();
	ConfigureDataTableHeader.this.table.getTableHeader().repaint();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:34,代码来源:ConfigureDataTableHeader.java

示例5: apply

import com.rapidminer.gui.tools.SwingTools; //导入方法依赖的package包/类
@Override
public void apply() {
	Object option = SwingTools.showInputDialog("quickfix.replace_by_dictionary", options, options[nearestOption],
			description);
	if (option != null) {
		insertChosenOption(option.toString());
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:9,代码来源:DictionaryQuickFix.java

示例6: actionPerformed

import com.rapidminer.gui.tools.SwingTools; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
	if (UIManager.getBoolean("FileChooser.readOnly")) {
		return;
	}
	JFileChooser fc = getFileChooser();
	File currentDirectory = fc.getCurrentDirectory();
	FileSystemView fsv = fc.getFileSystemView();
	File newFolder = null;

	String name = SwingTools.showInputDialog("file_chooser.new_folder", "");

	try {
		if (name != null && !"".equals(name)) {
			newFolder = fsv.createNewFolder(currentDirectory);
			if (newFolder.renameTo(fsv.createFileObject(fsv.getParentDirectory(newFolder), name))) {
				newFolder = fsv.createFileObject(fsv.getParentDirectory(newFolder), name);
			} else {
				SwingTools.showVerySimpleErrorMessage("file_chooser.new_folder.rename", name);
			}
		}
	} catch (IOException exc) {
		SwingTools.showVerySimpleErrorMessage("file_chooser.new_folder.create", name);
		return;
	} catch (Exception exp) {
		// do nothing
	}

	if (fc.isMultiSelectionEnabled()) {
		fc.setSelectedFiles(new File[] { newFolder });
	} else {
		fc.setSelectedFile(newFolder);
	}

	fc.rescanCurrentDirectory();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:37,代码来源:FileChooserUI.java

示例7: addToBookmarks

import com.rapidminer.gui.tools.SwingTools; //导入方法依赖的package包/类
public void addToBookmarks(File f) {
	String name = SwingTools.showInputDialog("file_chooser.bookmark_name", this.fc.getFileSystemView()
			.getSystemDisplayName(f), this.fc.getFileSystemView().getSystemDisplayName(f));
	if (name != null && !name.trim().equals("")) {
		try {
			this.bookmarksIO.addToList(name, f.getCanonicalFile().getPath());
		} catch (IOException ex) {
		}
		updateBookmarks();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:12,代码来源:FileList.java


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