示例#1
0
 protected void initStatusLine() {
   fTable.addSelectionChangedListener(
       new ISelectionChangedListener() {
         @Override
         public void selectionChanged(final SelectionChangedEvent event) {
           final IStatusLineManager manager =
               getEditorSite().getActionBars().getStatusLineManager();
           final RDataTableSelection selection = (RDataTableSelection) event.getSelection();
           updateStatusLine();
           if (selection.getAnchorRowLabel() != null) {
             final StringBuilder sb = new StringBuilder();
             sb.append(selection.getAnchorRowLabel());
             sb.append(", ");
             sb.append(selection.getAnchorColumnLabel());
             if (selection.getLastSelectedCellRowLabel() != null) {
               sb.append(" (");
               sb.append(selection.getLastSelectedCellRowLabel());
               sb.append(", ");
               sb.append(selection.getLastSelectedCellColumnLabel());
               sb.append(")");
             }
             manager.setMessage(sb.toString());
           } else {
             manager.setMessage(null);
           }
         }
       });
 }