Cleaning API
emmanue1
5 years ago
19 | 19 | import java.util.Map; |
20 | 20 | |
21 | 21 | public interface API { |
22 | public boolean openURI(URI uri); | |
22 | boolean openURI(URI uri); | |
23 | 23 | |
24 | public boolean openURI(int x, int y, Collection<Container.Entry> entries, String query, String fragment); | |
24 | boolean openURI(int x, int y, Collection<Container.Entry> entries, String query, String fragment); | |
25 | 25 | |
26 | public void addURI(URI uri); | |
26 | void addURI(URI uri); | |
27 | 27 | |
28 | public <T extends JComponent & UriGettable> void addPanel(String title, Icon icon, String tip, T component); | |
28 | <T extends JComponent & UriGettable> void addPanel(String title, Icon icon, String tip, T component); | |
29 | 29 | |
30 | public Collection<Action> getContextualActions(Container.Entry entry, String fragment); | |
30 | Collection<Action> getContextualActions(Container.Entry entry, String fragment); | |
31 | 31 | |
32 | public UriLoader getUriLoader(URI uri); | |
32 | UriLoader getUriLoader(URI uri); | |
33 | 33 | |
34 | public FileLoader getFileLoader(File file); | |
34 | FileLoader getFileLoader(File file); | |
35 | 35 | |
36 | public ContainerFactory getContainerFactory(Path rootPath); | |
36 | ContainerFactory getContainerFactory(Path rootPath); | |
37 | 37 | |
38 | public PanelFactory getMainPanelFactory(Container container); | |
38 | PanelFactory getMainPanelFactory(Container container); | |
39 | 39 | |
40 | public TreeNodeFactory getTreeNodeFactory(Container.Entry entry); | |
40 | TreeNodeFactory getTreeNodeFactory(Container.Entry entry); | |
41 | 41 | |
42 | public TypeFactory getTypeFactory(Container.Entry entry); | |
42 | TypeFactory getTypeFactory(Container.Entry entry); | |
43 | 43 | |
44 | public Indexer getIndexer(Container.Entry entry); | |
44 | Indexer getIndexer(Container.Entry entry); | |
45 | 45 | |
46 | public SourceSaver getSourceSaver(Container.Entry entry); | |
46 | SourceSaver getSourceSaver(Container.Entry entry); | |
47 | 47 | |
48 | public Map<String, String> getPreferences(); | |
48 | Map<String, String> getPreferences(); | |
49 | 49 | |
50 | public Collection<Indexes> getCollectionOfIndexes(); | |
50 | Collection<Indexes> getCollectionOfIndexes(); | |
51 | 51 | } |
9 | 9 | import org.jd.gui.api.model.Container; |
10 | 10 | |
11 | 11 | public interface ContainerEntryGettable { |
12 | public Container.Entry getEntry(); | |
12 | Container.Entry getEntry(); | |
13 | 13 | } |
7 | 7 | package org.jd.gui.api.feature; |
8 | 8 | |
9 | 9 | public interface ContentCopyable { |
10 | public void copy(); | |
10 | void copy(); | |
11 | 11 | } |
10 | 10 | import org.jd.gui.api.model.Indexes; |
11 | 11 | |
12 | 12 | public interface ContentIndexable { |
13 | public Indexes index(API api); | |
13 | Indexes index(API api); | |
14 | 14 | } |
11 | 11 | import java.io.OutputStream; |
12 | 12 | |
13 | 13 | public interface ContentSavable { |
14 | public String getFileName(); | |
14 | String getFileName(); | |
15 | 15 | |
16 | public void save(API api, OutputStream os); | |
16 | void save(API api, OutputStream os); | |
17 | 17 | } |
7 | 7 | package org.jd.gui.api.feature; |
8 | 8 | |
9 | 9 | public interface ContentSearchable { |
10 | public boolean highlightText(String text, boolean caseSensitive); | |
10 | boolean highlightText(String text, boolean caseSensitive); | |
11 | 11 | |
12 | public void findNext(String text, boolean caseSensitive); | |
12 | void findNext(String text, boolean caseSensitive); | |
13 | 13 | |
14 | public void findPrevious(String text, boolean caseSensitive); | |
14 | void findPrevious(String text, boolean caseSensitive); | |
15 | 15 | } |
7 | 7 | package org.jd.gui.api.feature; |
8 | 8 | |
9 | 9 | public interface ContentSelectable { |
10 | public void selectAll(); | |
10 | void selectAll(); | |
11 | 11 | } |
7 | 7 | package org.jd.gui.api.feature; |
8 | 8 | |
9 | 9 | public interface FocusedTypeGettable extends ContainerEntryGettable { |
10 | public String getFocusedTypeName(); | |
10 | String getFocusedTypeName(); | |
11 | 11 | } |
7 | 7 | package org.jd.gui.api.feature; |
8 | 8 | |
9 | 9 | public interface LineNumberNavigable { |
10 | public int getMaximumLineNumber(); | |
10 | int getMaximumLineNumber(); | |
11 | 11 | |
12 | public void goToLineNumber(int lineNumber); | |
12 | void goToLineNumber(int lineNumber); | |
13 | 13 | |
14 | public boolean checkLineNumber(int lineNumber); | |
14 | boolean checkLineNumber(int lineNumber); | |
15 | 15 | } |
9 | 9 | import javax.swing.*; |
10 | 10 | |
11 | 11 | public interface PageChangeListener { |
12 | public <T extends JComponent & UriGettable> void pageChanged(T page); | |
12 | <T extends JComponent & UriGettable> void pageChanged(T page); | |
13 | 13 | } |
7 | 7 | package org.jd.gui.api.feature; |
8 | 8 | |
9 | 9 | public interface PageChangeable { |
10 | public void addPageChangeListener(PageChangeListener listener); | |
10 | void addPageChangeListener(PageChangeListener listener); | |
11 | 11 | } |
7 | 7 | package org.jd.gui.api.feature; |
8 | 8 | |
9 | 9 | public interface PageClosable { |
10 | public boolean closePage(); | |
10 | boolean closePage(); | |
11 | 11 | } |
11 | 11 | import javax.swing.*; |
12 | 12 | |
13 | 13 | public interface PageCreator { |
14 | public <T extends JComponent & UriGettable> T createPage(API api); | |
14 | <T extends JComponent & UriGettable> T createPage(API api); | |
15 | 15 | } |
9 | 9 | import java.util.Map; |
10 | 10 | |
11 | 11 | public interface PreferencesChangeListener { |
12 | public void preferencesChanged(Map<String, String> preferences); | |
12 | void preferencesChanged(Map<String, String> preferences); | |
13 | 13 | } |
10 | 10 | import java.nio.file.Path; |
11 | 11 | |
12 | 12 | public interface SourcesSavable { |
13 | public String getSourceFileName(); | |
13 | String getSourceFileName(); | |
14 | 14 | |
15 | public int getFileCount(); | |
15 | int getFileCount(); | |
16 | 16 | |
17 | public void save(API api, Controller controller, Listener listener, Path path); | |
17 | void save(API api, Controller controller, Listener listener, Path path); | |
18 | 18 | |
19 | public interface Controller { | |
20 | public boolean isCancelled(); | |
19 | interface Controller { | |
20 | boolean isCancelled(); | |
21 | 21 | } |
22 | 22 | |
23 | public interface Listener { | |
24 | public void pathSaved(Path path); | |
23 | interface Listener { | |
24 | void pathSaved(Path path); | |
25 | 25 | } |
26 | 26 | } |
9 | 9 | import org.jd.gui.api.API; |
10 | 10 | |
11 | 11 | public interface TreeNodeExpandable { |
12 | public void populateTreeNode(API api); | |
12 | void populateTreeNode(API api); | |
13 | 13 | } |
9 | 9 | import java.net.URI; |
10 | 10 | |
11 | 11 | public interface UriGettable { |
12 | public URI getUri(); | |
12 | URI getUri(); | |
13 | 13 | } |
61 | 61 | * </ul> |
62 | 62 | */ |
63 | 63 | public interface UriOpenable { |
64 | public boolean openUri(URI uri); | |
64 | boolean openUri(URI uri); | |
65 | 65 | } |
11 | 11 | import java.util.Collection; |
12 | 12 | |
13 | 13 | public interface Container { |
14 | public String getType(); | |
14 | String getType(); | |
15 | 15 | |
16 | public Entry getRoot(); | |
16 | Entry getRoot(); | |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * File or directory |
20 | 20 | */ |
21 | public interface Entry { | |
22 | public Container getContainer(); | |
21 | interface Entry { | |
22 | Container getContainer(); | |
23 | 23 | |
24 | public Entry getParent(); | |
24 | Entry getParent(); | |
25 | 25 | |
26 | public URI getUri(); | |
26 | URI getUri(); | |
27 | 27 | |
28 | public String getPath(); | |
28 | String getPath(); | |
29 | 29 | |
30 | public boolean isDirectory(); | |
30 | boolean isDirectory(); | |
31 | 31 | |
32 | public long length(); | |
32 | long length(); | |
33 | 33 | |
34 | public InputStream getInputStream(); | |
34 | InputStream getInputStream(); | |
35 | 35 | |
36 | public Collection<Entry> getChildren(); | |
36 | Collection<Entry> getChildren(); | |
37 | 37 | } |
38 | 38 | } |
63 | 63 | * </ul> |
64 | 64 | */ |
65 | 65 | public interface Indexes { |
66 | public void waitIndexers(); | |
66 | void waitIndexers(); | |
67 | 67 | |
68 | public Map<String, Collection> getIndex(String name); | |
68 | Map<String, Collection> getIndex(String name); | |
69 | 69 | } |
9 | 9 | import javax.swing.*; |
10 | 10 | |
11 | 11 | public interface TreeNodeData { |
12 | public String getLabel(); | |
12 | String getLabel(); | |
13 | 13 | |
14 | public String getTip(); | |
14 | String getTip(); | |
15 | 15 | |
16 | public Icon getIcon(); | |
16 | Icon getIcon(); | |
17 | 17 | |
18 | public Icon getOpenIcon(); | |
18 | Icon getOpenIcon(); | |
19 | 19 | }⏎ |
10 | 10 | import java.util.Collection; |
11 | 11 | |
12 | 12 | public interface Type { |
13 | public final static int FLAG_PUBLIC = 1; | |
14 | public final static int FLAG_PRIVATE = 2; | |
15 | public final static int FLAG_PROTECTED = 4; | |
16 | public final static int FLAG_STATIC = 8; | |
17 | public final static int FLAG_FINAL = 16; | |
18 | public final static int FLAG_VARARGS = 128; | |
19 | public final static int FLAG_INTERFACE = 512; | |
20 | public final static int FLAG_ABSTRACT = 1024; | |
21 | public final static int FLAG_ANNOTATION = 8192; | |
22 | public final static int FLAG_ENUM = 16384; | |
13 | int FLAG_PUBLIC = 1; | |
14 | int FLAG_PRIVATE = 2; | |
15 | int FLAG_PROTECTED = 4; | |
16 | int FLAG_STATIC = 8; | |
17 | int FLAG_FINAL = 16; | |
18 | int FLAG_VARARGS = 128; | |
19 | int FLAG_INTERFACE = 512; | |
20 | int FLAG_ABSTRACT = 1024; | |
21 | int FLAG_ANNOTATION = 8192; | |
22 | int FLAG_ENUM = 16384; | |
23 | 23 | |
24 | public int getFlags(); | |
24 | int getFlags(); | |
25 | 25 | |
26 | public String getName(); | |
26 | String getName(); | |
27 | 27 | |
28 | public String getSuperName(); | |
28 | String getSuperName(); | |
29 | 29 | |
30 | public String getOuterName(); | |
30 | String getOuterName(); | |
31 | 31 | |
32 | public String getDisplayTypeName(); | |
32 | String getDisplayTypeName(); | |
33 | 33 | |
34 | public String getDisplayInnerTypeName(); | |
34 | String getDisplayInnerTypeName(); | |
35 | 35 | |
36 | public String getDisplayPackageName(); | |
36 | String getDisplayPackageName(); | |
37 | 37 | |
38 | public Icon getIcon(); | |
38 | Icon getIcon(); | |
39 | 39 | |
40 | public Collection<Type> getInnerTypes(); | |
40 | Collection<Type> getInnerTypes(); | |
41 | 41 | |
42 | public Collection<Field> getFields(); | |
42 | Collection<Field> getFields(); | |
43 | 43 | |
44 | public Collection<Method> getMethods(); | |
44 | Collection<Method> getMethods(); | |
45 | 45 | |
46 | public interface Field { | |
47 | public int getFlags(); | |
46 | interface Field { | |
47 | int getFlags(); | |
48 | 48 | |
49 | public String getName(); | |
49 | String getName(); | |
50 | 50 | |
51 | public String getDescriptor(); | |
51 | String getDescriptor(); | |
52 | 52 | |
53 | public String getDisplayName(); | |
53 | String getDisplayName(); | |
54 | 54 | |
55 | public Icon getIcon(); | |
55 | Icon getIcon(); | |
56 | 56 | } |
57 | 57 | |
58 | public interface Method { | |
59 | public int getFlags(); | |
58 | interface Method { | |
59 | int getFlags(); | |
60 | 60 | |
61 | public String getName(); | |
61 | String getName(); | |
62 | 62 | |
63 | public String getDescriptor(); | |
63 | String getDescriptor(); | |
64 | 64 | |
65 | public String getDisplayName(); | |
65 | String getDisplayName(); | |
66 | 66 | |
67 | public Icon getIcon(); | |
67 | Icon getIcon(); | |
68 | 68 | } |
69 | 69 | } |
12 | 12 | import java.nio.file.Path; |
13 | 13 | |
14 | 14 | public interface ContainerFactory { |
15 | public String getType(); | |
15 | String getType(); | |
16 | 16 | |
17 | public boolean accept(API api, Path rootPath); | |
17 | boolean accept(API api, Path rootPath); | |
18 | 18 | |
19 | public Container make(API api, Container.Entry parentEntry, Path rootPath); | |
19 | Container make(API api, Container.Entry parentEntry, Path rootPath); | |
20 | 20 | } |
13 | 13 | import java.util.Collection; |
14 | 14 | |
15 | 15 | public interface ContextualActionsFactory { |
16 | ||
17 | public static final String GROUP_NAME = "GroupNameKey"; | |
16 | String GROUP_NAME = "GroupNameKey"; | |
18 | 17 | |
19 | 18 | /** |
20 | 19 | * Build a collection of actions for 'entry' and 'fragment', grouped by GROUP_NAME and sorted by NAME. Null values |
23 | 22 | * @param fragment @see jd.gui.api.feature.UriOpenable |
24 | 23 | * @return a collection of actions |
25 | 24 | */ |
26 | public Collection<Action> make(API api, Container.Entry entry, String fragment); | |
25 | Collection<Action> make(API api, Container.Entry entry, String fragment); | |
27 | 26 | } |
11 | 11 | import java.io.File; |
12 | 12 | |
13 | 13 | public interface FileLoader { |
14 | public String[] getExtensions(); | |
14 | String[] getExtensions(); | |
15 | 15 | |
16 | public String getDescription(); | |
16 | String getDescription(); | |
17 | 17 | |
18 | public boolean accept(API api, File file); | |
18 | boolean accept(API api, File file); | |
19 | 19 | |
20 | public boolean load(API api, File file); | |
20 | boolean load(API api, File file); | |
21 | 21 | } |
13 | 13 | import java.util.regex.Pattern; |
14 | 14 | |
15 | 15 | public interface Indexer { |
16 | public String[] getSelectors(); | |
16 | String[] getSelectors(); | |
17 | 17 | |
18 | public Pattern getPathPattern(); | |
18 | Pattern getPathPattern(); | |
19 | 19 | |
20 | public void index(API api, Container.Entry entry, Indexes indexes); | |
20 | void index(API api, Container.Entry entry, Indexes indexes); | |
21 | 21 | } |
13 | 13 | import javax.swing.JComponent; |
14 | 14 | |
15 | 15 | public interface PanelFactory { |
16 | public String[] getTypes(); | |
16 | String[] getTypes(); | |
17 | 17 | |
18 | public <T extends JComponent & UriGettable> T make(API api, Container container); | |
18 | <T extends JComponent & UriGettable> T make(API api, Container container); | |
19 | 19 | } |
9 | 9 | import org.jd.gui.api.API; |
10 | 10 | |
11 | 11 | public interface PasteHandler { |
12 | public boolean accept(Object obj); | |
12 | boolean accept(Object obj); | |
13 | 13 | |
14 | public void paste(API api, Object obj); | |
14 | void paste(API api, Object obj); | |
15 | 15 | } |
10 | 10 | import java.util.Map; |
11 | 11 | |
12 | 12 | public interface PreferencesPanel { |
13 | public String getPreferencesGroupTitle(); | |
13 | String getPreferencesGroupTitle(); | |
14 | 14 | |
15 | public String getPreferencesPanelTitle(); | |
15 | String getPreferencesPanelTitle(); | |
16 | 16 | |
17 | public void init(Color errorBackgroundColor); | |
17 | void init(Color errorBackgroundColor); | |
18 | 18 | |
19 | public boolean isActivated(); | |
19 | boolean isActivated(); | |
20 | 20 | |
21 | public void loadPreferences(Map<String, String> preferences); | |
21 | void loadPreferences(Map<String, String> preferences); | |
22 | 22 | |
23 | public void savePreferences(Map<String, String> preferences); | |
23 | void savePreferences(Map<String, String> preferences); | |
24 | 24 | |
25 | public boolean arePreferencesValid(); | |
25 | boolean arePreferencesValid(); | |
26 | 26 | |
27 | public void addPreferencesChangeListener(PreferencesPanelChangeListener listener); | |
27 | void addPreferencesChangeListener(PreferencesPanelChangeListener listener); | |
28 | 28 | |
29 | public interface PreferencesPanelChangeListener { | |
30 | public void preferencesPanelChanged(PreferencesPanel source); | |
29 | interface PreferencesPanelChangeListener { | |
30 | void preferencesPanelChanged(PreferencesPanel source); | |
31 | 31 | } |
32 | 32 | } |
13 | 13 | import java.util.regex.Pattern; |
14 | 14 | |
15 | 15 | public interface SourceSaver { |
16 | public String[] getSelectors(); | |
16 | String[] getSelectors(); | |
17 | 17 | |
18 | public Pattern getPathPattern(); | |
18 | Pattern getPathPattern(); | |
19 | 19 | |
20 | public String getSourcePath(Container.Entry entry); | |
20 | String getSourcePath(Container.Entry entry); | |
21 | 21 | |
22 | public int getFileCount(API api, Container.Entry entry); | |
22 | int getFileCount(API api, Container.Entry entry); | |
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Check parent path, build source file name, create NIO path and save the content. |
26 | 26 | */ |
27 | public void save(API api, Controller controller, Listener listener, Path rootPath, Container.Entry entry); | |
27 | void save(API api, Controller controller, Listener listener, Path rootPath, Container.Entry entry); | |
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Save content: |
33 | 33 | * <li>For directory, call 'save' for each children.</li> |
34 | 34 | * </ul> |
35 | 35 | */ |
36 | public void saveContent(API api, Controller controller, Listener listener, Path rootPath, Path path, Container.Entry entry); | |
36 | void saveContent(API api, Controller controller, Listener listener, Path rootPath, Path path, Container.Entry entry); | |
37 | 37 | |
38 | public interface Controller { | |
39 | public boolean isCancelled(); | |
38 | interface Controller { | |
39 | boolean isCancelled(); | |
40 | 40 | } |
41 | 41 | |
42 | public interface Listener { | |
43 | public void pathSaved(Path path); | |
42 | interface Listener { | |
43 | void pathSaved(Path path); | |
44 | 44 | } |
45 | 45 | } |
16 | 16 | import java.util.regex.Pattern; |
17 | 17 | |
18 | 18 | public interface TreeNodeFactory { |
19 | public String[] getSelectors(); | |
19 | String[] getSelectors(); | |
20 | 20 | |
21 | public Pattern getPathPattern(); | |
21 | Pattern getPathPattern(); | |
22 | 22 | |
23 | public <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry); | |
23 | <T extends DefaultMutableTreeNode & ContainerEntryGettable & UriGettable> T make(API api, Container.Entry entry); | |
24 | 24 | } |
14 | 14 | import java.util.regex.Pattern; |
15 | 15 | |
16 | 16 | public interface TypeFactory { |
17 | public String[] getSelectors(); | |
17 | String[] getSelectors(); | |
18 | 18 | |
19 | public Pattern getPathPattern(); | |
19 | Pattern getPathPattern(); | |
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @return all root types contains in 'entry' |
23 | 23 | */ |
24 | public Collection<Type> make(API api, Container.Entry entry); | |
24 | Collection<Type> make(API api, Container.Entry entry); | |
25 | 25 | |
26 | 26 | /** |
27 | 27 | * @param fragment @see jd.gui.api.feature.UriOpenable |
28 | 28 | * @return if 'fragment' is null, return the main type in 'entry', |
29 | 29 | * otherwise, return the type or sub-type matching with 'fragment' |
30 | 30 | */ |
31 | public Type make(API api, Container.Entry entry, String fragment); | |
31 | Type make(API api, Container.Entry entry, String fragment); | |
32 | 32 | } |