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);
    }
示例#2
0
 private void appendMergeSourceText(JTable table, int row, int column, @Nullable String text) {
   if (StringUtil.isEmpty(text)) {
     append("", SimpleTextAttributes.REGULAR_ATTRIBUTES);
   } else {
     append(
         cutString(text, table.getCellRect(row, column, false).getWidth()),
         SimpleTextAttributes.REGULAR_ATTRIBUTES,
         MERGE_SOURCE_DETAILS_TAG);
   }
 }