示例#1
0
 @Execute
 public void execute(EPartService partService, @Named("partId") String partId) {
   MPart part = partService.findPart(partId);
   if (part == null) {
     partService.createPart(partId);
   }
   partService.activate(part);
 }
示例#2
0
  @PostConstruct
  public void postConstruct(Composite parent) {
    devicesGroupsView = partService.findPart("dec-rcp.part.devices.groups");
    devicesView = partService.findPart("dec-rcp.part.devices.list");
    sensorsView = partService.findPart("dec-rcp.part.devices.sensors");

    FilterMatcher matcher = new FilterMatcher();
    FilteredTable table =
        new FilteredTable(
            parent,
            SWT.SINGLE | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION,
            matcher,
            true);
    viewer = table.getViewer();
    viewer.setContentProvider(ArrayContentProvider.getInstance());
    viewer
        .getTable()
        .addSelectionListener(
            new SensorsViewerSelectionListener(
                viewer,
                devicesGroupsView,
                devicesView,
                sensorsView,
                partService,
                selectionService,
                context));

    TableViewerColumn idColumnViewer = new TableViewerColumn(viewer, SWT.NONE);
    idColumnViewer.getColumn().setWidth(50);
    idColumnViewer.getColumn().setText("#");
    idColumnViewer.setLabelProvider(new IDColumnLabelProvider(viewer));

    TableViewerColumn deviceGroupsNameColumnViewer = new TableViewerColumn(viewer, SWT.NONE);
    deviceGroupsNameColumnViewer.getColumn().setWidth(800);
    deviceGroupsNameColumnViewer.getColumn().setText("Sensor Name");
    deviceGroupsNameColumnViewer.setLabelProvider(new NameColumnLabelProvider(viewer));
    viewer.getTable().setHeaderVisible(true);
  }