directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1333518 - in /directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views: ServersTableViewer.java ServersView.java ServersViewerComparator.java
Date Thu, 03 May 2012 16:02:04 GMT
Author: pamarcelot
Date: Thu May  3 16:02:04 2012
New Revision: 1333518

URL: http://svn.apache.org/viewvc?rev=1333518&view=rev
Log:
Part of a fix for DIRSTUDIO-811(Review and remove any source file under Eclipse Public License
(EPL) v 1.0).

Removed:
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersViewerComparator.java
Modified:
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersTableViewer.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersTableViewer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersTableViewer.java?rev=1333518&r1=1333517&r2=1333518&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersTableViewer.java
(original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersTableViewer.java
Thu May  3 16:02:04 2012
@@ -17,16 +17,6 @@
  *  under the License. 
  *  
  */
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
 package org.apache.directory.studio.ldapservers.views;
 
 
@@ -42,13 +32,10 @@ import org.apache.directory.studio.ldaps
 import org.apache.directory.studio.ldapservers.model.LdapServerStatus;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
 import org.eclipse.swt.widgets.TreeItem;
 import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.PlatformUI;
 
 
 /**
@@ -91,8 +78,6 @@ public class ServersTableViewer extends 
         setLabelProvider( labelProvider );
         setContentProvider( new ServersViewContentProvider() );
 
-        setComparator( new ServersViewerComparator( labelProvider ) );
-
         setInput( ROOT );
 
         addListeners();
@@ -366,47 +351,4 @@ public class ServersTableViewer extends 
             // Trace.trace( Trace.WARNING, "Error in optimized animation", e ); TODO
         }
     }
-
-
-    /**
-     * Resorts the table based on field.
-     * 
-     * @param column 
-     *      the column being updated
-     * @param col
-     *      the column
-     */
-    protected void resortTable( final TreeColumn column, int col )
-    {
-        ServersViewerComparator sorter = ( ServersViewerComparator ) getComparator();
-
-        if ( col == sorter.getTopPriority() )
-            sorter.reverseTopPriority();
-        else
-            sorter.setTopPriority( col );
-
-        PlatformUI.getWorkbench().getDisplay().asyncExec( new Runnable()
-        {
-            public void run()
-            {
-                refresh();
-                updateDirectionIndicator( column );
-            }
-        } );
-    }
-
-
-    /**
-     * Updates the direction indicator as column is now the primary column.
-     * 
-     * @param column
-     */
-    protected void updateDirectionIndicator( TreeColumn column )
-    {
-        getTree().setSortColumn( column );
-        if ( ( ( ServersViewerComparator ) getComparator() ).getTopPriorityDirection() ==
ServersViewerComparator.ASCENDING )
-            getTree().setSortDirection( SWT.UP );
-        else
-            getTree().setSortDirection( SWT.DOWN );
-    }
 }
\ No newline at end of file

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java?rev=1333518&r1=1333517&r2=1333518&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java
(original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java
Thu May  3 16:02:04 2012
@@ -44,9 +44,6 @@ import org.eclipse.jface.viewers.Selecti
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
@@ -140,14 +137,12 @@ public class ServersView extends ViewPar
         TreeColumn serverColumn = new TreeColumn( tree, SWT.SINGLE );
         serverColumn.setText( Messages.getString( "ServersView.server" ) ); //$NON-NLS-1$
         serverColumn.setWidth( columnWidths[0] );
-        serverColumn.addSelectionListener( getHeaderListener( 0 ) );
         tree.setSortColumn( serverColumn );
         tree.setSortDirection( SWT.UP );
 
         TreeColumn stateColumn = new TreeColumn( tree, SWT.SINGLE );
         stateColumn.setText( Messages.getString( "ServersView.state" ) ); //$NON-NLS-1$
         stateColumn.setWidth( columnWidths[1] );
-        stateColumn.addSelectionListener( getHeaderListener( 1 ) );
 
         // Creating the viewer
         tableViewer = new ServersTableViewer( tree );
@@ -163,33 +158,6 @@ public class ServersView extends ViewPar
         //            .setHelp( parent, ApacheDsPluginConstants.PLUGIN_ID + "." + "gettingstarted_views_servers"
); //$NON-NLS-1$ //$NON-NLS-2$
     }
 
-
-    /**
-     * Gets a header listener for the given column.
-     * 
-     * @param col
-     *      the column
-     * @return
-     *      a header listener for the given column
-     */
-    private SelectionListener getHeaderListener( final int col )
-    {
-        return new SelectionAdapter()
-        {
-            /**
-             * Handles the case of user selecting the header area.
-             */
-            public void widgetSelected( SelectionEvent e )
-            {
-                if ( tableViewer == null )
-                    return;
-                TreeColumn column = ( TreeColumn ) e.widget;
-                tableViewer.resortTable( column, col );
-            }
-        };
-    }
-
-
     /**
      * {@inheritDoc}
      */



Mime
View raw message