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


Java AutoCompleteComboBoxAddition类代码示例

本文整理汇总了Java中com.rapidminer.gui.tools.autocomplete.AutoCompleteComboBoxAddition的典型用法代码示例。如果您正苦于以下问题:Java AutoCompleteComboBoxAddition类的具体用法?Java AutoCompleteComboBoxAddition怎么用?Java AutoCompleteComboBoxAddition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: AbstractSuggestionBoxValueCellEditor

import com.rapidminer.gui.tools.autocomplete.AutoCompleteComboBoxAddition; //导入依赖的package包/类
public AbstractSuggestionBoxValueCellEditor(final ParameterType type) {
	this.type = type;
	this.model = new SuggestionComboBoxModel();
	this.comboBox = new SuggestionComboBox(model);
	this.comboBox.setToolTipText(type.getDescription());
	this.comboBox.setRenderer(new SuggestionComboBoxModelCellRenderer());
	comboBox.addActionListener(comboBoxSelectionListener);

	new AutoCompleteComboBoxAddition(comboBox);

	this.container = new JPanel(new GridBagLayout());
	this.container.setToolTipText(type.getDescription());

	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.BOTH;
	c.weighty = 1;
	c.weightx = 1;
	container.add(comboBox, c);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:20,代码来源:AbstractSuggestionBoxValueCellEditor.java

示例2: CellTypeComboBoxImpl

import com.rapidminer.gui.tools.autocomplete.AutoCompleteComboBoxAddition; //导入依赖的package包/类
/**
 * Creates a {@link CellTypeComboBoxImpl} for the specified cell. Does not validate the model,
 * so make sure this call works!
 * 
 * @param model
 * @param rowIndex
 * @param columnIndex
 */
@SuppressWarnings("unused")
public CellTypeComboBoxImpl(final TablePanelModel model, final int rowIndex, final int columnIndex) {
	super(new Vector<String>(
			model.getPossibleValuesForCellOrNull(rowIndex, columnIndex) != null ? model.getPossibleValuesForCellOrNull(
					rowIndex, columnIndex) : Collections.<String> emptyList()));

	// distinguish between editable comboboxes and non-editable ones
	if (model.isCellEditable(rowIndex, columnIndex)) {
		setEditable(true);
		new AutoCompleteComboBoxAddition(this);
	} else {
		int indexOf = ((DefaultComboBoxModel) getModel()).getIndexOf(model.getValueAt(rowIndex, columnIndex));
		// if the combobox is NOT editable and the model has a value which is not part of the
		// combobox, change the model value
		if (indexOf == -1) {
			model.setValueAt(getSelectedItem(), rowIndex, columnIndex);
		}
	}

	// misc settings
	setSelectedItem(model.getValueAt(rowIndex, columnIndex));
	setToolTipText(model.getHelptextAt(rowIndex, columnIndex));
	addActionListener(new ActionListener() {

		@Override
		public void actionPerformed(ActionEvent e) {
			model.setValueAt(getSelectedItem(), rowIndex, columnIndex);
			setToolTipText(model.getHelptextAt(rowIndex, columnIndex));
		}
	});

	// set size so comboboxes don't grow larger when they get the chance
	setPreferredSize(new Dimension(150, 20));
	setMinimumSize(new Dimension(100, 15));
	setMaximumSize(new Dimension(300, 30));
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:45,代码来源:CellTypeComboBoxImpl.java

示例3: CellTypeComboBoxImpl

import com.rapidminer.gui.tools.autocomplete.AutoCompleteComboBoxAddition; //导入依赖的package包/类
/**
 * Creates a {@link CellTypeComboBoxImpl} for the specified cell. Does not validate the model,
 * so make sure this call works!
 *
 * @param model
 * @param rowIndex
 * @param columnIndex
 */
public CellTypeComboBoxImpl(final TablePanelModel model, final int rowIndex, final int columnIndex) {
	super(new Vector<String>(model.getPossibleValuesForCellOrNull(rowIndex, columnIndex) != null
			? model.getPossibleValuesForCellOrNull(rowIndex, columnIndex) : Collections.<String>emptyList()));

	// distinguish between editable comboboxes and non-editable ones
	if (model.isCellEditable(rowIndex, columnIndex)) {
		setEditable(true);
		new AutoCompleteComboBoxAddition(this);
	} else {
		int indexOf = ((DefaultComboBoxModel<?>) getModel()).getIndexOf(model.getValueAt(rowIndex, columnIndex));
		// if the combobox is NOT editable and the model has a value which is not part of the
		// combobox, change the model value
		if (indexOf == -1) {
			model.setValueAt(getSelectedItem(), rowIndex, columnIndex);
		}
	}

	// misc settings
	setSelectedItem(model.getValueAt(rowIndex, columnIndex));
	setToolTipText(model.getHelptextAt(rowIndex, columnIndex));
	addActionListener(new ActionListener() {

		@Override
		public void actionPerformed(ActionEvent e) {
			model.setValueAt(getSelectedItem(), rowIndex, columnIndex);
			setToolTipText(model.getHelptextAt(rowIndex, columnIndex));
		}
	});

	// set size so comboboxes don't grow larger when they get the chance
	setPreferredSize(new Dimension(150, 20));
	setMinimumSize(new Dimension(100, 15));
	setMaximumSize(new Dimension(300, 30));
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:43,代码来源:CellTypeComboBoxImpl.java

示例4: DatabaseTableValueCellEditor

import com.rapidminer.gui.tools.autocomplete.AutoCompleteComboBoxAddition; //导入依赖的package包/类
public DatabaseTableValueCellEditor(ParameterTypeDatabaseSchema type) {
    this.type = type;
    this.mode = DatabaseTableValueCellEditor.Mode.SCHEMA;
    new AutoCompleteComboBoxAddition(this.comboBox);
    this.setupGUI();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:7,代码来源:DatabaseTableValueCellEditor.java

示例5: DefaultPropertyValueCellEditor

import com.rapidminer.gui.tools.autocomplete.AutoCompleteComboBoxAddition; //导入依赖的package包/类
public DefaultPropertyValueCellEditor(final ParameterTypeStringCategory type) {
	super(new JComboBox(type.getValues()));

	if (type.isEditable()) {
		AutoCompleteComboBoxAddition autoCompleteCBA = new AutoCompleteComboBoxAddition((JComboBox) editorComponent);
		autoCompleteCBA.setCaseSensitive(false);
	}

	final JTextComponent textField = (JTextComponent) ((JComboBox) editorComponent).getEditor().getEditorComponent();

	useEditorAsRenderer = true;
	((JComboBox) editorComponent).removeItemListener(this.delegate);
	((JComboBox) editorComponent).setEditable(type.isEditable());
	this.delegate = new EditorDelegate() {

		private static final long serialVersionUID = -5592150438626222295L;

		@Override
		public void setValue(Object x) {
			if (x == null) {
				super.setValue(null);
				((JComboBox) editorComponent).setSelectedItem(null);
			} else {
				String value = x.toString();
				super.setValue(value);
				((JComboBox) editorComponent).setSelectedItem(value);
				if (value != null) {
					textField.setText(value.toString());
				} else {
					textField.setText("");
				}
			}
		}

		@Override
		public Object getCellEditorValue() {
			if (type.isEditable()) {
				String selected = textField.getText();
				if (selected != null && selected.trim().length() == 0) {
					selected = null;
				}
				return selected;
			} else {
				return ((JComboBox) editorComponent).getSelectedItem();
			}
		}
	};
	editorComponent.setToolTipText(type.getDescription());
	((JComboBox) editorComponent).addItemListener(delegate);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:51,代码来源:DefaultPropertyValueCellEditor.java

示例6: DefaultPropertyValueCellEditor

import com.rapidminer.gui.tools.autocomplete.AutoCompleteComboBoxAddition; //导入依赖的package包/类
public DefaultPropertyValueCellEditor(final ParameterTypeStringCategory type) {
	super(new JComboBox<>(type.getValues()));

	if (type.isEditable()) {
		AutoCompleteComboBoxAddition autoCompleteCBA = new AutoCompleteComboBoxAddition((JComboBox<?>) editorComponent);
		autoCompleteCBA.setCaseSensitive(false);
	}

	final JTextComponent textField = (JTextComponent) ((JComboBox<?>) editorComponent).getEditor().getEditorComponent();

	useEditorAsRenderer = true;
	((JComboBox<?>) editorComponent).removeItemListener(this.delegate);
	((JComboBox<?>) editorComponent).setEditable(type.isEditable());
	this.delegate = new EditorDelegate() {

		private static final long serialVersionUID = -5592150438626222295L;

		@Override
		public void setValue(Object x) {
			if (x == null) {
				super.setValue(null);
				((JComboBox<?>) editorComponent).setSelectedItem(null);
			} else {
				String value = x.toString();
				super.setValue(value);
				((JComboBox<?>) editorComponent).setSelectedItem(value);
				if (value != null) {
					textField.setText(value.toString());
				} else {
					textField.setText("");
				}
			}
		}

		@Override
		public Object getCellEditorValue() {
			if (type.isEditable()) {
				String selected = textField.getText();
				if (selected != null && selected.trim().length() == 0) {
					selected = null;
				}
				return selected;
			} else {
				return ((JComboBox<?>) editorComponent).getSelectedItem();
			}
		}
	};
	editorComponent.setToolTipText(type.getDescription());
	((JComboBox<?>) editorComponent).addItemListener(delegate);
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:51,代码来源:DefaultPropertyValueCellEditor.java

示例7: AttributeComboBox

import com.rapidminer.gui.tools.autocomplete.AutoCompleteComboBoxAddition; //导入依赖的package包/类
public AttributeComboBox(ParameterTypeAttribute type) {
	super(new AttributeComboBoxModel(type));
	model = (AttributeComboBoxModel) getModel();
	AutoCompleteComboBoxAddition autoCompleteCBA = new AutoCompleteComboBoxAddition(this);
	autoCompleteCBA.setCaseSensitive(false);
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:7,代码来源:AttributeComboBox.java

示例8: DatabaseTableValueCellEditor

import com.rapidminer.gui.tools.autocomplete.AutoCompleteComboBoxAddition; //导入依赖的package包/类
public DatabaseTableValueCellEditor(final ParameterTypeDatabaseSchema type) {
	this.type = type;
	this.mode = Mode.SCHEMA;
	AutoCompleteComboBoxAddition add = new AutoCompleteComboBoxAddition(comboBox);
	setupGUI();
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:7,代码来源:DatabaseTableValueCellEditor.java

示例9: DefaultPropertyValueCellEditor

import com.rapidminer.gui.tools.autocomplete.AutoCompleteComboBoxAddition; //导入依赖的package包/类
public DefaultPropertyValueCellEditor(final ParameterTypeStringCategory type) {
	super(new JComboBox(type.getValues()));

	if (type.isEditable()) {
		AutoCompleteComboBoxAddition autoCompleteCBA = new AutoCompleteComboBoxAddition((JComboBox) editorComponent);
		autoCompleteCBA.setCaseSensitive(false);
	}

	final JTextComponent textField = (JTextComponent) ((JComboBox) editorComponent).getEditor().getEditorComponent();

	useEditorAsRenderer = true;
	((JComboBox) editorComponent).removeItemListener(this.delegate);
	((JComboBox) editorComponent).setEditable(type.isEditable());
	this.delegate = new EditorDelegate() {

		private static final long serialVersionUID = -5592150438626222295L;

		@Override
		public void setValue(Object x) {
			if (x == null) {
				super.setValue(null);
				((JComboBox) editorComponent).setSelectedItem(null);
			} else {
				String value = x.toString();
				super.setValue(value);
				((JComboBox) editorComponent).setSelectedItem(value);
				if (value != null) {
					textField.setText(value.toString());
				} else {
					textField.setText("");
				}
			}
		}

		@Override
		public Object getCellEditorValue() {
			if (type.isEditable()) {
				String selected = textField.getText();
				if ((selected != null) && (selected.trim().length() == 0)) {
					selected = null;
				}
				return selected;
			} else {
				return ((JComboBox) editorComponent).getSelectedItem();
			}
		}
	};
	editorComponent.setToolTipText(type.getDescription());
	((JComboBox) editorComponent).addItemListener(delegate);
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:51,代码来源:DefaultPropertyValueCellEditor.java

示例10: AttributeComboBox

import com.rapidminer.gui.tools.autocomplete.AutoCompleteComboBoxAddition; //导入依赖的package包/类
public AttributeComboBox(ParameterTypeAttribute type) {
	super(new AttributeComboBoxModel(type));
	model = (AttributeComboBoxModel) getModel();
	AutoCompleteComboBoxAddition autoCompleteCBA = new AutoCompleteComboBoxAddition(this);
	autoCompleteCBA.setCaseSensitive(true);
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:7,代码来源:AttributeComboBox.java


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