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


Java TableFormat类代码示例

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


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

示例1: getEnumTableFormatAdaptor

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
private EnumTableFormatAdaptor<?, ?> getEnumTableFormatAdaptor() {
	if (getEventTableModel() != null) {
		TableFormat<?> tableFormat = getEventTableModel().getTableFormat();
		if (tableFormat instanceof EnumTableFormatAdaptor) {
			return (EnumTableFormatAdaptor) tableFormat;
		}
	}
	return null;
}
 
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:10,代码来源:JAutoColumnTable.java

示例2: saveSettings

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
public final void saveSettings() {
	//Save Settings
	if (eventTableModel != null && jTable != null && toolName != null) {
		TableFormat<?> tableFormat = eventTableModel.getTableFormat();
		if (tableFormat instanceof  EnumTableFormatAdaptor) {
			EnumTableFormatAdaptor<?, ?> formatAdaptor = (EnumTableFormatAdaptor<?, ?>) tableFormat;
			Settings.get().getTableColumns().put(toolName, formatAdaptor.getColumns());
			Settings.get().getTableResize().put(toolName, formatAdaptor.getResizeMode());
			Settings.get().getTableColumnsWidth().put(toolName, jTable.getColumnsWidth());
		}
	}
	
}
 
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:14,代码来源:JMainTab.java

示例3: installTable

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
/**
 * Table automation
 * 1. Saving table settings (TableColumns, TableResize, TableColumnsWidth)
 * 2. Restore table selection after update
 * 3. Restore expanded state for JSeparatorTable after update
 * 4. Lock/unlock table doing update
 * 
 * @param jTable
 * @param toolName unique tool name
 */
protected final void installTable(final JAutoColumnTable jTable, String toolName) {
	this.toolName = toolName;

	//Table Selection
	ListSelectionModel selectionModel = jTable.getSelectionModel();
	if (selectionModel instanceof  DefaultEventSelectionModel) {
		this.eventSelectionModel = (DefaultEventSelectionModel<?>) selectionModel;
	}
	TableModel tableModel = jTable.getModel();
	if (tableModel instanceof DefaultEventTableModel) {
		this.eventTableModel = (DefaultEventTableModel<?>) tableModel;
	}

	//Table lock
	this.jTable = jTable;

	//Load Settings
	if (eventTableModel != null && toolName != null) {
		TableFormat<?> tableFormat = eventTableModel.getTableFormat();
		if (tableFormat instanceof  EnumTableFormatAdaptor) {
			EnumTableFormatAdaptor<?, ?> formatAdaptor = (EnumTableFormatAdaptor<?, ?>) tableFormat;
			formatAdaptor.setColumns(Settings.get().getTableColumns().get(toolName));
			formatAdaptor.setResizeMode(Settings.get().getTableResize().get(toolName));
			jTable.setColumnsWidth(Settings.get().getTableColumnsWidth().get(toolName));
			eventTableModel.fireTableStructureChanged();
		}
	}
}
 
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:39,代码来源:JMainTab.java

示例4: createTableModel

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
/**
 * Construct the table model for this table. The default implementation of this creates a GlazedTableModel using an
 * Advanced format.
 * @param eventList on which to build the model
 * @return table model
 */
