當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。