Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.ViewerSorter


      public void selectionChanged(SelectionChangedEvent event) {
        managedForm.fireSelectionChanged(spart, event.getSelection());
      }
    });
    viewer.setContentProvider(new MasterContentProvider());
    viewer.setSorter(new ViewerSorter());
    viewer.setLabelProvider(new MasterLabelProvider() {

      public String getColumnText(Object obj, int index) {
        if (obj instanceof Binding) {
          Binding binding = (Binding) obj;
View Full Code Here


    fLocationsViewer = new TreeViewer(comp);
    gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 6;
    fLocationsViewer.getControl().setLayoutData(gd);
    fLocationsContentProvider = new ManLocationsContentProvider();
    fLocationsViewer.setSorter(new ViewerSorter());
    fLocationsViewer.setContentProvider(fLocationsContentProvider);
    fLocationsViewer.setLabelProvider(getLabelProvider());
    fLocationsViewer.setInput(this);
    fLocationsViewer.addSelectionChangedListener(this);
View Full Code Here

        final Tree tree = treeViewer.getTree();
        drillDown.setChildTree( treeViewer );
       
        treeViewer.setContentProvider( new WorkbenchContentProvider() );
        treeViewer.setLabelProvider( WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider() );
        treeViewer.setSorter( new ViewerSorter() );
       
        final ValidFileSystemResourceType validFileSystemResourceTypeAnnotation
            = value.definition().getAnnotation( ValidFileSystemResourceType.class );
   
        if( validFileSystemResourceTypeAnnotation != null )
View Full Code Here

        data.heightHint = SIZING_SELECTION_WIDGET_HEIGHT;
        data.widthHint = ( int ) ( SIZING_SELECTION_WIDGET_WIDTH * 0.4 );
        availableObjectClassesViewer.getTable().setLayoutData( data );
        availableObjectClassesViewer.setContentProvider( new ArrayContentProvider() );
        availableObjectClassesViewer.setLabelProvider( labelProvider );
        availableObjectClassesViewer.setSorter( new ViewerSorter() );
        availableObjectClassesViewer.addFilter( new InstantSearchFilter( availableObjectClassesInstantSearch ) );
        availableObjectClassesViewer.setInput( availableObjectClasses );
        availableObjectClassesViewer.addDoubleClickListener( new IDoubleClickListener()
        {
            public void doubleClick( DoubleClickEvent event )
            {
                add( event.getSelection() );
            }
        } );
        availableObjectClassesViewer.getTable().addKeyListener( new KeyAdapter()
        {
            public void keyPressed( KeyEvent e )
            {
                if ( e.keyCode == SWT.ARROW_UP )
                {
                    if ( availableObjectClassesViewer.getTable().getSelectionIndex() <= 0 )
                    {
                        availableObjectClassesInstantSearch.setFocus();
                    }
                }
            }
        } );

        Composite buttonComposite = new Composite( composite, SWT.NONE );
        gl = new GridLayout( 1, true );
        buttonComposite.setLayout( gl );
        data = new GridData( GridData.FILL_BOTH );
        data.heightHint = SIZING_SELECTION_WIDGET_HEIGHT;
        // data.widthHint = (int)(SIZING_SELECTION_WIDGET_WIDTH * 0.2);
        data.horizontalAlignment = SWT.CENTER;
        buttonComposite.setLayoutData( data );
        Label label0 = new Label( buttonComposite, SWT.NONE );
        data = new GridData();
        data.grabExcessHorizontalSpace = true;
        data.grabExcessVerticalSpace = true;
        label0.setLayoutData( data );
        addButton = BaseWidgetUtils.createButton( buttonComposite, "&Add", 1 );
        removeButton = BaseWidgetUtils.createButton( buttonComposite, "&Remove", 1 );
        Label label3 = new Label( buttonComposite, SWT.NONE );
        data = new GridData();
        data.grabExcessHorizontalSpace = true;
        data.grabExcessVerticalSpace = true;
        label3.setLayoutData( data );

        addButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                add( availableObjectClassesViewer.getSelection() );
            }
        } );

        removeButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                remove( selectedObjectClassesViewer.getSelection() );
            }
        } );

        selectedObjectClassesViewer = new TableViewer( composite );
        data = new GridData( GridData.FILL_BOTH );
        data.heightHint = SIZING_SELECTION_WIDGET_HEIGHT;
        data.widthHint = ( int ) ( SIZING_SELECTION_WIDGET_WIDTH * 0.4 );
        selectedObjectClassesViewer.getTable().setLayoutData( data );
        selectedObjectClassesViewer.setContentProvider( new ArrayContentProvider() );
        selectedObjectClassesViewer.setLabelProvider( labelProvider );
        selectedObjectClassesViewer.setSorter( new ViewerSorter() );
        selectedObjectClassesViewer.setInput( selectedObjectClasses );
        selectedObjectClassesViewer.addDoubleClickListener( new IDoubleClickListener()
        {
            public void doubleClick( DoubleClickEvent event )
            {
View Full Code Here

        };
        cp.showClosedProjects(showClosedProjects);
        treeViewer.setContentProvider(cp);
        treeViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
        treeViewer.setSorter(new ViewerSorter());
        treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
            public void selectionChanged(SelectionChangedEvent event) {
                IStructuredSelection selection = (IStructuredSelection) event.getSelection();
                containerSelectionChanged((IContainer) selection.getFirstElement()); // allow null
            }
View Full Code Here

    public void setAlphaSort(boolean doSort) {
        PyOutlinePage p = this.page.get();
        if (p != null) {
            p.getStore().setValue(PREF_ALPHA_SORT, doSort);
            if (sortByNameSorter == null) {
                sortByNameSorter = new ViewerSorter() {
                    @SuppressWarnings("unchecked")
                    public int compare(Viewer viewer, Object e1, Object e2) {
                        return ((Comparable) e1).compareTo(e2);
                    }
                };
View Full Code Here

        return super.getStyledText(element);
      }
    };
    viewer.setLabelProvider(new DelegatingStyledCellLabelProvider(
        styleProvider));
    viewer.setSorter(new ViewerSorter());

    Map<MergeFailureReason, RevertFailure> failures = new HashMap<MergeFailureReason, RevertFailure>();
    for (Entry<String, MergeFailureReason> reason : reasons.entrySet()) {
      RevertFailure failure = failures.get(reason.getValue());
      if (failure == null) {
View Full Code Here

    v.setContentProvider(new RepoComboContentProvider());
    v.setLabelProvider(new RepoComboLabelProvider());
    v.setInput(new Object());
    // the default ViewerSorter seems to do the right thing
    // i.e. sort as String
    v.setSorter(new ViewerSorter());

    existingRepoCombo.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        selectedRepository = null;
View Full Code Here

        }
        return super.getToolTipText(element);
      }

    });
    treeViewer.setSorter(new ViewerSorter() {

      public int compare(Viewer viewer, Object e1, Object e2) {
        if (e1 instanceof FetchResultAdapter
            && e2 instanceof FetchResultAdapter) {
          FetchResultAdapter f1 = (FetchResultAdapter) e1;
View Full Code Here

        return super.getStyledText(element);
      }

    };

    treeViewer.setSorter(new ViewerSorter() {

      public int compare(Viewer viewer, Object e1, Object e2) {

        if (e1 instanceof RefUpdateElement
            && e2 instanceof RefUpdateElement) {
View Full Code Here

TOP

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

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.