예제 #1
0
 public void setImage(Image image) {
   checkWidget();
   if (image != null && image.isDisposed()) {
     error(SWT.ERROR_INVALID_ARGUMENT);
   }
   super.setImage(image);
   NSTableHeaderView headerView = ((NSOutlineView) parent.view).headerView();
   if (headerView == null) return;
   int index = parent.indexOf(nsColumn);
   NSRect rect = headerView.headerRectOfColumn(index);
   headerView.setNeedsDisplayInRect(rect);
 }
예제 #2
0
 public void setText(String string) {
   checkWidget();
   if (string == null) error(SWT.ERROR_NULL_ARGUMENT);
   super.setText(string);
   char[] buffer = new char[text.length()];
   text.getChars(0, buffer.length, buffer, 0);
   int length = fixMnemonic(buffer);
   displayText = new String(buffer, 0, length);
   NSString title = NSString.stringWith(displayText);
   nsColumn.headerCell().setTitle(title);
   NSTableHeaderView headerView = ((NSOutlineView) parent.view).headerView();
   if (headerView == null) return;
   int index = parent.indexOf(nsColumn);
   NSRect rect = headerView.headerRectOfColumn(index);
   headerView.setNeedsDisplayInRect(rect);
 }
예제 #3
0
 /**
  * Controls how text and images will be displayed in the receiver. The argument should be one of
  * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>.
  *
  * <p>Note that due to a restriction on some platforms, the first column is always left aligned.
  *
  * @param alignment the new alignment
  * @exception SWTException
  *     <ul>
  *       <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  *       <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  *     </ul>
  */
 public void setAlignment(int alignment) {
   checkWidget();
   if ((alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER)) == 0) return;
   int index = parent.indexOf(this);
   if (index == -1 || index == 0) return;
   style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
   style |= alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER);
   NSOutlineView outlineView = ((NSOutlineView) parent.view);
   NSTableHeaderView headerView = outlineView.headerView();
   if (headerView == null) return;
   index = parent.indexOf(nsColumn);
   NSRect rect = headerView.headerRectOfColumn(index);
   headerView.setNeedsDisplayInRect(rect);
   rect = outlineView.rectOfColumn(index);
   parent.view.setNeedsDisplayInRect(rect);
 }