/** * @return */ private Item[] getViewerColumns() { if (targetControl instanceof Table) { return ((Table) targetControl).getColumns(); } else if (targetControl instanceof Tree) { return ((Tree) targetControl).getColumns(); } return new Item[0]; }
/** * {@inheritDoc} * * @since 3.5 */ @Override protected void setColumnWidths(Scrollable tree, int[] widths) { TreeColumn[] columns = ((Tree) tree).getColumns(); for (int i = 0; i < widths.length; i++) { columns[i].setWidth(widths[i]); } }
/** * @return */ private Item[] getViewerColumns() { if (targetControl instanceof Table) { return ((Table) targetControl).getColumns(); } else if (targetControl instanceof Tree) { return ((Tree) targetControl).getColumns(); } return new Item[0]; }
/** * @return */ private Item[] getViewerColumns() { if (targetControl instanceof Table) { return ((Table) targetControl).getColumns(); } else if (targetControl instanceof Tree) { return ((Tree) targetControl).getColumns(); } return new Item[0]; }
/** * Return the columns for the receiver. * * @param composite * @return Item[] */ private Item[] getColumns(Composite composite) { if (composite instanceof Tree) { return ((Tree) composite).getColumns(); } return ((Table) composite).getColumns(); } }
/** * {@inheritDoc} * * @since 3.5 */ @Override protected void setColumnWidths(Scrollable tree, int[] widths) { TreeColumn[] columns = ((Tree) tree).getColumns(); for (int i = 0; i < widths.length; i++) { columns[i].setWidth(widths[i]); } }
/** * {@inheritDoc} * * @since 1.3 */ protected void setColumnWidths(Scrollable tree, int[] widths) { TreeColumn[] columns = ((Tree) tree).getColumns(); for (int i = 0; i < widths.length; i++) { columns[i].setWidth(widths[i]); } }
/** * Return the names of all columns in the tree. Not visible columns names will also be included. * The order of the names will be same to the initial tree column order, thus not reflecting the * current state of the table if the columns were moved. * * @return List of column names. */ public List<String> getColumnNames() { List<String> names = new ArrayList<>(); for (TreeColumn column : treeViewer.getTree().getColumns()) { names.add(column.getText()); } return names; }
/** * */ private void resizeColumns() { for (TreeColumn column : treeViewer.getTree().getColumns()) { column.pack(); } }
/** * Persists column sizes in cache */ protected void persistColumnSizes() { Tree tree = getTree(); TreeColumn[] columns = tree.getColumns(); for (int i = 0; i < columns.length; i++) { TreeColumn treeColumn = columns[i]; Object id = treeColumn.getData(); fColumnSizes.put(id, Integer.valueOf(treeColumn.getWidth())); } }
@Override void setFontDescription (long /*int*/ font) { super.setFontDescription (font); TreeColumn[] columns = getColumns (); for (int i = 0; i < columns.length; i++) { if (columns[i] != null) { columns[i].setFontDescription (font); } } }
@Override void setFontDescription (int /*long*/ font) { super.setFontDescription (font); TreeColumn[] columns = getColumns (); for (int i = 0; i < columns.length; i++) { if (columns[i] != null) { columns[i].setFontDescription (font); } } }
public void saveState(IMemento memento) { TreeColumn[] tc = treeTable.getColumns(); for (int i = 0; i < 3; i++) { int width = tc[i].getWidth(); if (width != 0) memento.putInteger(TAG_COLUMN_WIDTH + i, width); } }
@Override void setFontDescription (int /*long*/ font) { super.setFontDescription (font); TreeColumn[] columns = getColumns (); for (int i = 0; i < columns.length; i++) { if (columns[i] != null) { columns[i].setFontDescription (font); } } }
/** Builds a {@link TreeViewer} on the given parent. */ public TreeViewer buildTree(Composite parent) { Tree control = Portal.buildTree(parent, style, linesVisible, headerVisible, columnBuilders); return buildViewer(new TreeViewer(control), Arrays.asList(control.getColumns()), TreeViewerColumn::new); }
void resetSortState (final Tree tree) { tree.setSortDirection (SWT.NONE); TreeColumn [] columns = tree.getColumns(); for (TreeColumn column : columns) { SelectionListener listener = (SelectionListener)column.getData("SortListener"); //$NON-NLS-1$ if (listener != null) column.removeSelectionListener(listener); } }
/** * @param visible */ void setVisibleFields(Collection<MarkerField> visible,int[] widths) { generator.setVisibleFields(visible); //viewer.setSelection(new StructuredSelection()); //viewer.removeAndClearAll(); createColumns(viewer.getTree().getColumns(), widths); scheduleUpdate(0L); }
public void controlResized(ControlEvent e) { Rectangle area = tree.getClientArea(); TreeColumn[] columns = tree.getColumns(); if (area.width > 0) { columns[0].setWidth(area.width * 40 / 100); columns[1].setWidth(area.width - columns[0].getWidth() - 4); tree.removeControlListener(this); } } });
@Override public void controlResized(ControlEvent e) { Rectangle area = tree.getClientArea(); TreeColumn[] columns = tree.getColumns(); if (area.width > 0) { columns[0].setWidth(area.width * 40 / 100); columns[1].setWidth(area.width - columns[0].getWidth() - 4); tree.removeControlListener(this); } } });
@Override public void controlResized(ControlEvent e) { Rectangle area = tree.getClientArea(); TreeColumn[] columns = tree.getColumns(); if (area.width > 0) { columns[0].setWidth(area.width * 40 / 100); columns[1].setWidth(area.width - columns[0].getWidth() - 4); tree.removeControlListener(this); } } });