Examples of TableItem


Examples of org.eclipse.swt.widgets.TableItem

        tree.setSelection(new TreeItem[] { item });

      selEvent.item = item;
    } else if (w instanceof Table) {
      Table table = (Table) w;
      TableItem item = table.getItem(new Point(e.x, e.y));
      if (item != null)
        table.setSelection(new TableItem[] { item });

      selEvent.item = item;
    } else
View Full Code Here

Examples of org.eclipse.swt.widgets.TableItem

    });
  }

  private void onMouseDown(Event event) {
    Point p = new Point(event.x, event.y);
    TableItem item = fResultViewer.getTable().getItem(p);

    /* Problem - return */
    if (item == null || item.isDisposed())
      return;

    /* Mouse-Up over Read-State-Column */
    if (event.button == 1 && item.getImageBounds(COL_TITLE).contains(p)) {
      Object data = item.getData();

      /* Toggle State between Read / Unread */
      if (data instanceof ScoredNews) {
        INews news = ((ScoredNews) data).getNews();
        INews.State newState = (news.getState() == INews.State.READ) ? INews.State.UNREAD : INews.State.READ;
        setNewsState(new ArrayList<INews>(Arrays.asList(new INews[] { news })), newState);
      }
    }

    /* Mouse-Up over Sticky-State-Column */
    else if (event.button == 1 && item.getImageBounds(COL_STICKY).contains(p)) {
      Object data = item.getData();

      /* Toggle State between Sticky / Not Sticky */
      if (data instanceof ScoredNews) {
        new MakeNewsStickyAction(new StructuredSelection(((ScoredNews) data).getNews())).run();
      }
View Full Code Here

Examples of org.eclipse.swt.widgets.TableItem

    }
  }

  private void onMouseMove(Event event) {
    Point p = new Point(event.x, event.y);
    TableItem item = fResultViewer.getTable().getItem(p);

    /* Problem / Group hovered - reset */
    if (item == null || item.isDisposed() || item.getData() instanceof EntityGroup) {
      if (fShowsHandCursor && !fResultViewer.getControl().isDisposed()) {
        fResultViewer.getControl().setCursor(null);
        fShowsHandCursor = false;
      }
      return;
    }

    /* Show Hand-Cursor if action can be performed */
    boolean changeToHandCursor = item.getImageBounds(COL_TITLE).contains(p) || item.getImageBounds(COL_STICKY).contains(p);
    if (!fShowsHandCursor && changeToHandCursor) {
      fResultViewer.getControl().setCursor(fHandCursor);
      fShowsHandCursor = true;
    } else if (fShowsHandCursor && !changeToHandCursor) {
      fResultViewer.getControl().setCursor(null);
View Full Code Here

Examples of org.eclipse.swt.widgets.TableItem

     */
    @Override
    protected Object getToolTipArea(Event event) {
      Table table = (Table) event.widget;
      Point point = new Point(event.x, event.y);
      TableItem item = table.getItem(point);

      /* Only valid for Feed Column */
      if (item != null) {
        if (item.getBounds(COL_FEED).contains(point))
          return super.getToolTipArea(event);
      }

      return null;
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.TableItem

    return null;
  }

  public void modify(Object arg0, String arg1, Object arg2) {
    if(arg0 instanceof TableItem){
      TableItem lTableItem  = (TableItem)arg0;
      IXFile lFile = (IXFile)lTableItem.getData();
      if(arg2 instanceof Boolean){
        Boolean lValue = (Boolean)arg2;
        lFile.setMarked(lValue.booleanValue());
        if(lFile instanceof IPersonalAttachment ){
          IPersonalAttachment lEncl = (IPersonalAttachment)lFile;
View Full Code Here

Examples of org.eclipse.swt.widgets.TableItem

  if (!file.exists()) return;
  BufferedReader br = null;
  table.clearAll(); table.removeAll();   
  tcol1.setText("RESULTS:"); tcol1.setWidth(800);
  tcol2.setWidth(0);
  TableItem ti = null;
  try
  {
   String lastLine = (success) ? "INFO: The repair operation completed normally":
    "WARNING: The repair operation was aborted";
   ti = new TableItem(table, SWT.LEFT); ti.setBackground(backWhite);
   ti.setText(lastLine);            

   String theLine = null;
   FileInputStream fis = new FileInputStream(file);
   br = new BufferedReader(new InputStreamReader(fis)); int i = 0;
   while( (theLine = br.readLine() ) != null)
   { ti = new TableItem(table, SWT.LEFT, i);
     ti.setBackground(backYellow); ti.setForeground(frontBlue);
     ti.setText(theLine); i++;           
   } //*-- end of while
  }
  catch (FileNotFoundException e)
  { ti = new TableItem(table, SWT.LEFT, 0); ti.setBackground(backWhite); ti.setForeground(frontRed);
    ti.setText("The repair file" + filename + " was not found."); }
  catch (IOException e
  { ti = new TableItem(table, SWT.LEFT, 0); ti.setBackground(backWhite); ti.setForeground(frontRed);
    ti.setText("IO Error on repair file" + filename + "."); }
  finally
  try { if (br != null) br.close(); }
  catch (IOException ie) { System.out.println("Could not close reader"); }
  }

View Full Code Here

Examples of org.eclipse.swt.widgets.TableItem

  BufferedReader br = null;

  //*-- create the first table column
  table.removeAll(); table.clearAll();  
  tcol1.setText("Log Entries:"); tcol1.setWidth(800);
  TableItem ti = null;
  LinkedList<String> logList = new LinkedList<String>(); int MAX_ENTRIES = 21;
  try
  {
   //*-- dump a message if the task was cancelled
   String lastLine = (success) ? "INFO: The index operation completed normally":
    "WARNING: The index operation was aborted";
   ti = new TableItem(table, SWT.LEFT); ti.setBackground(backWhite);
   ti.setText(lastLine);          

   //*-- read the file in reverse and save the last 10 entries
   String theLine = "";
   FileInputStream fis = new FileInputStream(file);
   br = new BufferedReader(new InputStreamReader(fis)); int numItems = 0;
   while( (theLine = br.readLine() ) != null)
   {  if (++numItems < MAX_ENTRIES) logList.add(theLine);
      else { logList.removeFirst(); logList.addLast(theLine); }
   } //*-- end of while

   //*-- dump the latest log entries to the table
   for (int i = 0; i < logList.size(); i++)
   { ti = new TableItem(table, SWT.LEFT, i);
     ti.setBackground(backYellow); ti.setForeground(frontBlue);
     ti.setText( (String) logList.get(i));
   }
  }
  catch (FileNotFoundException e)
  { ti = new TableItem(table, SWT.LEFT, 0); ti.setBackground(backWhite); ti.setForeground(frontRed);
  ti.setText("The log file" + filename + " was not found."); }
  catch (IOException e
  {  ti = new TableItem(table, SWT.LEFT, 0); ti.setBackground(backWhite); ti.setForeground(frontRed);
  ti.setText("IO Error on log file" + filename + "."); }
  finally
  try { if (br != null) br.close(); }
  catch (IOException ie) { System.out.println("Could not close reader"); }
  }

View Full Code Here

Examples of org.eclipse.swt.widgets.TableItem

  //*-- create the first table column
  table.removeAll(); table.clearAll();  
  tcol1.setText("File Type:"); tcol1.setWidth(300);
  tcol2.setText("Number"); tcol2.setWidth(100);
  TableItem ti = null;
  try
  {
   String lastLine = (success) ? "INFO: The summary operation completed normally":
    "WARNING: The summary operation was aborted";
   ti = new TableItem(table, SWT.LEFT); ti.setBackground(backWhite);
   ti.setText(0, lastLine);     

   String theLine = null;
   FileInputStream fis = new FileInputStream(file);
   br = new BufferedReader(new InputStreamReader(fis)); int i = 0;
   while( (theLine = br.readLine() ) != null)
   {      
    if (theLine.contains(":"))
     { ti = new TableItem(table, SWT.LEFT, i);
       ti.setBackground(backYellow); ti.setForeground(frontBlue);
       String[] parts = theLine.split(":");
       ti.setText(0, parts[0]); ti.setText(1, parts[1]); i++;
     }
   } //*-- end of while
  }
  catch (FileNotFoundException e)
  { ti = new TableItem(table, SWT.LEFT, 0); ti.setBackground(backWhite);
    ti.setText("The summary file" + filename + " was not found."); }
  catch (IOException e
  {  ti = new TableItem(table, SWT.LEFT, 0); ti.setBackground(backWhite);
     ti.setText("IO Error on summary file" + filename + "."); }
  finally
  try { if (br != null) br.close(); }
  catch (IOException ie) { System.out.println("Could not close reader"); }
  }

View Full Code Here

Examples of org.eclipse.swt.widgets.TableItem

{
  //*-- create the first table column
  table.removeAll(); table.clearAll();  
  tcol1.setText("Results:"); tcol1.setWidth(800);
  tcol2.setWidth(0);
  TableItem ti = null;     

  //*-- dump the results to the table
  for (int i = 0; i < results.length; i++)
  {      
   ti = new TableItem(table, SWT.LEFT, i);
   ti.setBackground( (results[i].equals("") ) ? backWhite: backYellow);
   ti.setText(results[i]);          
  }

  //*-- special case if not results were found
  if (results.length == 0)
  { ti = new TableItem(table, SWT.LEFT, 0);
    ti.setBackground(backWhite);
    ti.setText("No results were found ...");           
  }

}
View Full Code Here

Examples of org.eclipse.swt.widgets.TableItem

  //*-- re-create the table and set the excDirs string
  StringBuffer excDirs = new StringBuffer();
  table.removeAll();
  for (int i = 0; i < dirs.size(); i++)
  { TableItem ti = new TableItem(table, SWT.LEFT, i);
  String dir = (String) dirs.get(i);
  ti.setText(dir); excDirs.append(dir); excDirs.append( ";");
  }
  ( (CrawlConfigWizard) getWizard()).crawlConfig.setExcDirs(excDirs.toString());
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.