Skip to content

Commit b2e28cd

Browse files
committed
WIP
1 parent 7545da0 commit b2e28cd

33 files changed

+1510
-113
lines changed

context/src/main/java/org/scijava/Context.java

Lines changed: 572 additions & 0 deletions
Large diffs are not rendered by default.

indexer/pom.xml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>org.scijava</groupId>
7+
<artifactId>pom-scijava-core</artifactId>
8+
<version>0.1.0-SNAPSHOT</version>
9+
</parent>
10+
11+
<artifactId>scijava-indexer</artifactId>
12+
13+
<name>SciJava Indexer</name>
14+
<description>SciJava Indexer</description>
15+
<url>https://github.com/scijava/scijava-ops</url>
16+
<inceptionYear>2014</inceptionYear>
17+
<organization>
18+
<name>SciJava</name>
19+
<url>http://www.scijava.org/</url>
20+
</organization>
21+
<licenses>
22+
<license>
23+
<name>Simplified BSD License</name>
24+
<distribution>repo</distribution>
25+
</license>
26+
</licenses>
27+
28+
<developers>
29+
<developer>
30+
<id>ctrueden</id>
31+
<name>Curtis Rueden</name>
32+
<url>http://imagej.net/User:Rueden</url>
33+
<roles>
34+
<role>founder</role>
35+
<role>lead</role>
36+
<role>developer</role>
37+
<role>debugger</role>
38+
<role>reviewer</role>
39+
<role>support</role>
40+
<role>maintainer</role>
41+
</roles>
42+
</developer>
43+
<developer>
44+
<id>dietzc</id>
45+
<name>Christian Dietz</name>
46+
<url>http://imagej.net/User:Dietzc</url>
47+
<roles>
48+
<role>founder</role>
49+
<role>lead</role>
50+
<role>developer</role>
51+
<role>debugger</role>
52+
<role>reviewer</role>
53+
<role>support</role>
54+
<role>maintainer</role>
55+
</roles>
56+
</developer>
57+
</developers>
58+
<contributors>
59+
<contributor>
60+
<name>None</name>
61+
</contributor>
62+
</contributors>
63+
64+
<mailingLists>
65+
<mailingList>
66+
<name>SciJava</name>
67+
<subscribe>https://groups.google.com/group/scijava</subscribe>
68+
<unsubscribe>https://groups.google.com/group/scijava</unsubscribe>
69+
<post>scijava@googlegroups.com</post>
70+
<archive>https://groups.google.com/group/scijava</archive>
71+
</mailingList>
72+
</mailingLists>
73+
74+
<scm>
75+
<connection>scm:git:git://github.com/scijava/scijava-ops</connection>
76+
<developerConnection>scm:git:git@github.com:scijava/scijava-ops</developerConnection>
77+
<tag>HEAD</tag>
78+
<url>https://github.com/scijava/scijava-ops</url>
79+
</scm>
80+
<issueManagement>
81+
<system>GitHub Issues</system>
82+
<url>https://github.com/scijava/scijava-ops/issues</url>
83+
</issueManagement>
84+
<ciManagement>
85+
<system>Travis CI</system>
86+
<url>https://travis-ci.org/scijava/scijava-ops</url>
87+
</ciManagement>
88+
89+
<properties>
90+
<license.licenseName>bsd_2</license.licenseName>
91+
<license.copyrightOwners>SciJava developers.</license.copyrightOwners>
92+
</properties>
93+
</project>

