Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.EditingSupport


            public void update(ViewerCell cell) {
                Line line = (Line) cell.getElement();
                cell.setText(line.getValue());
            }
        });
        column1.setEditingSupport(new EditingSupport(viewer) {
           
            @Override
            protected void setValue(Object element, Object value) {
                Line line = (Line)element;
                line.setValue(String.valueOf(value));
View Full Code Here


      colOpacity.setLabelProvider(labelProvider);
      colOpacity.getColumn().setText(col.guiName);
      colOpacity.getColumn().setWidth(col.size);
   
      colOpacity.setEditingSupport(
          new EditingSupport(colOpacity.getViewer()){

            @Override
            protected CellEditor getCellEditor(Object element) {
              return col.getCellEditor(tblViewer);
            }
View Full Code Here

      colOpacity.setLabelProvider(labelProvider);
      colOpacity.getColumn().setText(col.guiName);
      colOpacity.getColumn().setWidth(col.size);
   
      colOpacity.setEditingSupport(
          new EditingSupport(colOpacity.getViewer()){

            @Override
            protected CellEditor getCellEditor(Object element) {
              return col.getCellEditor(tblViewer);
            }
View Full Code Here

            viewerComp.setLayout(participantsColLayout);
            {

                TableViewerColumn viewerColumn;
                TableColumn tableColumn;
                EditingSupport editSupport;

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

                final Table table = participantsViewer.getTable();

                viewerColumn = new TableViewerColumn(participantsViewer, SWT.LEFT);
                tableColumn = viewerColumn.getColumn();
                tableColumn.setText("");
                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();
View Full Code Here

        campaignSelectorViewer.setSelection(new StructuredSelection(selectedCampaign));

        // encounter sequence table
        TableViewerColumn viewerColumn;
        TableColumn tableColumn;
        EditingSupport editSupport;

        viewer = new TableViewer(comp, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
        getSite().setSelectionProvider(viewer);

        final Table table = viewer.getTable();
View Full Code Here

        Label label;

        // alert table
        TableViewerColumn viewerColumn;
        TableColumn tableColumn;
        EditingSupport editSupport;

        viewer = new TableViewer(parent, SWT.SINGLE | SWT.FULL_SELECTION);
        getSite().setSelectionProvider(viewer);

        final Table table = viewer.getTable();
View Full Code Here

            public String getText(final Object element) {
                String error = (String) element;
                return error;
            }
        });
        column.setEditingSupport(new EditingSupport(tableViewer) {
            @Override
            protected CellEditor getCellEditor(final Object element) {
                return new TextCellEditor(tableViewer.getTable());
            }
View Full Code Here

    // first column
    TableViewerColumn tvc = new TableViewerColumn(tableViewer, column);
    tvc.setLabelProvider(new ListCellLabelProvider());

    // editing support
    EditingSupport editing = new ListEditingSupport(tvc.getViewer(),
        tableViewer.getTable());
    tvc.setEditingSupport(editing);
  }
View Full Code Here

      public String getToolTipText(Object element) {
        return null;
      }
    });

    columnGroup.setEditingSupport(new EditingSupport(deckViewer) {
      CellEditor editor = new TextCellEditor(deckViewer.getTree());

      @Override
      protected boolean canEdit(Object element) {
        if (element instanceof CardGroup) {
View Full Code Here

    final ColumnLayoutData[] layoutData = {
      new ColumnPixelData(70, true, true),
      new ColumnPixelData(140, true, true),
      new ColumnWeightData(100, 100, true),
    };
    final EditingSupport editorList[] = {
      null,
      new MacroItemParamValueSourceEditingSupport(viewer),
      new MacroItemParamValueEditingSupport(viewer),
    };
    final ColumnLabelProvider providerList[] = {
View Full Code Here

TOP

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

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.