public void run() { Control ctrl= fViewer.getControl(); if (ctrl != null && !ctrl.isDisposed()) fViewer.refresh(root, updateLabels); } });
public ISelection getSelection() { if (fViewerInFocus != null) { return fViewerInFocus.getSelection(); } return StructuredSelection.EMPTY; }
public void run() { if (fAnnotationTypeViewer != null && !fAnnotationTypeViewer.getControl().isDisposed()) { fAnnotationTypeViewer.setSelection(new StructuredSelection(fListModel[0])); initializeFields(); } } });
void setSelection(ISelection selection, boolean reveal) { if (selection != null && selection.equals(fViewer.getSelection())) return; fProcessSelectionEvents= false; fViewer.setSelection(selection, reveal); fProcessSelectionEvents= true; }
private void applyMinimumSize() { if (fMinSize != null) { GridData gd = (GridData) fViewer.getControl().getLayoutData(); gd.widthHint = fMinSize.x; gd.heightHint = fMinSize.y; } }
@Override public void initialize() { fAnnotationTypeViewer.setInput(fListModel); fAnnotationTypeViewer.getControl().getDisplay().asyncExec(new Runnable() { @Override public void run() { if (fAnnotationTypeViewer != null && !fAnnotationTypeViewer.getControl().isDisposed()) { fAnnotationTypeViewer.setSelection(new StructuredSelection(fListModel[0])); } } }); }
@SuppressWarnings("unchecked") public static <T> void multiSelectionList(StructuredViewer viewer, RxBox<ImmutableList<T>> box) { Preconditions.checkArgument(SwtMisc.flagIsSet(SWT.MULTI, viewer.getControl()), "Control style does not have SWT.MULTI set."); // set the box when the selection changes viewer.addSelectionChangedListener(event -> { IStructuredSelection selection = (IStructuredSelection) event.getSelection(); box.set(ImmutableList.copyOf(selection.toList())); }); // set the selection when the box changes SwtExec.immediate().guardOn(viewer.getControl()).subscribe(box, list -> { viewer.setSelection(new StructuredSelection(list)); }); }
public void setSortOrder(int sortOrder) { fCurrentSortOrder= sortOrder; DecoratingFileSearchLabelProvider lpWrapper= (DecoratingFileSearchLabelProvider)getViewer().getLabelProvider(); ((FileLabelProvider)lpWrapper.getStyledStringProvider()).setOrder(sortOrder); getViewer().refresh(); getSettings().put(KEY_SORTING, fCurrentSortOrder); }
@Override protected StructuredViewer createViewer(Composite parent) { Table table = new Table(parent, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); fViewer = new TableViewer(table); fViewer.setContentProvider(fContentProvider); final DependenciesLabelProvider labelProvider = new DependenciesLabelProvider(false); fViewer.setLabelProvider(labelProvider); fViewer.getControl().addDisposeListener(e -> labelProvider.dispose()); return fViewer; }
public void widgetSelected(SelectionEvent e) { ListItem item= getSelectedItem(); fStore.setValue(item.verticalRulerKey, fShowInVerticalRulerCheckBox.getSelection()); fAnnotationTypeViewer.refresh(item); } });
public ISelection getSelection() { StructuredViewer viewer = installedIUGroup.getStructuredViewer(); ISelection selection = viewer.getSelection(); if (selection.isEmpty()) { final Object[] all = ((IStructuredContentProvider) viewer.getContentProvider()).getElements(viewer.getInput()); return new StructuredSelection(all); } return selection; }
@Override public void run() { Control ctrl= fViewer.getControl(); if (ctrl != null && !ctrl.isDisposed()) fViewer.update(element, new String[]{IBasicPropertyConstants.P_IMAGE}); } });
public void createVersionSelectionField(Composite comp, String id) { Group group = new Group(comp, SWT.NONE); group.setText(PDEUIMessages.PluginVersionPart_groupTitle); group.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL)); group.setLayout(new GridLayout(2, false)); PluginVersionTablePart part = new PluginVersionTablePart(new String[] {PDEUIMessages.PluginVersionPart_buttonTitle}); part.createControl(group, SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL, 1, null); part.setMinimumSize(0, 75); part.getViewer().setLabelProvider(PDEPlugin.getDefault().getLabelProvider()); part.getViewer().setContentProvider(new PluginVersionContentProvider()); part.getViewer().setComparator(new ViewerComparator()); part.getViewer().setInput(PluginRegistry.findEntry(id)); part.setButtonEnabled(0, false); }
public void setSelection(ISelection selection, boolean reveal) { if (fViewerInFocus != null) { fViewerInFocus.setSelection(selection, reveal); } }
/** * The list viewer implementation of this <code>Viewer</code> framework * method returns the label provider, which in the case of list * viewers will be an instance of <code>ILabelProvider</code>. */ public IBaseLabelProvider getLabelProvider() { return super.getLabelProvider(); }
public synchronized Saveable[] getActiveSaveables() { ITreeContentProvider contentProvider = (ITreeContentProvider) viewer .getContentProvider(); IStructuredSelection selection = (IStructuredSelection) viewer .getSelection(); if (selection instanceof ITreeSelection) { return getActiveSaveablesFromTreeSelection((ITreeSelection) selection); } else if (contentProvider instanceof ITreePathContentProvider) { return getActiveSaveablesFromTreePathProvider(selection, (ITreePathContentProvider) contentProvider); } else { return getActiveSaveablesFromTreeProvider(selection, contentProvider); } }
@Override public Object getViewPartInput() { if (fViewer != null) { return fViewer.getInput(); } return null; }
public void initialize() { super.initialize(); fListViewer.setInput(fListModel); fListViewer.setSelection(new StructuredSelection(fJavaCategory)); }
/** * Invoked once when the action bars are set. * @param actionBars the action bars */ protected void fillActionBars(IActionBars actionBars) { getActionGroup().fillActionBars(actionBars); updateActionBars((IStructuredSelection) getViewer().getSelection()); Object input = getViewer().getInput(); if (input instanceof ISynchronizeModelElement) { getActionGroup().modelChanged((ISynchronizeModelElement) input); } }