Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.ColumnLabelProvider


    return viewer.getControl();
  }

  private void createColumns(Composite parent, final TableViewer viewer) {
    TableViewerColumn col = createTableViewerColumn(viewer, "c1", 200);
    col.setLabelProvider(new ColumnLabelProvider() {
      @Override
      public String getText(Object element) {
        ExtraParams p = (ExtraParams) element;
        return p.name;
      }
    });

    col = createTableViewerColumn(viewer, "c2", 300);
    col.setEditingSupport(new ParamEditingSupport(viewer));
    col.setLabelProvider(new ColumnLabelProvider() {
      @Override
      public String getText(Object element) {
        ExtraParams p = (ExtraParams) element;
        if(p.getCellEditor() == null) {
          p.setCellEditor(p.createCellEditor(viewer.getTable()));
View Full Code Here


        int[] bounds = {200, 100};
        String[] titles = {"name", "path"};

        TableViewerColumn col = createTableViewerColumn(titles[0], bounds[0], 0);
        col.setLabelProvider(new ColumnLabelProvider(){
            public Image getImage( Object element ) {
                return null;
            }

            public String getText( Object element ) {
                if (element instanceof String) {
                    String path = (String) element;
                    File file = new File(path);
                    return file.getName();
                }
                return null;
            }
        });

        col = createTableViewerColumn(titles[1], bounds[1], 1);
        col.setLabelProvider(new ColumnLabelProvider(){
            public Image getImage( Object element ) {
                return null;
            }
            public String getText( Object element ) {
                if (element instanceof String) {
View Full Code Here

    TableViewerColumn tblclmnVwrPath = new TableViewerColumn(tblVwrDirectoryPaths, SWT.NONE);
    TableColumn tblclmnPath = tblclmnVwrPath.getColumn();
    tblclmnPath.setWidth(290);
    tblclmnPath.setResizable(true);
    tblclmnPath.setText(directories);
    tblclmnVwrPath.setLabelProvider(new ColumnLabelProvider() {
      @Override public String getText(Object element) {
        return element.toString();
      }
    });
View Full Code Here

                tableColumn
                        .setToolTipText(Messages
                                .getString("encounter.builder.ui.editor.encounter.participants.table.column.selection.tooltip"));
                tableColumn.setResizable(false);
                tableColumn.setMoveable(false);
                viewerColumn.setLabelProvider(new ColumnLabelProvider() {
                    @Override
                    public Image getImage(Object element) {
                        return null;
                    }

                    @Override
                    public String getText(Object element) {
                        if(element instanceof EncounterParticipant) {
                            return ((EncounterParticipant)element).getLabel();
                        }

                        return null;
                    }
                });
                participantsColLayout.setColumnData(tableColumn, new ColumnWeightData(100));

                table.setHeaderVisible(false);
                table.setLinesVisible(true);

                participantsViewer.setContentProvider(new EncounterBuilderParticipantsViewerContentProvider(this));

                participantsViewer.setInput(this);

                // setup drop target
                Transfer[] types = new Transfer[] { LocalSelectionTransfer.getTransfer() };
                DropTarget target = new DropTarget(table, DND.DROP_COPY);
                target.setTransfer(types);
                target.addDropListener(new DropTargetAdapter() {
                    @Override
                    public void dragEnter(DropTargetEvent event) {
                        logger.debug("drag enter: " + event);
                        event.operations = DND.DROP_COPY;
                        event.feedback = DND.FEEDBACK_INSERT_BEFORE;
                    };

                    @Override
                    public void drop(DropTargetEvent event) {
                        logger.debug("drop: " + event);
                        // A drop has occurred, copy over the data
                        // if(event.data == null) { // no data to copy, indicate failure in event.detail
                        // event.detail = DND.DROP_NONE;
                        // return;
                        // }
                        // label.setText ((String) event.data); // data copied to label text
                    }
                });
            }
        }

        // selection list
        Group selectionGroup = new Group(comp, SWT.NONE);
        selectionGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
        selectionGroup.setLayout(new GridLayout(2, true));
        selectionGroup.setText(Messages.getString("encounter.builder.ui.editor.encounter.selection.group.label"));
        {
            // toolbar
            selectionTools = new ToolBar(selectionGroup, SWT.FLAT);
            selectionTools.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
            selectionToolsManager = new ToolBarManager(selectionTools);

            // selection search box
            selectionSearchText = new Text(selectionGroup, SWT.SINGLE | SWT.BORDER | SWT.SEARCH | SWT.CANCEL);
            selectionSearchText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
            selectionSearchText.addModifyListener(new ModifyListener() {
                public void modifyText(ModifyEvent event) {
                    selectableSearchValue = ((Text)event.widget).getText();

                    selectionViewer.refresh();
                }
            });

            // viewer
            Composite viewerComp = new Composite(selectionGroup, SWT.NONE);
            viewerComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
            TableColumnLayout selectionColLayout = new TableColumnLayout();
            viewerComp.setLayout(selectionColLayout);

            TableViewerColumn viewerColumn;
            TableColumn tableColumn;
            EditingSupport editSupport;

            selectionViewer = new TableViewer(viewerComp, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
            selectionProvider.addSelectionProvider(selectionViewer);

            final Table table = selectionViewer.getTable();

            viewerColumn = new TableViewerColumn(selectionViewer, SWT.LEFT);
            tableColumn = viewerColumn.getColumn();
            tableColumn.setText("");
            tableColumn.setToolTipText(Messages
                    .getString("encounter.builder.ui.editor.encounter.selection.table.column.selection.tooltip"));
            tableColumn.setResizable(false);
            tableColumn.setMoveable(false);
            viewerColumn.setLabelProvider(new ColumnLabelProvider() {
                @Override
                public Image getImage(Object element) {
                    // TODO: check if the template has an icon

                    return DomainObjectImageMapper.getImage(element.getClass());
View Full Code Here

        tableColumn.setText("");
        tableColumn.setToolTipText(Messages.getString("encounter.tracker.view.table.column.marker.tooltip"));
        tableColumn.setResizable(false);
        tableColumn.setMoveable(false);
        tableColumn.setWidth(25);
        viewerColumn.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public Image getImage(Object element) {
                if(element instanceof EncounterParticipant) {
                    logger.debug("element is an encounter participant");

                    EncounterParticipant current = getCurrentParticipant();
                    if(current == element) {
                        return markerImage;
                    }
                }

                return null;
            }

            @Override
            public String getText(Object element) {
                return null;
            }
        });
        // colLayout.setColumnData(col, new ColumnWeightData(10, 35, true));

        viewerColumn = new TableViewerColumn(viewer, SWT.LEFT);
        tableColumn = viewerColumn.getColumn();
        tableColumn.setText(Messages.getString("encounter.tracker.view.table.column.order.label"));
        tableColumn.setToolTipText(Messages.getString("encounter.tracker.view.table.column.order.tooltip"));
        tableColumn.setResizable(true);
        tableColumn.setMoveable(false);
        tableColumn.setWidth(45);
        viewerColumn.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(Object element) {
                if(element instanceof EncounterParticipant) {
                    return String.valueOf(((EncounterParticipant)element).getOrder());
                }

                return null;
            }
        });
        colLayout.setColumnData(tableColumn, new ColumnWeightData(10, 45, true));
        editSupport = new EncounterTrackerEditingSupport(viewer) {
            @Override
            protected Object getValue(Object element) {
                logger.debug("get value for editor: " + element);

                if(element instanceof EncounterParticipant) {
                    return String.valueOf(((EncounterParticipant)element).getOrder());
                }

                return null;
            }

            @Override
            protected void setValue(Object element, Object value) {
                logger.debug("set value from editor: " + element + "; value: " + value);

                if(element instanceof EncounterParticipant) {
                    if(value instanceof Integer) {
                        logger.debug("setting encounter participant value as integer");
                        ((EncounterParticipant)element).setOrder((Integer)value);
                    }
                    else {
                        try {
                            logger.debug("setting encounter participant value as parsed integer from string");
                            ((EncounterParticipant)element).setOrder(Integer.parseInt((String)value));
                        }
                        catch(NumberFormatException e) {
                            logger.debug("Exception while parsing integer: " + e.getLocalizedMessage(), e);
                            // ignore
                        }
                    }

                    if(autoSort) {
                        sort(sortAscending);
                    }
                    else {
                        viewer.update(element, null);
                    }
                }
            }

        };
        viewerColumn.setEditingSupport(editSupport);

        viewerColumn = new TableViewerColumn(viewer, SWT.LEFT);
        tableColumn = viewerColumn.getColumn();
        tableColumn.setText(Messages.getString("encounter.tracker.view.table.column.name.label"));
        tableColumn.setToolTipText(Messages.getString("encounter.tracker.view.table.column.name.tooltip"));
        tableColumn.setResizable(true);
        tableColumn.setMoveable(false);
        tableColumn.setWidth(200);
        viewerColumn.setLabelProvider(new EncounterTrackerViewParticipantLabelProvider(this));
        colLayout.setColumnData(tableColumn, new ColumnWeightData(35, 200, true));
        editSupport = new EncounterTrackerEditingSupport(viewer) {
            @Override
            protected boolean canEdit(Object element) {
                logger.debug("can edit? " + element);

                return (element instanceof EncounterParticipant);
            }

            @Override
            protected Object getValue(Object element) {
                logger.debug("get value for editor: " + element);

                if(element instanceof EncounterParticipant) {
                    logger.debug("getting label from encounter participant");
                    return ((EncounterParticipant)element).getLabel();
                }

                return "";
            }

            @Override
            protected void setValue(Object element, Object value) {
                logger.debug("set value from editor: " + element + "; value: " + value);

                if(element instanceof EncounterParticipant) {
                    logger.debug("setting value on encounter participant");

                    // set the label, no matter what
                    ((EncounterParticipant)element).setLabel(value.toString());

                    // lookup name in instance list and if there's a match, assign that object
                    if(selectedCampaign != null) {
                        logger.debug("get instance from campaign: " + selectedCampaign);

                        // get instance list
                        Set<ObjectInstance> instances = selectedCampaign.getObjectInstances();
                        logger.trace("instances: " + instances);

                        for(ObjectInstance instance : instances) {
                            logger.trace("instance: " + instance);

                            String label = instance.getLabel();
                            logger.trace("label: " + label);

                            if(StringUtils.stripToEmpty(label).equalsIgnoreCase(
                                    StringUtils.stripToEmpty(value.toString()))) {
                                logger.debug("instance label matches input string");
                                ((EncounterParticipant)element).setParticipant(instance);
                                break;
                            }
                        }
                    }
                }

                logger.debug("update viewer element: " + element);
                viewer.update(element, null);
            }

            // @Override
            // protected CellEditor getCellEditor(Object element) {
            // ComboBoxCellEditor editor = new ComboBoxCellEditor();
            // editor.setStyle(SWT.DROP_DOWN);
            // editor.set
            //
            // return editor;
            // }

        };
        viewerColumn.setEditingSupport(editSupport);

        // viewerColumn = new TableViewerColumn(viewer, SWT.LEFT);
        // tableColumn = viewerColumn.getColumn();
        // tableColumn.setText(Messages.getString("encounter.tracker.view.table.column.status.label"));
        // tableColumn.setToolTipText(Messages.getString("encounter.tracker.view.table.column.status.tooltip"));
        // tableColumn.setResizable(true);
        // tableColumn.setMoveable(false);
        // tableColumn.setWidth(100);
        // viewerColumn.setLabelProvider(columnLabelProvider);
        // colLayout.setColumnData(tableColumn, new ColumnWeightData(15, 100, true));

        viewerColumn = new TableViewerColumn(viewer, SWT.LEFT);
        tableColumn = viewerColumn.getColumn();
        tableColumn.setText(Messages.getString("encounter.tracker.view.table.column.target.label"));
        tableColumn.setToolTipText(Messages.getString("encounter.tracker.view.table.column.target.tooltip"));
        tableColumn.setResizable(true);
        tableColumn.setMoveable(false);
        tableColumn.setWidth(100);
        viewerColumn.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public Font getFont(Object element) {
                if(element instanceof EncounterParticipant) {
                    Object obj = ((EncounterParticipant)element).getParticipant();
                    logger.trace("obj: " + obj);

                    if(obj == null) {
                        // bold the font if there is an associated object
                        return JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT);
                    }
                }

                return null;
            }

            /*
             * (non-Javadoc)
             *
             * @see org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object)
             */
            @Override
            public String getText(Object element) {
                if(element instanceof EncounterParticipant) {
                    Object target = ((EncounterParticipant)element).getTarget();
                    logger.trace("target: " + target);

                    if(target instanceof EncounterParticipant) {
                        logger.debug("target is an encounter participant");
                        return ((EncounterParticipant)target).getLabel();
                    }
                    else if(target instanceof String) {
                        return (String)target;
                    }
                }

                return null;
            }

        });
        colLayout.setColumnData(tableColumn, new ColumnWeightData(20, 50, true));
        editSupport = new EncounterTrackerEditingSupport(viewer) {
            @Override
            protected Object getValue(Object element) {
                logger.debug("get value for editor: " + element);

                if(element instanceof EncounterParticipant) {
                    Object obj = ((EncounterParticipant)element).getTarget();
                    logger.trace("obj: " + obj);

                    if(obj instanceof String) {
                        return obj;
                    }
                    else if(obj instanceof EncounterParticipant) {
                        return ((EncounterParticipant)obj).getLabel();
                    }
                }

                return null;
            }

            @Override
            protected void setValue(Object element, Object value) {
                logger.debug("set value from editor: " + element + "; value: " + value);

                if(element instanceof EncounterParticipant) {
                    logger.debug("setting value on encounter target");

                    Object target = null;

                    // check if the input name matches an encounter participant name
                    for(EncounterParticipant ep : participants) {
                        logger.trace("ep: " + ep);

                        if(ep.getLabel().equalsIgnoreCase(StringUtils.stripToEmpty(value.toString()))) {
                            logger.debug("input value matches encounter participant, setting target: " + ep);
                            target = ep;
                            break;
                        }
                    }

                    if(target == null) {
                        logger.debug("no target set; convert to string");
                        target = value.toString();
                    }

                    logger.debug("setting target value: " + target);
                    ((EncounterParticipant)element).setTarget(target);
                }

                viewer.update(element, null);
            }

            // @Override
            // protected CellEditor getCellEditor(Object element) {
            // CellEditor editor = new ComboBoxViewerCellEditor() {};
            // editor.setStyle(SWT.DROP_DOWN);
            // return editor;
            // }
        };
        viewerColumn.setEditingSupport(editSupport);

        viewerColumn = new TableViewerColumn(viewer, SWT.LEFT);
        tableColumn = viewerColumn.getColumn();
        tableColumn.setText(Messages.getString("encounter.tracker.view.table.column.notes.label"));
        tableColumn.setToolTipText(Messages.getString("encounter.tracker.view.table.column.notes.tooltip"));
        tableColumn.setResizable(true);
        tableColumn.setMoveable(false);
        tableColumn.setWidth(350);
        viewerColumn.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(Object element) {
                if(element instanceof EncounterParticipant) {
                    return ((EncounterParticipant)element).getNotes();
                }
View Full Code Here

    table.setLinesVisible(true);
    table.setHeaderVisible(true);
   
       
        TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
        tableViewerColumn.setLabelProvider(new ColumnLabelProvider(){
          @Override
          public String getText(Object element) {
            ClassProperty cp = (ClassProperty)element;
            return cp.name;
          }
        });
        TableColumn tblclmnName = tableViewerColumn.getColumn();
        tblclmnName.setResizable(false);
        tblclmnName.setWidth(120);
        tblclmnName.setText("Name");
       
        TableViewerColumn tableViewerColumn_1 = new TableViewerColumn(tableViewer, SWT.NONE);
        tableViewerColumn_1.setLabelProvider(new ColumnLabelProvider(){
          @Override
          public String getText(Object element) {
            return null;
          }

          @Override
          public Image getImage(Object element) {
            if (((ClassProperty) element).allow) {
              return CHECKED;
            } else {
              return UNCHECKED;
            }
          }
        });
        TableColumn tblclmnAllow = tableViewerColumn_1.getColumn();
        tblclmnAllow.setResizable(false);
        tblclmnAllow.setWidth(50);
        tblclmnAllow.setText("Allow");
       
        TableViewerColumn tableViewerColumn_2 = new TableViewerColumn(tableViewer, SWT.NONE);
        tableViewerColumn_2.setLabelProvider(new ColumnLabelProvider(){
          @Override
          public String getText(Object element) {
            return null;
          }

          @Override
          public Image getImage(Object element) {
            if (((ClassProperty) element).override) {
              return CHECKED;
            } else {
              return UNCHECKED;
            }
          }
        });
        TableColumn tblclmnOverride = tableViewerColumn_2.getColumn();
        tblclmnOverride.setResizable(false);
        tblclmnOverride.setWidth(50);
        tblclmnOverride.setText("Override");
       
        TableViewerColumn tableViewerColumn_3 = new TableViewerColumn(tableViewer, SWT.NONE);
        tableViewerColumn_3.setLabelProvider(new ColumnLabelProvider(){
          @Override
          public String getText(Object element) {
            return null;
          }
View Full Code Here

        final String logicOperandColumnTitle = "Logic operand";
        final int logicOperandColumnWidth = 100;
        TableViewerColumn logicOperandColumn = createSingleColumn(tableViewer,
                logicOperandColumnTitle,
                logicOperandColumnWidth);
        logicOperandColumn.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(final Object element) {
                FilterItemModel filterItemModel = (FilterItemModel) element;
                FilterItemModel firstItem = (FilterItemModel) tableViewer.getElementAt(0);

                String logicOperand = "";

                if (!filterItemModel.equals(firstItem)) {
                    logicOperand = filterItemModel.getLogicOperand().getValue();
                    logger.debug("Filter's rule logic operand: {}", logicOperand);
                }
                return logicOperand;
            }
        });

        logicOperandColumn.setEditingSupport(new RulesLogicCellEditor(tableViewer));

        // 'Field type' filter's rule column
        final String fieldTypeColumnTitle = "Field type";
        final int fieldTypeColumnWidth = 85;
        TableViewerColumn fieldTypeColumn = createSingleColumn(tableViewer,
                fieldTypeColumnTitle,
                fieldTypeColumnWidth);
        fieldTypeColumn.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(final Object element) {
                FilterItemModel filterItemModel = (FilterItemModel) element;
                String fieldType = filterItemModel.getFieldType().getValue();
                logger.debug("Filter's rule field type: {}", fieldType);
                return fieldType;
            }
        });
        fieldTypeColumn.setEditingSupport(new RulesFieldTypeCellEditor(tableViewer));

        // 'Include' filter's rule column
        final String includeColumnTitle = "Include";
        final int includeColumnWidth = 60;
        TableViewerColumn includeColumn = createSingleColumn(tableViewer, includeColumnTitle,
                includeColumnWidth);
        includeColumn.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(final Object element) {
                FilterItemModel filterItemModel = (FilterItemModel) element;
                String filterItemInclude = FilterConstants.EXCLUDE;

                if (filterItemModel.isInclude()) {
                    filterItemInclude = FilterConstants.INCLUDE;
                }
                logger.debug("Filter's rule include: {}", filterItemInclude);
                return filterItemInclude;
            }

        });
        includeColumn.setEditingSupport(new RulesIncludeCellEditor(tableViewer));

        // 'Match pattern' filter's rule column
        final String patternColumnTitle = "Match pattern";
        final int patternColumnWidth = 250;
        TableViewerColumn matchPatternColumn = createSingleColumn(tableViewer,
                patternColumnTitle,
                patternColumnWidth);
        matchPatternColumn.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(final Object element) {
                FilterItemModel filterItemModel = (FilterItemModel) element;
                String matchPattern = filterItemModel.getPattern();
                logger.debug("Filter's rule match pattern: {}", matchPattern);
                return matchPattern;
            }
        });
        matchPatternColumn.setEditingSupport(new RulesMatchPatternCellEditor(tableViewer));

        final String enableColumnTitle = "Enable";
        final int enableColumnWidth = 40;
        TableViewerColumn enableColumn = createSingleColumn(tableViewer, enableColumnTitle,
                enableColumnWidth);
        enableColumn.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(final Object element) {
                return null;
            }
