org.eclipse.swt.widgets.Table.getLayoutData()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.eclipse.swt.widgets.Table.getLayoutData()方法的一些代码示例,展示了Table.getLayoutData()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getLayoutData()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:getLayoutData

Table.getLayoutData介绍

暂无

代码示例

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

@Override
protected Control createDialogArea(Composite parent) {
 Composite mainArea = (Composite)super.createDialogArea(parent);
 createWideLabel(mainArea, "Type Name:");
 
 typeNameUI = newText(mainArea, SWT.SINGLE, "Specify the type name");
 typeNameUI.addListener(SWT.Modify, this);
 
 createWideLabel(mainArea, "Matching Types:");
 
 matchingTypesUI = newTable(mainArea, SWT.SINGLE);
 ((GridData)matchingTypesUI.getLayoutData()).heightHint = 250;
 ((GridData)matchingTypesUI.getLayoutData()).minimumHeight = 100;
 typeNameUI.addListener(SWT.Selection, this);
 
 createWideLabel(mainArea, "NameSpaces:");
 
 nameSpacesUI = newTable(mainArea, SWT.SINGLE);
 ((GridData)nameSpacesUI.getLayoutData()).heightHint = 75;
 ((GridData)nameSpacesUI.getLayoutData()).minimumHeight = 40;
 
 displayFilteredTypes("");
   
 return mainArea;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

private void resizeProposalSelector(boolean adjustWidth) {
  int width= adjustWidth ? SWT.DEFAULT : ((GridData)fProposalTable.getLayoutData()).widthHint;
  Point size= fProposalTable.computeSize(width, SWT.DEFAULT, true);
  GridData data= new GridData(GridData.FILL_BOTH);
  data.widthHint= adjustWidth ? Math.min(size.x, 300) : width;
  data.heightHint= Math.min(getTableHeightHint(fProposalTable, fProposalTable.getItemCount()), getTableHeightHint(fProposalTable, 10));
  fProposalTable.setLayoutData(data);
  fProposalShell.layout(true);
  fProposalShell.pack();
  if (adjustWidth) {
    fProposalShell.setLocation(getLocation());
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

private void resizeProposalSelector(boolean adjustWidth) {
  int width= adjustWidth ? SWT.DEFAULT : ((GridData)fProposalTable.getLayoutData()).widthHint;
  Point size= fProposalTable.computeSize(width, SWT.DEFAULT, true);
  GridData data= new GridData(GridData.FILL_BOTH);
  data.widthHint= adjustWidth ? Math.min(size.x, 300) : width;
  data.heightHint= Math.min(getTableHeightHint(fProposalTable, fProposalTable.getItemCount()), getTableHeightHint(fProposalTable, 10));
  fProposalTable.setLayoutData(data);
  fProposalShell.layout(true);
  fProposalShell.pack();
  if (adjustWidth) {
    fProposalShell.setLocation(getLocation());
  }
}

代码示例来源:origin: org.eclipse.mylyn.commons/workbench

private void setHistoryTableVisible(boolean isVisible) {
  GridData layoutData = (GridData) historyTable.getTable().getLayoutData();
  historyTable.getTable().setVisible(isVisible);
  boolean wasVisible = !layoutData.exclude;
  layoutData.exclude = !isVisible;
  if (wasVisible != isVisible || isVisible) {
    getShell().pack();
  }
  initializeBounds();
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt

public Point computeSizeHint() {
  // Resize the table's height accordingly to the new input
  Table viewerTable = fTableViewer.getTable();
  Point tableSize = viewerTable.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  int tableMaxHeight = fComposite.getDisplay().getBounds().height / 2;
  // removes padding if necessary
  int tableHeight = (tableSize.y <= tableMaxHeight) ? tableSize.y
      - viewerTable.getItemHeight() - viewerTable.getItemHeight() / 2
      : tableMaxHeight;
  ((GridData) viewerTable.getLayoutData()).heightHint = tableHeight;
  Point fCompSize = fComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  fComposite.setSize(fCompSize);
  return fCompSize;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt

public Point computeSizeHint() {
  // Resize the table's height accordingly to the new input
  Table viewerTable = fTableViewer.getTable();
  Point tableSize = viewerTable.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  int tableMaxHeight = fComposite.getDisplay().getBounds().height / 2;
  // removes padding if necessary
  int tableHeight = (tableSize.y <= tableMaxHeight) ? tableSize.y
      - viewerTable.getItemHeight() - viewerTable.getItemHeight() / 2
      : tableMaxHeight;
  ((GridData) viewerTable.getLayoutData()).heightHint = tableHeight;
  Point fCompSize = fComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  fComposite.setSize(fCompSize);
  return fCompSize;
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

GridData gd = (GridData) fAdditionalTable.getTable().getLayoutData();
gd.heightHint = 150;
fAdditionalTable.getTable().setLayoutData(gd);

代码示例来源:origin: org.eclipse.pde.api.tools/ui

GridData gd = (GridData) table.getLayoutData();
gd.widthHint = 250;
table.addKeyListener(new KeyAdapter() {

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools.ui

GridData gd = (GridData) table.getLayoutData();
gd.widthHint = 250;
table.addKeyListener(KeyListener.keyReleasedAdapter(e -> {

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui

void updateViewer(String groupId, String artifactId, String version) {
 if(viewer.getControl().isDisposed()) {
  return;
 }
 archetypeVersions = getArchetypeVersions(archetypes);
 viewer.setInput(archetypes);
 if(isCurrentPage()) {
  selectArchetype(groupId, artifactId, version);
 }
 Table table = viewer.getTable();
 int columnCount = table.getColumnCount();
 int width = 0;
 for(int i = 0; i < columnCount; i++ ) {
  TableColumn column = table.getColumn(i);
  column.pack();
  width += column.getWidth();
 }
 GridData tableData = (GridData) table.getLayoutData();
 int oldHint = tableData.widthHint;
 if(width > oldHint) {
  tableData.widthHint = width;
 }
 getShell().pack(true);
 tableData.widthHint = oldHint;
}

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

@Override
protected Control createDialogArea(Composite parent) {
 Composite composite = (Composite) super.createDialogArea(parent);
 table = newTable(composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.FULL_SELECTION);
 ((GridData) table.getLayoutData()).heightHint = 100;
 table.setHeaderVisible(true);
 table.setLinesVisible(true);
 new TableColumn(table, SWT.NONE).setText("Feature Name");
 new TableColumn(table, SWT.NONE).setText("Input");
 new TableColumn(table, SWT.NONE).setText("Output");
 TableItem item = new TableItem(table, SWT.NONE);
 item.setText(0, CapabilitySection.ALL_FEATURES);
 TypeOrFeature tof = AbstractSection.getTypeOrFeature(capability.getInputs(), selectedType
     .getName());
 setChecked(item, 1, null == tof ? false : tof.isAllAnnotatorFeatures());
 tof = AbstractSection.getTypeOrFeature(capability.getOutputs(), selectedType.getName());
 setChecked(item, 2, null == tof ? false : tof.isAllAnnotatorFeatures());
 for (int i = 0; i < allFeatures.length; i++) {
  item = new TableItem(table, SWT.NONE);
  item.setText(0, allFeatures[i].getShortName());
  setChecked(item, 1, CapabilitySection.isInput(getTypeFeature(allFeatures[i]), capability));
  setChecked(item, 2, CapabilitySection.isOutput(getTypeFeature(allFeatures[i]), capability));
 }
 table.removeListener(SWT.Selection, this);
 table.addListener(SWT.MouseDown, this); // for i / o toggling
 section.packTable(table);
 newErrorMessage(composite);
 return composite;
}

相关文章

微信公众号

最新文章

更多

Table类方法