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


Java TableEditor.layout方法代码示例

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


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

示例1: addTextBoxInTable

import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private Text addTextBoxInTable(TableViewer tableViewer, TableItem tableItem, String textBoxName, 
		String valueTextPane, String editorName, int columnIndex, Listener listener) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final Text text = new Text(buttonPane, SWT.NONE);
	text.addListener(SWT.Modify, listener);
	text.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	tableItem.setData(textBoxName, text);
	tableItem.setData(valueTextPane, buttonPane);
	//text.addModifyListener(FilterHelper.INSTANCE.getTextModifyListener());
	
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	text.setData(editorName, editor);
	return text;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:20,代码来源:FilterConditionsDialog.java

示例2: addComboInTable

import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private CCombo addComboInTable(TableViewer tableViewer, TableItem tableItem, String comboName, String comboPaneName, 
		String editorName, int columnIndex,	String[] relationalOperators, SelectionListener dropDownSelectionListener,
		ModifyListener modifyListener,FocusListener focusListener) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final CCombo combo = new CCombo(buttonPane, SWT.NONE);
	combo.setItems(relationalOperators);
	combo.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	tableItem.setData(comboName, combo);
	tableItem.setData(comboPaneName, buttonPane);
	combo.addSelectionListener(dropDownSelectionListener);
	combo.addModifyListener(modifyListener);
	combo.addFocusListener(focusListener);
	new AutoCompleteField(combo, new CComboContentAdapter(), combo.getItems());
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	combo.setData(editorName, editor);
	return combo;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:FilterConditionsDialog.java

示例3: addButtonInTable

import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void addButtonInTable(TableViewer tableViewer, TableItem tableItem, String columnName, 
		String buttonPaneName, String editorName, int columnIndex, SelectionListener buttonSelectionListener,
		ImagePathConstant imagePath) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final Button button = new Button(buttonPane, SWT.NONE);
	//button.setText(columnName);
	button.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	tableItem.setData(columnName, button);
	tableItem.setData(buttonPaneName, buttonPane);
	button.addSelectionListener(buttonSelectionListener);
	button.setImage(imagePath.getImageFromRegistry());
	
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	button.setData(editorName, editor);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:21,代码来源:FilterConditionsDialog.java

示例4: addCheckButtonInTable

import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void addCheckButtonInTable(TableViewer tableViewer, TableItem tableItem, String columnName, 
		String groupPaneName, String editorName, int columnIndex, SelectionListener buttonSelectionListener) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final Button button = new Button(buttonPane, SWT.CHECK);
	button.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	if(null != buttonSelectionListener){
		button.addSelectionListener(buttonSelectionListener);
	}
	tableItem.setData(columnName, button);
	tableItem.setData(groupPaneName, buttonPane);
	
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	button.setData(editorName, editor);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:20,代码来源:FilterConditionsDialog.java

示例5: init

import org.eclipse.swt.custom.TableEditor; //导入方法依赖的package包/类
private void init() throws Exception {
		InputStream is = null;
//		is = Test.class.getResourceAsStream("/LeedsUni10-12-13.ttf");
		is = Test.class.getResourceAsStream("/Andron Scriptor Web.ttf");
		
		System.out.println("is = "+is);
		
		font = Font.createFont(Font.TRUETYPE_FONT, is);
		font = font.deriveFont(20.0f);
		is.close();
	
		System.out.println("font = "+font);
		
		GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
		ge.registerFont(font);
		////////////////////////////
		
		GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
		
		TableViewer tableViewer = new TableViewer(this, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION);
		table = tableViewer.getTable();
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
		
		data.heightHint = 200;
		table.setLayoutData(data);
		
		
		for (int i=0; i<16; i++) {
			TableColumn column = new TableColumn (table, SWT.NONE);
			column.setText (Integer.toHexString(i));
		}
		
		for (int i=0; i<100; ++i) {
			TableItem ti = new TableItem(table, SWT.PUSH);
			for (int j=0; j<16; ++j)
				ti.setText(j, ""+i);
			
			
		     TableEditor editor = new TableEditor(table);
		     editor.grabHorizontal  = true;
		     editor.grabVertical = true;
		     int colI = 0;
		     editor.setEditor(new Button(table, SWT.PUSH), ti, 0);
		     editor.layout();
		     
		     editor.getEditor();
			
		}
		for (int i=0; i<16; i++) {
			table.getColumn (i).pack ();
		}
		
//		tableViewer.setLabelProvider(new ColumnLabelProvider() {
//			  @Override
//			  public void update(ViewerCell cell) {
//			     TableItem item = (TableItem) cell.getItem();
//
//			     Composite buttonPane = new Composite(table, SWT.NONE);
//			     buttonPane.setLayout(new FillLayout());
//
//			     Button button = new Button(buttonPane,SWT.NONE);
//			     button.setText("Edit");
//
//			     button = new Button(buttonPane,SWT.NONE);
//			     button.setText("Remove");
//
//			     button = new Button(buttonPane,SWT.NONE);
//			     button.setText("Deactivate");
//
//			     TableEditor editor = new TableEditor(table);
//			     editor.grabHorizontal  = true;
//			     editor.grabVertical = true;
//			     int colI = 0;
//			     editor.setEditor(buttonPane, item, colI);
//			     editor.layout();
//			     }
//			  });		
	}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:80,代码来源:VisualKeyboard.java


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