Search in sources :

Example 1 with CustomJob

use of com.igormaznitsa.mindmap.plugins.api.CustomJob in project netbeans-mmd-plugin by raydac.

the class MindMapPanelControllerImpl method getCustomProcessors.

private Map<Class<? extends PopUpMenuItemPlugin>, CustomJob> getCustomProcessors() {
    if (this.customProcessors == null) {
        this.customProcessors = new HashMap<Class<? extends PopUpMenuItemPlugin>, CustomJob>();
        this.customProcessors.put(ExtraNotePlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nullable @MustNotContainNull final Topic[] selectedTopics) {
                editTextForTopic(topic);
                panel.requestFocus();
            }
        });
        this.customProcessors.put(ExtraFilePlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nullable @MustNotContainNull final Topic[] selectedTopics) {
                editFileLinkForTopic(topic);
                panel.requestFocus();
            }
        });
        this.customProcessors.put(ExtraURIPlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nullable @MustNotContainNull final Topic[] selectedTopics) {
                editLinkForTopic(topic);
                panel.requestFocus();
            }
        });
        this.customProcessors.put(ExtraJumpPlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nullable @MustNotContainNull final Topic[] selectedTopics) {
                editTopicLinkForTopic(topic);
                panel.requestFocus();
            }
        });
        this.customProcessors.put(ChangeColorPlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nullable @MustNotContainNull final Topic[] selectedTopics) {
                processColorDialogForTopics(panel, selectedTopics.length > 0 ? selectedTopics : new Topic[] { topic });
            }
        });
        this.customProcessors.put(AboutPlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nullable @MustNotContainNull final Topic[] selectedTopics) {
                showAbout();
            }
        });
        this.customProcessors.put(OptionsPlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nullable @MustNotContainNull final Topic[] selectedTopics) {
                startOptionsEdit();
            }
        });
    }
    return this.customProcessors;
}
Also used : PopUpMenuItemPlugin(com.igormaznitsa.mindmap.plugins.api.PopUpMenuItemPlugin) CustomJob(com.igormaznitsa.mindmap.plugins.api.CustomJob)

Example 2 with CustomJob

use of com.igormaznitsa.mindmap.plugins.api.CustomJob in project netbeans-mmd-plugin by raydac.

the class MMDEditor method getCustomProcessors.

@Nonnull
private Map<Class<? extends PopUpMenuItemPlugin>, CustomJob> getCustomProcessors() {
    if (this.customProcessors == null) {
        this.customProcessors = new HashMap<>();
        this.customProcessors.put(ExtraNotePlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nonnull @MustNotContainNull final Topic[] selectedTopics) {
                if (topic != null) {
                    editTextForTopic(topic);
                    panel.requestFocus();
                }
            }
        });
        this.customProcessors.put(ExtraFilePlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nonnull @MustNotContainNull final Topic[] selectedTopics) {
                editFileLinkForTopic(topic);
                panel.requestFocus();
            }
        });
        this.customProcessors.put(ExtraURIPlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nonnull @MustNotContainNull final Topic[] selectedTopics) {
                editLinkForTopic(topic);
                panel.requestFocus();
            }
        });
        this.customProcessors.put(ExtraJumpPlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nonnull @MustNotContainNull final Topic[] selectedTopics) {
                editTopicLinkForTopic(topic);
                panel.requestFocus();
            }
        });
        this.customProcessors.put(ChangeColorPlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nonnull @MustNotContainNull final Topic[] selectedTopics) {
                processColorDialogForTopics(panel, selectedTopics.length > 0 ? selectedTopics : new Topic[] { topic });
            }
        });
    }
    return this.customProcessors;
}
Also used : CustomJob(com.igormaznitsa.mindmap.plugins.api.CustomJob) PopUpMenuItemPlugin(com.igormaznitsa.mindmap.plugins.api.PopUpMenuItemPlugin) Nonnull(javax.annotation.Nonnull)

Example 3 with CustomJob

use of com.igormaznitsa.mindmap.plugins.api.CustomJob in project netbeans-mmd-plugin by raydac.

the class MMDGraphEditor method getCustomProcessors.

private Map<Class<? extends PopUpMenuItemPlugin>, CustomJob> getCustomProcessors() {
    if (this.customProcessors == null) {
        this.customProcessors = new HashMap<Class<? extends PopUpMenuItemPlugin>, CustomJob>();
        this.customProcessors.put(ExtraNotePlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nonnull @MustNotContainNull final Topic[] selectedTopics) {
                editTextForTopic(topic);
                panel.requestFocus();
            }
        });
        this.customProcessors.put(ExtraFilePlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nonnull @MustNotContainNull final Topic[] selectedTopics) {
                editFileLinkForTopic(topic);
                panel.requestFocus();
            }
        });
        this.customProcessors.put(ExtraURIPlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nonnull @MustNotContainNull final Topic[] selectedTopics) {
                editLinkForTopic(topic);
                panel.requestFocus();
            }
        });
        this.customProcessors.put(ExtraJumpPlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nonnull @MustNotContainNull final Topic[] selectedTopics) {
                editTopicLinkForTopic(topic);
                panel.requestFocus();
            }
        });
        this.customProcessors.put(ChangeColorPlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nonnull @MustNotContainNull final Topic[] selectedTopics) {
                processColorDialogForTopics(panel, selectedTopics.length > 0 ? selectedTopics : new Topic[] { topic });
            }
        });
        this.customProcessors.put(AboutPlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nonnull @MustNotContainNull final Topic[] selectedTopics) {
                // NOI18N
                NbUtils.plainMessageOk(null, BUNDLE.getString("MMDGraphEditor.makePopUp.msgAboutTitle"), new AboutPanel());
            }
        });
        this.customProcessors.put(OptionsPlugin.class, new CustomJob() {

            @Override
            public void doJob(@Nonnull final PopUpMenuItemPlugin plugin, @Nonnull final MindMapPanel panel, @Nonnull final DialogProvider dialogProvider, @Nullable final Topic topic, @Nonnull @MustNotContainNull final Topic[] selectedTopics) {
                // NOI18N
                OptionsDisplayer.getDefault().open("nb-mmd-config-main");
            }
        });
    }
    return this.customProcessors;
}
Also used : PopUpMenuItemPlugin(com.igormaznitsa.mindmap.plugins.api.PopUpMenuItemPlugin) CustomJob(com.igormaznitsa.mindmap.plugins.api.CustomJob)

Aggregations

CustomJob (com.igormaznitsa.mindmap.plugins.api.CustomJob)3 PopUpMenuItemPlugin (com.igormaznitsa.mindmap.plugins.api.PopUpMenuItemPlugin)3 Nonnull (javax.annotation.Nonnull)1