protected GlazedTableModel createTableModel(EventList eventList) {
	return new GlazedTableModel(eventList, getColumnPropertyNames(), modelId) {
		protected TableFormat createTableFormat() {
			return new DefaultAdvancedTableFormat();
		}
	};
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:14,代码来源:AbstractObjectTable.java

示例5: TableColumnValueFunction

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
public TableColumnValueFunction(TableFormat<E> tableFormat, int columnIndex) {
    this.tableFormat = tableFormat;
    this.columnIndex = columnIndex;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:5,代码来源:SearchAutoCompleteSupport.java

示例6: createTableModel

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
public static <E> DefaultEventTableModel<E> createTableModel(EventList<E> source, TableFormat<E> tableFormat) {
	// XXX - Workaround for java bug: https://bugs.openjdk.java.net/browse/JDK-8068824
	//return new DefaultEventTableModel<E>(createSwingThreadProxyList(source), tableFormat);
	return new FixedEventTableModel<E>(createSwingThreadProxyList(source), tableFormat);
}
 
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:6,代码来源:EventModels.java

示例7: FixedEventTableModel

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
public FixedEventTableModel(EventList<E> source, TableFormat<E> tableFormat) {
	super(source, tableFormat);
}
 
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:4,代码来源:EventModels.java

示例8: getTableFormat

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
@Override
public TableFormat<Integer> getTableFormat() {
	return null;
}
 
开发者ID:eclipse,项目名称:eavp,代码行数:5,代码来源:ListComponentTester.java

示例9: createTableModel

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
public static <E> DefaultEventTableModel<E> createTableModel(EventList<E> source, TableFormat<E> tableFormat) {
	return new DefaultEventTableModel<E>(createSwingThreadProxyList(source), tableFormat);
}
 
开发者ID:GoldenGnu,项目名称:jwarframe,代码行数:4,代码来源:EventModels.java

示例10: TableColumnValueFunction

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
public TableColumnValueFunction(TableFormat<E> tableFormat,
                                int columnIndex) {
    this.tableFormat = tableFormat;
    this.columnIndex = columnIndex;
}
 
开发者ID:richard-strauss-werke,项目名称:glyphpicker,代码行数:6,代码来源:CustomAutoCompleteSupport.java

示例11: GlazedListTableWidget

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
public GlazedListTableWidget(Class dataType, List<? extends Object> rows, TableFormat format,
                             String[] filterProperties)
{
    this(dataType, rows, format, filterProperties, null, false);
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:6,代码来源:GlazedListTableWidget.java

示例12: initModels

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
private void initModels() {
	EventList<LoadProfileEntity> treeItems = GlazedLists.eventListOf();
	treeModel = new EventsTreeModel(treeItems);
	tree.setModel(treeModel);

	TableFormat<SelectionDecorator> tableFormat = GlazedLists.tableFormat(SelectionDecorator.class, new String[] {
			"selected",
			"baseObject.name" },
			new String[] { "Selected", "Name" }, new boolean[] { true, false });

	decoratedClients = GlazedLists.eventListOf();

	EventTableModel<SelectionDecorator> clientsTableModel = new EventTableModel<SelectionDecorator>(decoratedClients,
			tableFormat);
	tblClients.setModel(clientsTableModel);
	tblClients.getColumnModel().getColumn(0).setMaxWidth(24);

	decoratedTargets = GlazedLists.eventListOf();
	oneTimeDecoratedTargets = GlazedLists.eventListOf();

	EventTableModel<SelectionDecorator> targetsTableModel = new EventTableModel<SelectionDecorator>(decoratedTargets,
			tableFormat);
	targetsTableModel.addTableModelListener(new TableModelListener() {
		@Override
		public void tableChanged(final TableModelEvent e) {
			ModelUtils.updateTargetDecorators(decoratedTargets, oneTimeDecoratedTargets,
					loadProfilesController.getTargets(), true);
			if (activeLoadProfileEntityPanel instanceof OneTimePanel) {
				activeLoadProfileEntityPanel.repaint();
			}
		}
	});

	tblTargets.setModel(targetsTableModel);
	tblTargets.getColumnModel().getColumn(0).setMaxWidth(24);

	EventList<Target> targets = GlazedLists.<Target>eventListOf();
	EventList<Operation> operations = GlazedLists.<Operation>eventListOf();
	EventList<Client> clients = GlazedLists.<Client>eventListOf();

	stairsPanel.setCboOperationModel(new EventComboBoxModel<Operation>(operations));
	oneTimePanel.setCboOperationModel(new EventComboBoxModel<Operation>(operations));

	loadProfilesController.setTreeItems(treeItems);
	loadProfilesController.setOperations(operations);
	loadProfilesController.setTargets(targets);
	loadProfilesController.setClients(clients);

	oneTimePanel.setTblTargetModel(new EventTableModel<SelectionDecorator>(oneTimeDecoratedTargets, tableFormat));
}
 
开发者ID:mgm-tp,项目名称:perfload-loadprofiles,代码行数:51,代码来源:AppFrame.java

示例13: initModels

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
private void initModels() {
	TableFormat<Operation> operationsTableFormat = GlazedLists.tableFormat(Operation.class, new String[] { "name",
			"relativeClientLoad" },
			new String[] { "Name", "Rel. Client Load" }, new boolean[] { true, true });
	EventTableModel<Operation> operationsModel = new EventTableModel<Operation>(operations, operationsTableFormat);
	tblOperations.setModel(operationsModel);
	tblOperations.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
	tblOperations.setColumnWidths(300, 100);
	tblOperations.getColumnModel().getColumn(0).setCellEditor(new StringCellEditor(tblOperations, operations));
	TableColumn column = tblOperations.getColumnModel().getColumn(1);
	column.setCellEditor(new DoubleCellEditor());
	column.setCellRenderer(new DoubleCellRenderer());

	TableFormat<Target> targetsTableFormat = GlazedLists.tableFormat(Target.class, new String[] { "name", "loadPart" },
			new String[] { "Name", "Load Part" }, new boolean[] { true, true });
	EventTableModel<Target> targetsModel = new EventTableModel<Target>(targets, targetsTableFormat);
	tblTargets.setModel(targetsModel);
	tblTargets.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
	tblTargets.setColumnWidths(300, 100);
	tblTargets.getColumnModel().getColumn(0).setCellEditor(new StringCellEditor(tblTargets, targets));
	column = tblTargets.getColumnModel().getColumn(1);
	column.setCellEditor(new DoubleCellEditor());
	column.setCellRenderer(new DoubleCellRenderer());

	TableFormat<Client> clientsTableFormat = GlazedLists
			.tableFormat(Client.class,
					new String[] { "daemonId", "name", "numProcesses", "relativePower" },
					new String[] { "Daemon ID", "Name", "# of Processes", "Rel. Power" }, new boolean[] { false, true,
							true, true });
	EventTableModel<Client> clientsModel = new EventTableModel<Client>(clients, clientsTableFormat);
	tblClients.setModel(clientsModel);
	tblClients.setColumnWidths(80, 200, 80, 60);
	tblClients.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
	//		tblClients.getColumnModel().getColumn(0).setCellEditor(new IntegerCellEditor());
	tblClients.getColumnModel().getColumn(1).setCellEditor(new StringCellEditor(tblClients, clients));
	tblClients.getColumnModel().getColumn(2).setCellEditor(new IntegerCellEditor());
	column = tblClients.getColumnModel().getColumn(3);
	column.setCellEditor(new DoubleCellEditor());
	column.setCellRenderer(new DoubleCellRenderer());

	cboConfigurationFile.setModel(new EventComboBoxModel<String>(configFiles));
	cboConfigurationFile.setSelectedItem(controller.getActiveSettingsFile());
}
 
开发者ID:mgm-tp,项目名称:perfload-loadprofiles,代码行数:44,代码来源:SettingsDialog.java

示例14: createTableCellEditor

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
/**
 * This factory method creates and returns a {@link AutoCompleteCellEditor}
 * which adapts an autocompleting {@link JComboBox} for use as a Table
 * Cell Editor. The values within the table column are used as
 * autocompletion terms within the {@link ComboBoxModel}.
 *
 * <p>This version of <code>createTableCellEditor</code> makes no
 * assumption about the values stored in the TableModel at the given
 * <code>columnIndex</code>. Instead, it uses the given
 * <code>uniqueComparator</code> to determine which values are duplicates
 * (and thus can safely be removed) and which are unique (and thus must
 * remain in the {@link ComboBoxModel}).
 *
 * <p>Note that this factory method is only appropriate for use when the
 * values in the {@link ComboBoxModel} should be the unique set of values
 * in a table column. If some other list of values will be used then
 * {@link #createTableCellEditor(EventList)} is the appropriate factory
 * method to use.
 *
 * <p>If the appearance or function of the autocompleting {@link JComboBox}
 * is to be customized, it can be retrieved using
 * {@link AutoCompleteCellEditor#getComponent()}.
 *
 * @param uniqueComparator the {@link Comparator} that strips away
 *      duplicate elements from the {@link ComboBoxModel}
 * @param tableFormat specifies how each row object within a table is
 *      broken apart into column values
 * @param tableData the {@link EventList} backing the TableModel
 * @param columnIndex the index of the column for which to return a
 *      {@link AutoCompleteCellEditor}
 * @return a {@link AutoCompleteCellEditor} which contains an autocompleting
 *      combobox whose contents remain consistent with the data in the
 *      table column at the given <code>columnIndex</code>
 */
public static <E> AutoCompleteCellEditor<E> createTableCellEditor(Comparator uniqueComparator, TableFormat<E> tableFormat, EventList<E> tableData, int columnIndex) {
    // use a function to extract all values for the column
    final FunctionList.Function<E, Object> columnValueFunction = new TableColumnValueFunction<E>(tableFormat, columnIndex);
    final FunctionList allColumnValues = new FunctionList<E, Object>(tableData, columnValueFunction);

    // narrow the list to just unique values within the column
    final EventList<E> uniqueColumnValues = new UniqueList<E>(allColumnValues, uniqueComparator);

    return createTableCellEditor(uniqueColumnValues);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:45,代码来源:SearchAutoCompleteSupport.java

示例15: createTableCellEditor

import ca.odell.glazedlists.gui.TableFormat; //导入依赖的package包/类
/**
 * This factory method creates and returns a {@link AutoCompleteCellEditor}
 * which adapts an autocompleting {@link JComboBox} for use as a Table Cell
 * Editor. The values within the table column are used as autocompletion
 * terms within the {@link ComboBoxModel}.
 * <p/>
 * <p/>
 * This version of <code>createTableCellEditor</code> makes no assumption
 * about the values stored in the TableModel at the given
 * <code>columnIndex</code>. Instead, it uses the given
 * <code>uniqueComparator</code> to determine which values are duplicates
 * (and thus can safely be removed) and which are unique (and thus must
 * remain in the {@link ComboBoxModel}).
 * <p/>
 * <p/>
 * Note that this factory method is only appropriate for use when the values
 * in the {@link ComboBoxModel} should be the unique set of values in a
 * table column. If some other list of values will be used then
 * {@link #createTableCellEditor(EventList)} is the appropriate factory
 * method to use.
 * <p/>
 * <p/>
 * If the appearance or function of the autocompleting {@link JComboBox} is
 * to be customized, it can be retrieved using
 * {@link AutoCompleteCellEditor#getComponent()}.
 *
 * @param uniqueComparator the {@link Comparator} that strips away duplicate elements
 *                         from the {@link ComboBoxModel}
 * @param tableFormat      specifies how each row object within a table is broken apart
 *                         into column values
 * @param tableData        the {@link EventList} backing the TableModel
 * @param columnIndex      the index of the column for which to return a
 *                         {@link AutoCompleteCellEditor}
 * @return a {@link AutoCompleteCellEditor} which contains an autocompleting
 * combobox whose contents remain consistent with the data in the
 * table column at the given <code>columnIndex</code>
 */
@SuppressWarnings({"rawtypes", "unchecked"})
public static <E> AutoCompleteCellEditor<E> createTableCellEditor(
        Comparator uniqueComparator, TableFormat<E> tableFormat,
        EventList<E> tableData, int columnIndex) {
    // use a function to extract all values for the column
    final FunctionList.Function<E, Object> columnValueFunction = new TableColumnValueFunction<E>(
            tableFormat, columnIndex);
    final FunctionList allColumnValues = new FunctionList<E, Object>(
            tableData, columnValueFunction);
    // narrow the list to just unique values within the column
    final EventList<E> uniqueColumnValues = new UniqueList<E>(
            allColumnValues, uniqueComparator);
    return createTableCellEditor(uniqueColumnValues);
}
 
开发者ID:richard-strauss-werke,项目名称:glyphpicker,代码行数:52,代码来源:CustomAutoCompleteSupport.java


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