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

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

本文整理了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

  1. @Override
  2. protected Control createDialogArea(Composite parent) {
  3. Composite mainArea = (Composite)super.createDialogArea(parent);
  4. createWideLabel(mainArea, "Type Name:");
  5. typeNameUI = newText(mainArea, SWT.SINGLE, "Specify the type name");
  6. typeNameUI.addListener(SWT.Modify, this);
  7. createWideLabel(mainArea, "Matching Types:");
  8. matchingTypesUI = newTable(mainArea, SWT.SINGLE);
  9. ((GridData)matchingTypesUI.getLayoutData()).heightHint = 250;
  10. ((GridData)matchingTypesUI.getLayoutData()).minimumHeight = 100;
  11. typeNameUI.addListener(SWT.Selection, this);
  12. createWideLabel(mainArea, "NameSpaces:");
  13. nameSpacesUI = newTable(mainArea, SWT.SINGLE);
  14. ((GridData)nameSpacesUI.getLayoutData()).heightHint = 75;
  15. ((GridData)nameSpacesUI.getLayoutData()).minimumHeight = 40;
  16. displayFilteredTypes("");
  17. return mainArea;
  18. }

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

  1. private void resizeProposalSelector(boolean adjustWidth) {
  2. int width= adjustWidth ? SWT.DEFAULT : ((GridData)fProposalTable.getLayoutData()).widthHint;
  3. Point size= fProposalTable.computeSize(width, SWT.DEFAULT, true);
  4. GridData data= new GridData(GridData.FILL_BOTH);
  5. data.widthHint= adjustWidth ? Math.min(size.x, 300) : width;
  6. data.heightHint= Math.min(getTableHeightHint(fProposalTable, fProposalTable.getItemCount()), getTableHeightHint(fProposalTable, 10));
  7. fProposalTable.setLayoutData(data);
  8. fProposalShell.layout(true);
  9. fProposalShell.pack();
  10. if (adjustWidth) {
  11. fProposalShell.setLocation(getLocation());
  12. }
  13. }

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

  1. private void resizeProposalSelector(boolean adjustWidth) {
  2. int width= adjustWidth ? SWT.DEFAULT : ((GridData)fProposalTable.getLayoutData()).widthHint;
  3. Point size= fProposalTable.computeSize(width, SWT.DEFAULT, true);
  4. GridData data= new GridData(GridData.FILL_BOTH);
  5. data.widthHint= adjustWidth ? Math.min(size.x, 300) : width;
  6. data.heightHint= Math.min(getTableHeightHint(fProposalTable, fProposalTable.getItemCount()), getTableHeightHint(fProposalTable, 10));
  7. fProposalTable.setLayoutData(data);
  8. fProposalShell.layout(true);
  9. fProposalShell.pack();
  10. if (adjustWidth) {
  11. fProposalShell.setLocation(getLocation());
  12. }
  13. }

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

  1. private void setHistoryTableVisible(boolean isVisible) {
  2. GridData layoutData = (GridData) historyTable.getTable().getLayoutData();
  3. historyTable.getTable().setVisible(isVisible);
  4. boolean wasVisible = !layoutData.exclude;
  5. layoutData.exclude = !isVisible;
  6. if (wasVisible != isVisible || isVisible) {
  7. getShell().pack();
  8. }
  9. initializeBounds();
  10. }

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

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

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

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

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

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

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

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

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

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

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

  1. void updateViewer(String groupId, String artifactId, String version) {
  2. if(viewer.getControl().isDisposed()) {
  3. return;
  4. }
  5. archetypeVersions = getArchetypeVersions(archetypes);
  6. viewer.setInput(archetypes);
  7. if(isCurrentPage()) {
  8. selectArchetype(groupId, artifactId, version);
  9. }
  10. Table table = viewer.getTable();
  11. int columnCount = table.getColumnCount();
  12. int width = 0;
  13. for(int i = 0; i < columnCount; i++ ) {
  14. TableColumn column = table.getColumn(i);
  15. column.pack();
  16. width += column.getWidth();
  17. }
  18. GridData tableData = (GridData) table.getLayoutData();
  19. int oldHint = tableData.widthHint;
  20. if(width > oldHint) {
  21. tableData.widthHint = width;
  22. }
  23. getShell().pack(true);
  24. tableData.widthHint = oldHint;
  25. }

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

  1. @Override
  2. protected Control createDialogArea(Composite parent) {
  3. Composite composite = (Composite) super.createDialogArea(parent);
  4. table = newTable(composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.FULL_SELECTION);
  5. ((GridData) table.getLayoutData()).heightHint = 100;
  6. table.setHeaderVisible(true);
  7. table.setLinesVisible(true);
  8. new TableColumn(table, SWT.NONE).setText("Feature Name");
  9. new TableColumn(table, SWT.NONE).setText("Input");
  10. new TableColumn(table, SWT.NONE).setText("Output");
  11. TableItem item = new TableItem(table, SWT.NONE);
  12. item.setText(0, CapabilitySection.ALL_FEATURES);
  13. TypeOrFeature tof = AbstractSection.getTypeOrFeature(capability.getInputs(), selectedType
  14. .getName());
  15. setChecked(item, 1, null == tof ? false : tof.isAllAnnotatorFeatures());
  16. tof = AbstractSection.getTypeOrFeature(capability.getOutputs(), selectedType.getName());
  17. setChecked(item, 2, null == tof ? false : tof.isAllAnnotatorFeatures());
  18. for (int i = 0; i < allFeatures.length; i++) {
  19. item = new TableItem(table, SWT.NONE);
  20. item.setText(0, allFeatures[i].getShortName());
  21. setChecked(item, 1, CapabilitySection.isInput(getTypeFeature(allFeatures[i]), capability));
  22. setChecked(item, 2, CapabilitySection.isOutput(getTypeFeature(allFeatures[i]), capability));
  23. }
  24. table.removeListener(SWT.Selection, this);
  25. table.addListener(SWT.MouseDown, this); // for i / o toggling
  26. section.packTable(table);
  27. newErrorMessage(composite);
  28. return composite;
  29. }

相关文章

Table类方法