예제 #1
0
  private void doSaveNotes() {
    INotesContent html = notesAdapter.makeNewHtmlContent();
    INotesContent plain = notesAdapter.makeNewPlainContent();
    ITopic topic = topicPart.getTopic();
    EditDomain domain = topicPart.getSite().getViewer().getEditDomain();
    if (domain != null) {
      ICommandStack cs = domain.getCommandStack();
      if (cs != null) {
        ModifyNotesCommand modifyHtml = new ModifyNotesCommand(topic, html, INotes.HTML);
        ModifyNotesCommand modifyPlain = new ModifyNotesCommand(topic, plain, INotes.PLAIN);
        CompoundCommand cmd = new CompoundCommand(modifyHtml, modifyPlain);
        cmd.setLabel(CommandMessages.Command_ModifyNotes);
        cs.execute(cmd);
        return;
      }
    }

    INotes notes = topic.getNotes();
    notes.setContent(INotes.HTML, html);
    notes.setContent(INotes.PLAIN, plain);
  }