Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.
Kommentar: Migrated to Confluence 5.3

...

Die Commands für das Anlegen von Annotationen werden in der com.levigo.jadice.appbase.AnnotationProfileAwareToolBar-Klasse aus dem Annotationsprofil erstellt, hier hat man die Möglichkeit ein weiteres Command zum Beenden des Annotations-Erstellmodus einzufügen. Die AnnotationProfileAwareToolBar-Implementation muss angepasst werden, der Quellcode ist in der lib/appbase/jadice-appbase-x.x.x.x-sources.jar Datei unter com/levigo/jadice/appbase/AnnotationProfileAwareToolBar.java zu finden. Hier muss das zusätzliche Command in der Methode populateComponent(...) Methode am Anfang eingefügt werden, z.B.:

Codeblock
   private boolean stopAnnoCreationCmdAdded = false;

  private void populateComponent(final TypeSet typeSet, JComponent componentToPopulate) {

	if (!stopAnnoCreationCmdAdded) {
      final AbstractDocumentCommand cmdStopAnnoCreation = new AbstractDocumentCommand() {
        @Override
        protected void execute() {
          getPageView().getToolManager().getTool(AnnotationTool.class).setEditMode();
        }
        @Override
        protected boolean canExecute() {
          return  getPageView().getToolManager().getTool(AnnotationTool.class).getCreateMode() != null;
        }
      };
      final Icon iconStopAnnoCreation = UIManager.getIcon("Jadice.icons.TB_CLOSEDOCNORMAL");
      final CommandAction cmdActionStopAnnoCreation = new CommandAction(//
        context, // context
        Arrays.<Command> asList(cmdStopAnnoCreation), // command
        "",//
        "",//
        "Annotation erstellen beenden",//
        null, // long description; not used.
        iconStopAnnoCreation, //
        iconStopAnnoCreation, //
        "",//
        null, // accelerator key
        0, // mnemonic key
        null // other options
      );
      addActionToComponent(componentToPopulate, cmdActionStopAnnoCreation);

      // Auf 'true' setzen, damit das Command nur einmal hinzugefügt wird
	  stopAnnoCreationCmdAdded = true;
    }

    ...

  } 

...