Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.ITableLabelProvider


            public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {

            }

        });
        tableViewer.setLabelProvider(new ITableLabelProvider() {

            public Image getColumnImage(Object element, int columnIndex) {
                // TODO Auto-generated method stub
                return null;
            }
View Full Code Here


      }
    });
    cloudUrls = CloudUiUtil.getAllUrls(serverTypeId);
    viewer.setInput(cloudUrls.toArray());

    viewer.setLabelProvider(new ITableLabelProvider() {

      public void removeListener(ILabelProviderListener listener) {
      }

      public boolean isLabelProperty(Object element, String property) {
View Full Code Here

      if (columnNumber == BindingLabelProvider.COLUMN_USER) {
        return sortUser(viewer, a, b);
      }
      IBaseLabelProvider baseLabel = ((TreeViewer)viewer).getLabelProvider();
      if (baseLabel instanceof ITableLabelProvider) {
        ITableLabelProvider tableProvider = (ITableLabelProvider) baseLabel;
        String e1p = tableProvider.getColumnText(a, columnNumber);
        String e2p = tableProvider.getColumnText(b, columnNumber);
        if (e1p != null && e2p != null) {
          return getComparator().compare(e1p, e2p);
        }
      }
      return 0;
View Full Code Here

        if (viewer instanceof ContentViewer) {
            ContentViewer tviewer = (ContentViewer) viewer;
            IBaseLabelProvider provider = tviewer.getLabelProvider();
            if (provider instanceof ITableLabelProvider) {
                ITableLabelProvider tableProvider = (ITableLabelProvider) provider;
                String text1 = tableProvider.getColumnText(issue1, IssuesView.columnToIndex(selectedColumn));
                String text2 = tableProvider.getColumnText(issue2, IssuesView.columnToIndex(selectedColumn));
                if (text1 != null && text2 != null) {
                    return defaultSorter.compare(viewer, text1, text2);
                }

                switch( selectedColumn ) {
View Full Code Here

        });
        tableViewer.setCellEditors(new CellEditor[]{new TextCellEditor(table), new TextCellEditor(table),
                new ComboBoxCellEditor(table, JGrassConstants.CSVTYPESARRAY)});

        // the label provider
        tableViewer.setLabelProvider(new ITableLabelProvider(){

            public Image getColumnImage( Object element, int columnIndex ) {
                return null;
            }
View Full Code Here

      tc3.setText("Version");
      tc3.setWidth(100);

      gameTableViewer = new TableViewer(clientTable);
     
      gameTableViewer.setLabelProvider(new ITableLabelProvider() {

      public Image getColumnImage(Object element, int columnIndex) {
        if (element instanceof IGameDescriptor) {
          IGameDescriptor game = (IGameDescriptor) element;
         
View Full Code Here

     
      clientTable.setHeaderVisible(true);

      clientTableViewer = new TableViewer(clientTable);
     
      clientTableViewer.setLabelProvider(new ITableLabelProvider () {

      public Image getColumnImage(Object element, int columnIndex) {
        return null;
      }
View Full Code Here

        table.setLayout(tableLayout);

        ruleTable = new TableViewer(table);
        ruleTable.setContentProvider(CONTENT_PROVIDER);
        final ILabelDecorator decorator = new ProxyLabelDecorator();
        final ITableLabelProvider labelProvider = new ITableLabelProvider() {
            public Image getColumnImage(Object o, int i) {
                // Decorate an image for the first column only
                return (i == COLUMN_SELECTOR) ?
                        decorator.decorateImage(SELECTOR_IMAGE, o) : null;
            }

            public String getColumnText(Object o, int i) {
                BeanProxy ruleProxy = (BeanProxy) o;
                String returnValue = null;
                if (i == COLUMN_SELECTOR) {
                    // Selectors
                    Proxy selectorsProxy =
                            ruleProxy.getPropertyProxy(Rule.SELECTORS);
                    Object model = selectorsProxy.getModelObject();
                    returnValue = selectorListToText((List) model);
                } else if (i == COLUMN_ORDER) {
                    // Order
                    ListProxy rules = (ListProxy) getSelectedStyleSheetProxy().
                            getPropertyProxy(ThemeModel.RULES);
                    int index = rules.getItemProxyIndex(ruleProxy);
                    // Indices start at 0, but humans expect 1...
                    returnValue = String.valueOf(index + 1);
                }
                return returnValue;
            }

            public void addListener(ILabelProviderListener iLabelProviderListener) {
            }

            public void dispose() {
            }

            public boolean isLabelProperty(Object o, String s) {
                return true;
            }

            public void removeListener(ILabelProviderListener iLabelProviderListener) {
            }
        };
        ruleTable.setLabelProvider(labelProvider);

        CellEditor editors [] = new CellEditor[2];
        editors[0] = new TextCellEditor(table);

        ruleTable.setCellEditors(editors);
        ruleTable.setColumnProperties(new String[]{"selectors", "order"});
        ruleTable.setCellModifier(new ICellModifier() {
            public boolean canModify(Object o, String s) {
                return "selectors".equals(s);
            }

            public Object getValue(Object o, String s) {
                Object value = null;
                // Only selectors are modifiable, so ignore all other settings
                if ("selectors".equals(s)) {
                    List selectors = ruleProxyToSelectorList((BeanProxy) o);
                    value = selectorListToText(selectors);
                }
                return value;
            }

            public void modify(Object tableItem, String columnName, Object newValue) {
                if ("selectors".equals(columnName)) {
                    TableItem item = (TableItem) tableItem;
                    BeanProxy ruleProxy = (BeanProxy) item.getData();
                    String oldValue = labelProvider.getColumnText(ruleProxy, COLUMN_SELECTOR);
                    if (!oldValue.equals(newValue)) {
                        List parsed =
                                CSS_PARSER.parseSelectorGroup((String) newValue);
                        ListProxy selectorsProxy = (ListProxy) ruleProxy.getPropertyProxy(Rule.SELECTORS);
                        Operation setList = selectorsProxy.prepareSetModelObjectOperation(parsed);
View Full Code Here

     * specified.
     *
     * @return the label provider
     */
    protected ITableLabelProvider createLabelProvider() {
        return new ITableLabelProvider() {
            // javadoc inherited
            public Image getColumnImage(Object element, int columnIndex) {
                return null;
            }

View Full Code Here

                return tableViewer;
            }

            // javadoc inherited
            protected ITableLabelProvider createLabelProvider() {
                return new ITableLabelProvider() {
                    // javadoc inherited
                    public Image getColumnImage(Object element,
                                                int columnIndex) {
                        // No column images
                        return null;
View Full Code Here

TOP

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

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.