View Full Code Here

    private void createColumns(final TableViewer tableViewer) {
        // Level name
        final String columnLevelTitle = "Level";
        final int columnLevelSize = 70;
        TableViewerColumn column = createSingleColumn(tableViewer, columnLevelTitle, columnLevelSize);
        column.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(final Object element) {
                if (LogDisplayPreferences.getLogColorSettings().isLevelImageInsteadOfText()) {
                    return null;
                } else {
                    LogLevelDisplayModel levelDisplayModel = (LogLevelDisplayModel) element;
                    return levelDisplayModel.getLevelName();
                }
            }

            @Override
            public Image getImage(final Object element) {
                if (LogDisplayPreferences.getLogColorSettings().isLevelImageInsteadOfText()) {
                    LogLevelDisplayModel levelDisplayModel = (LogLevelDisplayModel) element;
                    return levelDisplayModel.getImage();
                } else {
                    return null;
                }
            }
        });

        // Log foreground
        final String columnForegroundTitle = "Foreground";
        final int columnForegroundSize = 200;
        column = createSingleColumn(tableViewer, columnForegroundTitle, columnForegroundSize);
        column.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(final Object element) {
                return "The quick brown fox jumps over the lazy dog";
            }

            @Override
            public Color getForeground(final Object element) {
                LogLevelDisplayModel levelDisplayModel = (LogLevelDisplayModel) element;
                Color color = new Color(Display.getCurrent(), levelDisplayModel.getForeground());
                return color;
            }
        });
        column.setEditingSupport(new LogForegroundCellEditor(tableViewer));

        // Log background
        final String columnBackgroundTitle = "Background";
        final int columnBackgroundSize = 200;
        column = createSingleColumn(tableViewer, columnBackgroundTitle, columnBackgroundSize);
        column.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(final Object element) {
                return "The quick brown fox jumps over the lazy dog";
            }
