コード例 #1
0
ファイル: NotesPopup.java プロジェクト: Bluelich/xmind
 private void updateTextActions() {
   if (notesViewer == null || notesViewer.getControl().isDisposed() || contributor == null) return;
   TextViewer textViewer = notesViewer.getImplementation().getTextViewer();
   if (textViewer != null) {
     contributor.update(textViewer);
   }
 }
コード例 #2
0
ファイル: NotesPopup.java プロジェクト: Bluelich/xmind
  private void saveNotes() {
    if (notesAdapter == null
        || notesViewer == null
        || notesViewer.getControl().isDisposed()
        || !notesViewer.hasModified()) return;

    doSaveNotes();
    notesViewer.resetModified();
  }
コード例 #3
0
ファイル: NotesPopup.java プロジェクト: Bluelich/xmind
  protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    notesViewer = new TopicNotesViewer();
    if (editable) {
      notesViewer.setContributor(contributor = new NotesPopupActionBarContributor());
    }
    int style = IRichTextEditViewer.DEFAULT_CONTROL_STYLE;
    if (!editable) {
      style |= SWT.READ_ONLY;
    }
    notesViewer.createControl(composite, style);

    GridData gridData = new GridData(GridData.FILL_BOTH);
    gridData.widthHint = 400;
    notesViewer.getControl().setLayoutData(gridData);

    ITopic topic = topicPart.getTopic();

    notesAdapter = new RichDocumentNotesAdapter(topic);

    notesViewer.setInput(notesAdapter);

    notesViewer
        .getControl()
        .addDisposeListener(
            new DisposeListener() {
              public void widgetDisposed(DisposeEvent e) {
                if (notesAdapter != null) {
                  notesAdapter.dispose();
                  notesAdapter = null;
                }
              }
            });
    notesViewer.getImplementation().addSelectionChangedListener(this);
    notesViewer.getImplementation().getDocument().addDocumentListener(this);
    notesViewer.getImplementation().getDocument().addRichDocumentListener(this);
    new PopupKeyboardListener().hook(notesViewer.getImplementation().getFocusControl());
    update();
    addSpellCheck();
    return composite;
  }
コード例 #4
0
ファイル: NotesPopup.java プロジェクト: Bluelich/xmind
 @SuppressWarnings("unchecked")
 protected List getBackgroundColorExclusions() {
   List list = super.getBackgroundColorExclusions();
   collectBackgroundColorExclusions(notesViewer.getControl(), list);
   return list;
 }
コード例 #5
0
ファイル: NotesPopup.java プロジェクト: Bluelich/xmind
 protected Control getFocusControl() {
   return notesViewer.getImplementation().getFocusControl();
 }
コード例 #6
0
ファイル: NotesPopup.java プロジェクト: Bluelich/xmind
 private void addSpellCheck() {
   spellingActivation =
       SpellingSupport.getInstance()
           .activateSpelling(notesViewer.getImplementation().getTextViewer());
 }