コード例 #1
0
 public void mouseMoved(MouseEvent e) {
   JTable table = (JTable) e.getSource();
   Object tag = getTagAt(e);
   if (tag == myTag) {
     table.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
   } else {
     table.setCursor(Cursor.getDefaultCursor());
   }
 }
コード例 #2
0
    @Nullable
    private SvnFileRevision getSelectedRevision(final MouseEvent e) {
      JTable table = (JTable) e.getSource();
      int row = table.rowAtPoint(e.getPoint());
      int column = table.columnAtPoint(e.getPoint());

      final Object value = table.getModel().getValueAt(row, column);
      if (value instanceof SvnFileRevision) {
        return (SvnFileRevision) value;
      }
      return null;
    }
コード例 #3
0
    protected void customizeCellRenderer(
        final JTable table,
        final Object value,
        final boolean selected,
        final boolean hasFocus,
        final int row,
        final int column) {
      if (myListener == null) {
        myListener = new MergeSourceDetailsLinkListener(MERGE_SOURCE_DETAILS_TAG, myFile);
        myListener.install(table);
      }
      if (!(value instanceof SvnFileRevision)) {
        append("", SimpleTextAttributes.REGULAR_ATTRIBUTES);
        return;
      }
      final SvnFileRevision revision = (SvnFileRevision) value;
      final String text = getText(revision);
      if (text.length() == 0) {
        append("", SimpleTextAttributes.REGULAR_ATTRIBUTES);
        return;
      }

      append(
          cutString(text, table.getCellRect(row, column, false).getWidth()),
          SimpleTextAttributes.REGULAR_ATTRIBUTES);
    }