• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java EventSelectionModel类的典型用法和代码示例

java 2次浏览

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

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

示例1: HiddenTable

点赞 3

import ca.odell.glazedlists.swing.EventSelectionModel; //导入依赖的package包/类
HiddenTable(JTable jTable)
{
       ObservableElementList.Connector<ObservableObject> connector = GlazedLists.beanConnector(ObservableObject.class);
    SortedList<ObservableObject> servicesEventList = 
    	    new SortedList<ObservableObject>(
    	    new ObservableElementList<ObservableObject> (
    	    		GlazedLists.threadSafeList(
    	    				new BasicEventList<ObservableObject>()
    	    				), connector
    	    				));
    EventTableModel<ObservableObject> servicesTableModel = new EventTableModel<ObservableObject>(servicesEventList, 
    		new BeanTableFormat<ObservableObject>(propertyNames, columnLabels));
    list = new ObservableList(servicesEventList, propertyNames, new String[]{"name"});
    jTable.setModel(servicesTableModel);
    _selection = new EventSelectionModel<ObservableObject>(servicesEventList);
    jTable.setSelectionModel(_selection);
}
 

开发者ID:yajsw,
项目名称:yajsw,
代码行数:18,
代码来源:HiddenTable.java

示例2: HostsTable

点赞 3

import ca.odell.glazedlists.swing.EventSelectionModel; //导入依赖的package包/类
HostsTable(JTable jTable)
	{
        ObservableElementList.Connector<ObservableObject> connector = GlazedLists.beanConnector(ObservableObject.class);
	    SortedList<ObservableObject> servicesEventList = 
	    	    new SortedList<ObservableObject>(
	    	    new ObservableElementList<ObservableObject> (
	    	    		GlazedLists.threadSafeList(
	    	    				new BasicEventList<ObservableObject>()
	    	    				), connector
	    	    				));
	    EventTableModel<ObservableObject> servicesTableModel = new EventTableModel<ObservableObject>(servicesEventList, 
	    		new BeanTableFormat<ObservableObject>(propertyNames, columnLabels));
	    list = new ObservableList(servicesEventList, propertyNames, new String[]{"name"});
	    //JTable jTable = new JTable(servicesTableModel);
	    jTable.setModel(servicesTableModel);
	    _selection = new EventSelectionModel<ObservableObject>(servicesEventList);
	    jTable.setSelectionModel(_selection);
	    TableComparatorChooser tableSorter = TableComparatorChooser.install(jTable, servicesEventList, TableComparatorChooser.SINGLE_COLUMN);
	    Dimension size = jTable.getPreferredScrollableViewportSize();
//	    jTable.setPreferredScrollableViewportSize
//	        (new Dimension(jTable.getPreferredSize().width, size.height));
//	    JScrollPane servicesListScrollPane = new JScrollPane(jTable);
//	    this.setLayout(new BorderLayout());
//	    this.add(servicesListScrollPane, BorderLayout.CENTER);
	}
 

开发者ID:yajsw,
项目名称:yajsw,
代码行数:26,
代码来源:HostsTable.java

示例3: init

点赞 2

import ca.odell.glazedlists.swing.EventSelectionModel; //导入依赖的package包/类
/**
 * Initializes the component
 */
protected void init() {

	setRowHeight(18);

	selectedBackgroundColor = getSelectionBackground();

	getTableHeader().setReorderingAllowed(false);

	getColumnModel().getColumn(0).setMaxWidth(20);
	getColumnModel().getColumn(0).setMinWidth(20);
	getColumnModel().getColumn(1).setPreferredWidth(50);
	getColumnModel().getColumn(1).setMaxWidth(50);
	getColumnModel().getColumn(2).setPreferredWidth(150);
	getColumnModel().getColumn(2).setMaxWidth(150);
	getColumnModel().getColumn(3).setPreferredWidth(200);
	getColumnModel().getColumn(4).setPreferredWidth(300);

	setShowVerticalLines(false);

	setDefaultRenderer(String.class, renderer);
	setDefaultRenderer(Object.class, renderer);
	setDefaultRenderer(Long.class, renderer);

	EventSelectionModel myEventSelectionModel = new EventSelectionModel(sortedEvents);
	setSelectionModel(myEventSelectionModel);
	getSelectionModel().setSelectionMode(ListSelection.MULTIPLE_INTERVAL_SELECTION_DEFENSIVE);

	registerListeners();
}
 

开发者ID:mongkoy,
项目名称:c-logger,
代码行数:33,
代码来源:LogTable.java

示例4: createControl

点赞 2

import ca.odell.glazedlists.swing.EventSelectionModel; //导入依赖的package包/类
protected JComponent createControl() {
	// Contstruct the table model and table to display the data
	EventList finalEventList = getFinalEventList();
	model = createTableModel(finalEventList);

	JTable table = getComponentFactory().createTable(model);
	table.setSelectionModel(new EventSelectionModel(finalEventList));
	table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);

	// Install the sorter
	Assert.notNull(baseList);
	tableSorter = createTableSorter(table, baseList);

	// Allow the derived type to configure the table
	configureTable(table);

	int initialSortColumn = getInitialSortColumn();
	if (initialSortColumn >= 0) {
		tableSorter.clearComparator();
		tableSorter.appendComparator(initialSortColumn, 0, false);
	}

	// Add the context menu listener
	table.addMouseListener(new ContextPopupMenuListener());

	// Add our mouse handlers to setup our desired selection mechanics
	table.addMouseListener(new DoubleClickListener());

	// Keep our status line up to date with the selections and filtering
	StatusBarUpdateListener statusBarUpdateListener = new StatusBarUpdateListener();
	table.getSelectionModel().addListSelectionListener(statusBarUpdateListener);
	getFinalEventList().addListEventListener(statusBarUpdateListener);

	return table;
}
 

开发者ID:shevek,
项目名称:spring-rich-client,
代码行数:36,
代码来源:AbstractObjectTable.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)