View Full Code Here

    protected void createColumns() {
        final String nameColumnTitle = "Name";
        final int nameColumnWidth = 100;
        TableViewerColumn nameColumn = createSingleColumn(tableViewer, nameColumnTitle,
                nameColumnWidth);
        nameColumn.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(final Object element) {
                FilterModel filterModel = (FilterModel) element;
                String filterName = filterModel.getFilterName();
                logger.debug("New filter name: {}", filterName);
                return filterName;
            }
        });
        nameColumn.setEditingSupport(new FilterNameCellEditor(tableViewer));

        final String descriptionColumnTitle = "Description";
        final int descriptionColumnWidth = 300;
        TableViewerColumn desriptionColumn = createSingleColumn(tableViewer,
                descriptionColumnTitle,
                descriptionColumnWidth);
        desriptionColumn.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(final Object element) {
                FilterModel filterModel = (FilterModel) element;
                String filterDescription = filterModel.getFilterDescr();
                logger.debug("Filter description: {}", filterDescription);
                return filterDescription;
            }
        });
        desriptionColumn.setEditingSupport(new FilterDescriptionCellEditor(tableViewer));

        final String enableColumnTitle = "Enable";
        final int enableColumnWidth = 50;
        TableViewerColumn enableColumn = createSingleColumn(tableViewer, enableColumnTitle,
                enableColumnWidth);
        enableColumn.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(final Object element) {
                return null;
            }
        });
View Full Code Here

    protected void createColumns() {
        // '!' (error image) column
        final String errorImageColumnTitle = "!";
        final int errorImageColumnWidth = 30;
        TableViewerColumn column = createSingleColumn(tableViewer, errorImageColumnTitle, errorImageColumnWidth);
        column.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(final Object element) {
                return null;
            }

            @Override
            public Image getImage(final Object element) {
                return ERROR_IMAGE;
            }
        });

        // 'Error's description' column
        final String errorDescriptionColumnTitle = "Error's description";
        final int errorDescriptionColumnWidth = 100;
        column = createSingleColumn(tableViewer, errorDescriptionColumnTitle, errorDescriptionColumnWidth);
        column.setLabelProvider(new ColumnLabelProvider() {
            @Override
            public String getText(final Object element) {
                String error = (String) element;
                return error;
            }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.ColumnLabelProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.