Esempio n. 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);
           }
         }
       });
 }
Esempio n. 2
0
 private void updateStatusLine() {
   final IStatusLineManager manager = getEditorSite().getActionBars().getStatusLineManager();
   final IContributionItem dimItem = manager.find("data.dimension");
   final int[] dimension = fTable.getTableDimension();
   if (dimItem != null) {
     ((StatusLineContributionItem) dimItem)
         .setText((dimension != null) ? ("Dim: " + dimension[0] + " × " + dimension[1]) : "");
   }
 }
Esempio n. 3
0
 private void initTableInput() {
   final IRDataEditorInput editorInput = (IRDataEditorInput) getEditorInput();
   if (editorInput != null) {
     final IRDataTableInput tableInput = editorInput.getRDataTableInput();
     if (tableInput != null) {
       tableInput.addStateListener(fInputStateListener);
       if (tableInput.isAvailable()) {
         fTable.setInput(tableInput);
       } else {
         close(false);
       }
     }
   }
 }
Esempio n. 4
0
 @Override
 public void setFocus() {
   fTable.setFocus();
 }