Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.ViewerSorter


                    return filter == null || filter.select(castedElement);
                }
            });
            if (comparator != null)
            {
                viewer.setSorter(new ViewerSorter()
                {
                    @Override
                    public int compare(Viewer viewer, Object o1, Object o2)
                    {
                        @SuppressWarnings("unchecked")
View Full Code Here


                    return filter == null || filter.select(castedElement);
                }
            });
            if (comparator != null)
            {
                viewer.setSorter(new ViewerSorter()
                {
                    @Override
                    public int compare(Viewer viewer, Object o1, Object o2)
                    {
                        @SuppressWarnings("unchecked")
View Full Code Here

    String[] columnsHeaders = new String[] { "Name", "Path" };

    pharField.setTableColumns(new ListDialogField.ColumnsDescription(
        columnsHeaders, true));
    pharField.setViewerSorter(new ViewerSorter());

    unpackPhars();
  }
View Full Code Here

    /**
     * Sorts by VM name.
     */
    protected void sortByName() {
        fRuntimeList.setSorter(new ViewerSorter() {

            @Override
            public int compare(final Viewer viewer, final Object e1, final Object e2) {
                if (e1 instanceof RuntimeInfo && e2 instanceof RuntimeInfo) {
                    final RuntimeInfo left = (RuntimeInfo) e1;
View Full Code Here

    /**
     * Sorts by VM location.
     */
    protected void sortByDirectory() {
        fRuntimeList.setSorter(new ViewerSorter() {

            @Override
            public int compare(final Viewer viewer, final Object e1, final Object e2) {
                if (e1 instanceof RuntimeInfo && e2 instanceof RuntimeInfo) {
                    final RuntimeInfo left = (RuntimeInfo) e1;
View Full Code Here

        tree.setLayoutData(gdTree);
        fListViewer.setLabelProvider(new ColorListLabelProvider());
        fListViewer.setContentProvider(new ColorListContentProvider());
        fListViewer.setInput(fColors);
        fListViewer.setSelection(new StructuredSelection(fErlangCategory));
        fListViewer.setSorter(new ViewerSorter() {

            @Override
            public int category(final Object element) {
                // don't sort the top level categories
                if (fErlangCategory.equals(element)) {
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, Messages
            .getString( "NewEntryObjectclassWizardPage.AddButton" ), 1 ); //$NON-NLS-1$
        removeButton = BaseWidgetUtils.createButton( buttonComposite, Messages
            .getString( "NewEntryObjectclassWizardPage.RemoveButton" ), 1 ); //$NON-NLS-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

                // Default
                return super.getImage( element );
            }
        } );
        projectsTreeViewer.setSorter( new ViewerSorter() );
        projectsTreeViewer.addCheckStateListener( new ICheckStateListener()
        {
            /**
             * Notifies of a change to the checked state of an element.
             *
 
View Full Code Here

    TreeViewer tree = filteredTree.getViewer();
    filteredTree.setInitialText(Messages.FilteredEditorDialog_type_filter_text_here);

    setContentAndLabelProviders(tree);
        //alphabetical sort
        tree.setSorter(new ViewerSorter());

    tree.setInput(getEditorPageManager());
   
    //if the tree has only one or zero pages, make the combo area disable
    if(hasAtMostOnePage(tree)){
View Full Code Here

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

        paletteTable.setSorter(new ViewerSorter() {

            @Override
            public int compare( Viewer viewer, Object e1, Object e2 ) {
                if (e1 instanceof BrewerPalette && e2 instanceof BrewerPalette) {
                    BrewerPalette p1 = (BrewerPalette) e1;
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.