plugin/pom.xml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>org.scijava</groupId>
7+
<artifactId>pom-scijava-core</artifactId>
8+
<version>0.1.0-SNAPSHOT</version>
9+
</parent>
10+
11+
<artifactId>scijava-plugin</artifactId>
12+
13+
<name>SciJava Plugin</name>
14+
<description>SciJava Plugin</description>
15+
<url>https://github.com/scijava/scijava-ops</url>
16+
<inceptionYear>2014</inceptionYear>
17+
<organization>
18+
<name>SciJava</name>
19+
<url>http://www.scijava.org/</url>
20+
</organization>
21+
<licenses>
22+
<license>
23+
<name>Simplified BSD License</name>
24+
<distribution>repo</distribution>
25+
</license>
26+
</licenses>
27+
28+
<developers>
29+
<developer>
30+
<id>ctrueden</id>
31+
<name>Curtis Rueden</name>
32+
<url>http://imagej.net/User:Rueden</url>
33+
<roles>
34+
<role>founder</role>
35+
<role>lead</role>
36+
<role>developer</role>
37+
<role>debugger</role>
38+
<role>reviewer</role>
39+
<role>support</role>
40+
<role>maintainer</role>
41+
</roles>
42+
</developer>
43+
<developer>
44+
<id>dietzc</id>
45+
<name>Christian Dietz</name>
46+
<url>http://imagej.net/User:Dietzc</url>
47+
<roles>
48+
<role>founder</role>
49+
<role>lead</role>
50+
<role>developer</role>
51+
<role>debugger</role>
52+
<role>reviewer</role>
53+
<role>support</role>
54+
<role>maintainer</role>
55+
</roles>
56+
</developer>
57+
</developers>
58+
<contributors>
59+
<contributor>
60+
<name>None</name>
61+
</contributor>
62+
</contributors>
63+
64+
<mailingLists>
65+
<mailingList>
66+
<name>SciJava</name>
67+
<subscribe>https://groups.google.com/group/scijava</subscribe>
68+
<unsubscribe>https://groups.google.com/group/scijava</unsubscribe>
69+
<post>scijava@googlegroups.com</post>
70+
<archive>https://groups.google.com/group/scijava</archive>
71+
</mailingList>
72+
</mailingLists>
73+
74+
<scm>
75+
<connection>scm:git:git://github.com/scijava/scijava-ops</connection>
76+
<developerConnection>scm:git:git@github.com:scijava/scijava-ops</developerConnection>
77+
<tag>HEAD</tag>
78+
<url>https://github.com/scijava/scijava-ops</url>
79+
</scm>
80+
<issueManagement>
81+
<system>GitHub Issues</system>
82+
<url>https://github.com/scijava/scijava-ops/issues</url>
83+
</issueManagement>
84+
<ciManagement>
85+
<system>Travis CI</system>
86+
<url>https://travis-ci.org/scijava/scijava-ops</url>
87+
</ciManagement>
88+
89+
<properties>
90+
<license.licenseName>bsd_2</license.licenseName>
91+
<license.copyrightOwners>SciJava developers.</license.copyrightOwners>
92+
</properties>
93+
</project>
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
/*
2+
* #%L
3+
* SciJava Common shared library for SciJava software.
4+
* %%
5+
* Copyright (C) 2009 - 2017 Board of Regents of the University of
6+
* Wisconsin-Madison, Broad Institute of MIT and Harvard, Max Planck
7+
* Institute of Molecular Cell Biology and Genetics, University of
8+
* Konstanz, and KNIME GmbH.
9+
* %%
10+
* Redistribution and use in source and binary forms, with or without
11+
* modification, are permitted provided that the following conditions are met:
12+
*
13+
* 1. Redistributions of source code must retain the above copyright notice,
14+
* this list of conditions and the following disclaimer.
15+
* 2. Redistributions in binary form must reproduce the above copyright notice,
16+
* this list of conditions and the following disclaimer in the documentation
17+
* and/or other materials provided with the distribution.
18+
*
19+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
23+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29+
* POSSIBILITY OF SUCH DAMAGE.
30+
* #L%
31+
*/
32+
33+
package org.scijava.plugin;
34+
35+
import java.lang.annotation.ElementType;
36+
import java.lang.annotation.Retention;
37+
import java.lang.annotation.RetentionPolicy;
38+
import java.lang.annotation.Target;
39+
40+
import org.scijava.Priority;
41+
import org.scijava.UIDetails;
42+
import org.scijava.annotations.Indexable;
43+
44+
/**
45+
* Annotation identifying a plugin, which gets loaded by SciJava's dynamic
46+
* discovery mechanism.
47+
*
48+
* @author Curtis Rueden
49+
* @see SciJavaPlugin
50+
* @see PluginService
51+
*/
52+
@Retention(RetentionPolicy.RUNTIME)
53+
@Target(ElementType.TYPE)
54+
@Indexable
55+
public @interface Plugin {
56+
57+
/** @deprecated Use {@link UIDetails#APPLICATION_MENU_ROOT} instead. */
58+
@Deprecated
59+
String APPLICATION_MENU_ROOT = "app";
60+
61+
/**
62+
* @deprecated Use a context-specific menu root string instead. This one is
63+
* too general. There is no such thing as a "default context menu"
64+
* since such a thing wouldn't be a context menu!
65+
*/
66+
@Deprecated
67+
String CONTEXT_MENU_ROOT = "context";
68+
69+
/** The type of plugin; e.g., {@link org.scijava.service.Service}. */
70+
Class<? extends SciJavaPlugin> type();
71+
72+
/** The name of the plugin. */
73+
String name() default "";
74+
75+
/** The human-readable label to use (e.g., in the menu structure). */
76+
String label() default "";
77+
78+
/** A longer description of the plugin (e.g., for use as a tool tip). */
79+
String description() default "";
80+
81+
/**
82+
* Abbreviated menu path defining where the plugin is shown in the menu
83+
* structure. Uses greater than signs ({@code >}) as a separator; e.g.: "Image
84+
* &gt; Overlay &gt; Properties..." defines a "Properties..." menu item within
85+
* the "Overlay" submenu of the "Image" menu. Use either {@link #menuPath} or
86+
* {@link #menu} but not both.
87+
*/
88+
String menuPath() default "";
89+
90+
/**
91+
* Full menu path defining where the plugin is shown in the menu structure.
92+
* This construction allows menus to be fully specified including mnemonics,
93+
* accelerators and icons. Use either {@link #menuPath} or {@link #menu} but
94+
* not both.
95+
*/
96+
Menu[] menu() default {};
97+
98+
/**
99+
* String identifier naming the menu to which this plugin belongs, or in the
100+
* case of a tool, the context menu that should be displayed while the tool is
101+
* active. The default value of {@link UIDetails#APPLICATION_MENU_ROOT}
102+
* references the menu structure of the primary application window.
103+
*/
104+
String menuRoot() default UIDetails.APPLICATION_MENU_ROOT;
105+
106+
/** Path to the plugin's icon (e.g., shown in the menu structure). */
107+
String iconPath() default "";
108+
109+
/**
110+
* The plugin index returns plugins sorted by priority. For example, this is
111+
* useful for {@link org.scijava.service.Service}s to control which service
112+
* implementation is chosen when multiple implementations are present in the
113+
* classpath, as well as to force instantiation of one service over another
114+
* when the dependency hierarchy does not dictate otherwise.
115+
* <p>
116+
* Any double value is allowed, but for convenience, there are some presets:
117+
* </p>
118+
* <ul>
119+
* <li>{@link Priority#FIRST}</li>
120+
* <li>{@link Priority#VERY_HIGH}</li>
121+
* <li>{@link Priority#HIGH}</li>
122+
* <li>{@link Priority#NORMAL}</li>
123+
* <li>{@link Priority#LOW}</li>
124+
* <li>{@link Priority#VERY_LOW}</li>
125+
* <li>{@link Priority#LAST}</li>
126+
* </ul>
127+
*
128+
* @see org.scijava.service.Service
129+
*/
130+
double priority() default Priority.NORMAL;
131+
132+
/**
133+
* Whether the plugin can be selected in the user interface. A plugin's
134+
* selection state (if any) is typically rendered in the menu structure using
135+
* a checkbox or radio button menu item (see {@link #selectionGroup}).
136+
*/
137+
boolean selectable() default false;
138+
139+
/**
140+
* For selectable plugins, specifies a name defining a group of linked
141+
* plugins, only one of which is selected at any given time. Typically this is
142+
* rendered in the menu structure as a group of radio button menu items. If no
143+
* group is given, the plugin is assumed to be a standalone toggle, and
144+
* typically rendered as a checkbox menu item.
145+
*/
146+
String selectionGroup() default "";
147+
148+
/**
149+
* When false, the plugin is grayed out in the user interface, if applicable.
150+
*/
151+
boolean enabled() default true;
152+
153+
/** When false, the plugin is not displayed in the user interface. */
154+
boolean visible() default true;
155+
156+
/**
157+
* Provides a "hint" as to whether the plugin would behave correctly in a
158+
* headless context.
159+
* <p>
160+
* Plugin developers should not specify {@code headless = true} unless the
161+
* plugin refrains from using any UI-specific features (e.g., AWT or Swing
162+
* calls).
163+
* </p>
164+
* <p>
165+
* Of course, merely setting this flag does not guarantee that the plugin will
166+
* not invoke any headless-incompatible functionality, but it provides an
167+
* extra safety net for downstream headless code that wishes to be
168+
* conservative in which plugins it allows to execute.
169+
* </p>
170+
*/
171+
boolean headless() default false;
172+
173+
/** Defines a function that is called to initialize the plugin in some way. */
174+
String initializer() default "";
175+
176+
/**
177+
* A list of additional attributes which can be used to extend this annotation
178+
* beyond its built-in capabilities.
179+
* <p>
180+
* Note to developers: when designing new plugin types, it is tempting to use
181+
* this attribute to store additional information about each plugin. However,
182+
* we suggest doing so only if you need that additional information before
183+
* creating an instance of the plugin: e.g., to decide whether to instantiate
184+
* one, or even whether to load the annotated plugin class at all. If you are
185+
* going to create a plugin instance anyway, it is cleaner and more type-safe
186+
* to add proper API methods to the plugin type's interface reporting the same
187+
* information.
188+
* </p>
189+
*/
190+
Attr[] attrs() default {};
191+
192+
}

0 commit comments

Comments
 (0)