當前位置: 首頁>>代碼示例>>Java>>正文


Java TableColumnLayout類代碼示例

本文整理匯總了Java中org.eclipse.jface.layout.TableColumnLayout的典型用法代碼示例。如果您正苦於以下問題:Java TableColumnLayout類的具體用法?Java TableColumnLayout怎麽用?Java TableColumnLayout使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TableColumnLayout類屬於org.eclipse.jface.layout包,在下文中一共展示了TableColumnLayout類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setTableLayoutToMappingTable

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
private void setTableLayoutToMappingTable(TableViewer tableViewer) {
	TableColumnLayout layout = new TableColumnLayout();
	tableViewer.getControl().getParent().setLayout(layout);

	for (int columnIndex = 0, n = tableViewer.getTable().getColumnCount(); columnIndex < n; columnIndex++) {
		tableViewer.getTable().getColumn(columnIndex).pack();
	}

	for (int i = 0; i < tableViewer.getTable().getColumnCount(); i++) {
		if(tableViewer.getData(TABLE_TYPE_KEY) == null ){
			layout.setColumnData(tableViewer.getTable().getColumn(i),
					new ColumnWeightData(1));	
		}else{
			if(i!=2){
				layout.setColumnData(tableViewer.getTable().getColumn(i),
						new ColumnWeightData(3));	
			}else{
				layout.setColumnData(tableViewer.getTable().getColumn(i),
						new ColumnWeightData(1));	
			}
			
		}
		
	}
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:26,代碼來源:MultiParameterFileDialog.java

示例2: ProjectSelector

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
public ProjectSelector(Composite parent) {
  super(parent, SWT.NONE);
  GridLayoutFactory.fillDefaults().numColumns(2).spacing(0, 0).applyTo(this);

  Composite tableComposite = new Composite(this, SWT.NONE);
  TableColumnLayout tableColumnLayout = new TableColumnLayout();
  tableComposite.setLayout(tableColumnLayout);
  GridDataFactory.fillDefaults().grab(true, true).applyTo(tableComposite);
  viewer = new TableViewer(tableComposite, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
  createColumns(tableColumnLayout);
  viewer.getTable().setHeaderVisible(true);
  viewer.getTable().setLinesVisible(false);

  input = WritableList.withElementType(GcpProject.class);
  projectProperties = PojoProperties.values(new String[] {"name", "id"}); //$NON-NLS-1$ //$NON-NLS-2$
  ViewerSupport.bind(viewer, input, projectProperties);
  viewer.setComparator(new ViewerComparator());

  Composite linkComposite = new Composite(this, SWT.NONE);
  statusLink = new Link(linkComposite, SWT.WRAP);
  statusLink.addSelectionListener(
      new OpenUriSelectionListener(new ErrorDialogErrorHandler(getShell())));
  statusLink.setText("");
  GridDataFactory.fillDefaults().span(2, 1).applyTo(linkComposite);
  GridLayoutFactory.fillDefaults().generateLayout(linkComposite);
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:27,代碼來源:ProjectSelector.java

示例3: createTableViewer

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
private TableViewer createTableViewer(Composite parent, String[] columnNames, int[] columnWeights) {
	Composite container = new Composite(parent, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, true).hint(600, 200).applyTo(container);
	TableColumnLayout layout = new TableColumnLayout();
	container.setLayout(layout);

	Table table = new Table(container, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
	table.setHeaderVisible(true);

	for (int i = 0; i < columnNames.length; i++) {
		TableColumn column = new TableColumn(table, SWT.NONE);
		column.setText(columnNames[i]);
		layout.setColumnData(column, new ColumnWeightData(columnWeights[i]));
	}

	TableViewer tableViewer = new TableViewer(table);
	tableViewer.setColumnProperties(columnNames);
	return tableViewer;
}
 
開發者ID:eclipse,項目名稱:cft,代碼行數:20,代碼來源:ManageCloudDialog.java

示例4: ClientsTableViewer

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
public ClientsTableViewer(ClientsView clientsView, Composite parent, TableColumnLayout tcl) {
    super(new Table(parent, SWT.FULL_SELECTION | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL));
    this.clientsView = clientsView;
    this.parent = parent;

    getTable().setHeaderVisible(true);
    getTable().setLinesVisible(true);
    addFixedColumns(tcl);

    setLabelProvider(new ClientLabelProvider());

    // Does it make sense to have a menu to change processor for a client, as in yamcs-monitor ?
    // Since yamcs-studio has its own control to switch processor for itself.

    //        // add popup menu
    //        Menu contextMenu = new Menu(getTable());
    //        getTable().setMenu(contextMenu);
    //        MenuItem mItem1 = new MenuItem(contextMenu, SWT.None);
    // ...
}
 
開發者ID:yamcs,項目名稱:yamcs-studio,代碼行數:21,代碼來源:ClientsTableViewer.java

示例5: createPartControl

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
@Override
public void createPartControl(Composite parent) {
    Composite tableWrapper = new Composite(parent, SWT.NONE);
    tableWrapper.setLayoutData(new GridData(GridData.FILL_BOTH));
    TableColumnLayout tcl = new TableColumnLayout();
    tableWrapper.setLayout(tcl);
    clientsTableViewer = new ClientsTableViewer(this, tableWrapper, tcl);
    clientsContentProvider = new ClientsContentProvider(clientsTableViewer);
    clientsTableViewer.setContentProvider(clientsContentProvider);
    clientsTableViewer.setInput(clientsContentProvider);

    if (getViewSite() != null)
        getViewSite().setSelectionProvider(clientsTableViewer);

    // Set initial state
    clientsTableViewer.refresh();

    ManagementCatalogue.getInstance().addManagementListener(this);
}
 
開發者ID:yamcs,項目名稱:yamcs-studio,代碼行數:20,代碼來源:ClientsView.java

示例6: CommandStackTableViewer

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
public CommandStackTableViewer(Composite parent, TableColumnLayout tcl, CommandStackView styleProvider) {
    super(new Table(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.HIDE_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL));
    this.styleProvider = styleProvider;
    resourceManager = new LocalResourceManager(JFaceResources.getResources(), parent);
    greenBubble = resourceManager.createImage(RCPUtils.getImageDescriptor(CommandStackTableViewer.class, "icons/obj16/ok.png"));
    redBubble = resourceManager.createImage(RCPUtils.getImageDescriptor(CommandStackTableViewer.class, "icons/obj16/nok.png"));
    grayBubble = resourceManager.createImage(RCPUtils.getImageDescriptor(CommandStackTableViewer.class, "icons/obj16/undef.png"));
    waitingImage = resourceManager.createImage(RCPUtils.getImageDescriptor(CommandStackTableViewer.class, "icons/obj16/waiting.png"));

    getTable().setHeaderVisible(true);
    getTable().setLinesVisible(true);
    addFixedColumns(tcl);

    contentProvider = new CommandStackTableContentProvider(this);
    setContentProvider(contentProvider);
    setInput(contentProvider); // ! otherwise refresh() deletes everything...
}
 
開發者ID:yamcs,項目名稱:yamcs-studio,代碼行數:18,代碼來源:CommandStackTableViewer.java

示例7: createColumns

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
private void createColumns(Table table)
  {
E [] columns = columnEnumClass.getEnumConstants();


      TableColumnLayout tableLayout = new TableColumnLayout();
this.setLayout(tableLayout);

for (int i = 0; i < columns.length; i++) {
	E column = columns[i];
       createTableViewerColumn(column.getTitle(), column.getPercentage(), column.getColumnIndex());				
	TableColumn tableColumn = table.getColumn(column.getColumnIndex());
	tableColumn.pack();
	tableLayout.setColumnData(tableColumn, new ColumnWeightData(column.getPercentage(), table.getColumn(0).getWidth()));
	
}
  }
 
開發者ID:scauwe,項目名稱:IDM-Enh-Trace,代碼行數:18,代碼來源:AbstractTraceComposite.java

示例8: createTableViewer

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
private void createTableViewer(Composite composite) {
	tableViewer = new TableViewer(composite, SWT.MULTI  | SWT.FULL_SELECTION | SWT.BORDER);
	tableColumnLayout = new TableColumnLayout();
	composite.setLayout(tableColumnLayout);
	createColumns();
	final Table table = tableViewer.getTable();
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    createTableContextMenu();
    tableViewer.addDoubleClickListener(new IDoubleClickListener() {
		public void doubleClick(DoubleClickEvent arg0) {
			openDescription();
		}
	});
    tableViewer.setContentProvider(new ArrayContentProvider());
    tableViewer.setComparator(new ColumnLabelSorter(tableViewer));
    GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
    tableViewer.getControl().setLayoutData(gridData);
}
 
開發者ID:scouter-project,項目名稱:scouter,代碼行數:20,代碼來源:ObjectClassListView.java

示例9: createPartControl

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
public void createPartControl(Composite parent) {
	this.setPartName("Login List[" + ServerManager.getInstance().getServer(serverId).getName() + "]");
	tableColumnLayout = new TableColumnLayout();
	parent.setLayout(tableColumnLayout);
	viewer = new TableViewer(parent, SWT.FULL_SELECTION | SWT.BORDER);
	createColumns();
	final Table table = viewer.getTable();
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setComparator(new ColumnLabelSorter(viewer));
    createTableContextMenu();
    IToolBarManager man = getViewSite().getActionBars().getToolBarManager();
    man.add(new Action("Reload", ImageUtil.getImageDescriptor(Images.refresh)) {
		public void run() {
			load();
		}
	});
    load();
}
 
開發者ID:scouter-project,項目名稱:scouter,代碼行數:21,代碼來源:LoginUserView.java

示例10: createPartControl

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
public void createPartControl(Composite parent) {
	this.setPartName("Account List[" + ServerManager.getInstance().getServer(serverId).getName() + "]");
	tableColumnLayout = new TableColumnLayout();
	parent.setLayout(tableColumnLayout);
	viewer = new TableViewer(parent, SWT.FULL_SELECTION | SWT.BORDER);
	createColumns();
	final Table table = viewer.getTable();
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setComparator(new ColumnLabelSorter(viewer));
    createTableContextMenu();
    IToolBarManager man = getViewSite().getActionBars().getToolBarManager();
    man.add(new Action("Reload", ImageUtil.getImageDescriptor(Images.refresh)) {
		public void run() {
			load();
		}
	});
    load();
}
 
開發者ID:scouter-project,項目名稱:scouter,代碼行數:21,代碼來源:AccountListView.java

示例11: createTableViewer

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
private void createTableViewer(Composite composite) {
	tableViewer = new TableViewer(composite, SWT.MULTI  | SWT.FULL_SELECTION | SWT.BORDER);
	tableColumnLayout = new TableColumnLayout();
	composite.setLayout(tableColumnLayout);
	createColumns();
	final Table table = tableViewer.getTable();
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    tableViewer.addDoubleClickListener(new IDoubleClickListener() {
		public void doubleClick(DoubleClickEvent evt) {
			StructuredSelection sel = (StructuredSelection) evt.getSelection();
			Object o = sel.getFirstElement();
			if (o instanceof BatchPack) {
				BatchPack pack = (BatchPack) o;
				Display display = ObjectBatchHistoryView.this.getViewSite().getShell().getDisplay();
				new OpenBatchDetailJob(display, pack, serverId).schedule();
			} else {
				System.out.println(o);
			}
		}
	});
    tableViewer.setContentProvider(new ArrayContentProvider());
    tableViewer.setComparator(new ColumnLabelSorter(tableViewer));
    GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
    tableViewer.getControl().setLayoutData(gridData);
}
 
開發者ID:scouter-project,項目名稱:scouter,代碼行數:27,代碼來源:ObjectBatchHistoryView.java

示例12: AxesTableHandler

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
/** Initialize
 *  @param parent
 *  @param table_layout
 *  @param operations_manager
 */
public AxesTableHandler(final Composite parent,
        final TableColumnLayout table_layout, final UndoableActionManager operations_manager)
{
    color_registry = new LocalResourceManager(JFaceResources.getResources(), parent);
    this.operations_manager = operations_manager;

    axes_table = new TableViewer(parent,
            SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION
            | SWT.VIRTUAL);
    final Table table = axes_table.getTable();
    table.setHeaderVisible(true);
    table.setLinesVisible(true);

    createColumns(table_layout);

    axes_table.setContentProvider(this);

    createContextMenu();
}
 
開發者ID:kasemir,項目名稱:org.csstudio.display.builder,代碼行數:25,代碼來源:AxesTableHandler.java

示例13: createPropertiesTable

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
private TableViewer createPropertiesTable(Composite parent) {
	Composite cmpItemPropertiesTableViewer=new Composite(parent, SWT.NONE);
	cmpItemPropertiesTableViewer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true,1,3));
	TableColumnLayout tl_itemPropertiesTableViewer = new TableColumnLayout();
	cmpItemPropertiesTableViewer.setLayout(tl_itemPropertiesTableViewer);
	
	TableViewer tv = new TableViewer(cmpItemPropertiesTableViewer,SWT.BORDER | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
	tv.getTable().setHeaderVisible(true);
	tv.getTable().setLinesVisible(true);
	
	TableViewerColumn tvcName = new TableViewerColumn(tv, SWT.NONE);
	tvcName.getColumn().setText(Messages.SPCVItemPropertiesList_ColName);
	tvcName.setLabelProvider(new ItemPropertyNameLabelProvider());
	tl_itemPropertiesTableViewer.setColumnData(tvcName.getColumn(), new ColumnWeightData(1, ColumnWeightData.MINIMUM_WIDTH, true));

	TableViewerColumn tvcValue = new TableViewerColumn(tv, SWT.NONE);
	tvcValue.getColumn().setText(Messages.SPCVItemPropertiesList_ColValue);
	tvcValue.setLabelProvider(new ItemPropertyValueLabelProvider());
	tl_itemPropertiesTableViewer.setColumnData(tvcValue.getColumn(), new ColumnWeightData(1, ColumnWeightData.MINIMUM_WIDTH, true));
	
	tv.setContentProvider(new ArrayContentProvider());

	return tv;
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:25,代碼來源:SPCVItemPropertiesList.java

示例14: createPropertiesTable

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
private TableViewer createPropertiesTable(Composite parent) {
	Composite cmpItemPropertiesTableViewer=new Composite(parent, SWT.NONE);
	cmpItemPropertiesTableViewer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true,1,3));
	TableColumnLayout tl_itemPropertiesTableViewer = new TableColumnLayout();
	cmpItemPropertiesTableViewer.setLayout(tl_itemPropertiesTableViewer);
	
	TableViewer tv = new TableViewer(cmpItemPropertiesTableViewer,SWT.BORDER | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
	tv.getTable().setHeaderVisible(true);
	tv.getTable().setLinesVisible(true);
	
	TableViewerColumn tvcName = new TableViewerColumn(tv, SWT.NONE);
	tvcName.getColumn().setText(Messages.ElementItemDialog_NameColumn);
	tvcName.setLabelProvider(getItemPropertyNameLabelProvider());
	tl_itemPropertiesTableViewer.setColumnData(tvcName.getColumn(), new ColumnWeightData(1, ColumnWeightData.MINIMUM_WIDTH, true));

	TableViewerColumn tvcValue = new TableViewerColumn(tv, SWT.NONE);
	tvcValue.getColumn().setText(Messages.ElementItemDialog_ValueColumn);
	tvcValue.setLabelProvider(getItemPropertyValueLabelProvider());
	tl_itemPropertiesTableViewer.setColumnData(tvcValue.getColumn(), new ColumnWeightData(1, ColumnWeightData.MINIMUM_WIDTH, true));
	
	tv.setContentProvider(new ArrayContentProvider());

	return tv;
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:25,代碼來源:ElementItemDialog.java

示例15: buildTable

import org.eclipse.jface.layout.TableColumnLayout; //導入依賴的package包/類
/** Builds a table with the given columns. */
protected static Table buildTable(Composite parent, int style, boolean linesVisible, boolean headerVisible, List<? extends ColumnBuilder> columnBuilders) {
	SwtMisc.assertClean(parent);
	// create the control
	Table control = new Table(parent, style);
	control.setLinesVisible(linesVisible);
	control.setHeaderVisible(headerVisible);

	// create the columns and layout
	Function<ColumnBuilder, TableColumn> buildFunc = builder -> builder.build(control);
	List<TableColumn> columns = columnBuilders.stream().map(buildFunc).collect(Collectors.toList());
	buildLayout(control, new TableColumnLayout(), columns, columnBuilders);

	// return the control
	return control;
}
 
開發者ID:diffplug,項目名稱:durian-swt,代碼行數:17,代碼來源:ColumnFormat.java


注:本文中的org.eclipse.jface.layout.TableColumnLayout類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。