Skip to content

Commit

Permalink
Cleaning API
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanue1 committed Mar 17, 2019
1 parent a57a28b commit 9f77ed9
Show file tree
Hide file tree
Showing 33 changed files with 139 additions and 140 deletions.
30 changes: 15 additions & 15 deletions api/src/main/java/org/jd/gui/api/API.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,33 @@
import java.util.Map;

public interface API {
public boolean openURI(URI uri);
boolean openURI(URI uri);

public boolean openURI(int x, int y, Collection<Container.Entry> entries, String query, String fragment);
boolean openURI(int x, int y, Collection<Container.Entry> entries, String query, String fragment);

public void addURI(URI uri);
void addURI(URI uri);

public <T extends JComponent & UriGettable> void addPanel(String title, Icon icon, String tip, T component);
<T extends JComponent & UriGettable> void addPanel(String title, Icon icon, String tip, T component);

public Collection<Action> getContextualActions(Container.Entry entry, String fragment);
Collection<Action> getContextualActions(Container.Entry entry, String fragment);

public UriLoader getUriLoader(URI uri);
UriLoader getUriLoader(URI uri);

public FileLoader getFileLoader(File file);
FileLoader getFileLoader(File file);

public ContainerFactory getContainerFactory(Path rootPath);
ContainerFactory getContainerFactory(Path rootPath);

public PanelFactory getMainPanelFactory(Container container);
PanelFactory getMainPanelFactory(Container container);

public TreeNodeFactory getTreeNodeFactory(Container.Entry entry);
TreeNodeFactory getTreeNodeFactory(Container.Entry entry);

public TypeFactory getTypeFactory(Container.Entry entry);
TypeFactory getTypeFactory(Container.Entry entry);

public Indexer getIndexer(Container.Entry entry);
Indexer getIndexer(Container.Entry entry);

public SourceSaver getSourceSaver(Container.Entry entry);
SourceSaver getSourceSaver(Container.Entry entry);

public Map<String, String> getPreferences();
Map<String, String> getPreferences();

public Collection<Indexes> getCollectionOfIndexes();
Collection<Indexes> getCollectionOfIndexes();
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
import org.jd.gui.api.model.Container;

public interface ContainerEntryGettable {
public Container.Entry getEntry();
Container.Entry getEntry();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
package org.jd.gui.api.feature;

public interface ContentCopyable {
public void copy();
void copy();
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
import org.jd.gui.api.model.Indexes;

public interface ContentIndexable {
public Indexes index(API api);
Indexes index(API api);
}
4 changes: 2 additions & 2 deletions api/src/main/java/org/jd/gui/api/feature/ContentSavable.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.io.OutputStream;

public interface ContentSavable {
public String getFileName();
String getFileName();

public void save(API api, OutputStream os);
void save(API api, OutputStream os);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
package org.jd.gui.api.feature;

public interface ContentSearchable {
public boolean highlightText(String text, boolean caseSensitive);
boolean highlightText(String text, boolean caseSensitive);

public void findNext(String text, boolean caseSensitive);
void findNext(String text, boolean caseSensitive);

public void findPrevious(String text, boolean caseSensitive);
void findPrevious(String text, boolean caseSensitive);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
package org.jd.gui.api.feature;

public interface ContentSelectable {
public void selectAll();
void selectAll();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
package org.jd.gui.api.feature;

public interface FocusedTypeGettable extends ContainerEntryGettable {
public String getFocusedTypeName();
String getFocusedTypeName();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
package org.jd.gui.api.feature;

public interface LineNumberNavigable {
public int getMaximumLineNumber();
int getMaximumLineNumber();

public void goToLineNumber(int lineNumber);
void goToLineNumber(int lineNumber);

public boolean checkLineNumber(int lineNumber);
boolean checkLineNumber(int lineNumber);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
import javax.swing.*;

public interface PageChangeListener {
public <T extends JComponent & UriGettable> void pageChanged(T page);
<T extends JComponent & UriGettable> void pageChanged(T page);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
package org.jd.gui.api.feature;

public interface PageChangeable {
public void addPageChangeListener(PageChangeListener listener);
void addPageChangeListener(PageChangeListener listener);
}
2 changes: 1 addition & 1 deletion api/src/main/java/org/jd/gui/api/feature/PageClosable.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
package org.jd.gui.api.feature;

public interface PageClosable {
public boolean closePage();
boolean closePage();
}
2 changes: 1 addition & 1 deletion api/src/main/java/org/jd/gui/api/feature/PageCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
import javax.swing.*;

public interface PageCreator {
public <T extends JComponent & UriGettable> T createPage(API api);
<T extends JComponent & UriGettable> T createPage(API api);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
import java.util.Map;

public interface PreferencesChangeListener {
public void preferencesChanged(Map<String, String> preferences);
void preferencesChanged(Map<String, String> preferences);
}
14 changes: 7 additions & 7 deletions api/src/main/java/org/jd/gui/api/feature/SourcesSavable.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
import java.nio.file.Path;

public interface SourcesSavable {
public String getSourceFileName();
String getSourceFileName();

public int getFileCount();
int getFileCount();

public void save(API api, Controller controller, Listener listener, Path path);
void save(API api, Controller controller, Listener listener, Path path);

public interface Controller {
public boolean isCancelled();
interface Controller {
boolean isCancelled();
}

public interface Listener {
public void pathSaved(Path path);
interface Listener {
void pathSaved(Path path);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
import org.jd.gui.api.API;

public interface TreeNodeExpandable {
public void populateTreeNode(API api);
void populateTreeNode(API api);
}
2 changes: 1 addition & 1 deletion api/src/main/java/org/jd/gui/api/feature/UriGettable.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
import java.net.URI;

public interface UriGettable {
public URI getUri();
URI getUri();
}
2 changes: 1 addition & 1 deletion api/src/main/java/org/jd/gui/api/feature/UriOpenable.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@
* </ul>
*/
public interface UriOpenable {
public boolean openUri(URI uri);
boolean openUri(URI uri);
}
22 changes: 11 additions & 11 deletions api/src/main/java/org/jd/gui/api/model/Container.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
import java.util.Collection;

public interface Container {
public String getType();
String getType();

public Entry getRoot();
Entry getRoot();

/**
* File or directory
*/
public interface Entry {
public Container getContainer();
interface Entry {
Container getContainer();

public Entry getParent();
Entry getParent();

public URI getUri();
URI getUri();

public String getPath();
String getPath();

public boolean isDirectory();
boolean isDirectory();

public long length();
long length();

public InputStream getInputStream();
InputStream getInputStream();

public Collection<Entry> getChildren();
Collection<Entry> getChildren();
}
}
4 changes: 2 additions & 2 deletions api/src/main/java/org/jd/gui/api/model/Indexes.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
* </ul>
*/
public interface Indexes {
public void waitIndexers();
void waitIndexers();

public Map<String, Collection> getIndex(String name);
Map<String, Collection> getIndex(String name);
}
8 changes: 4 additions & 4 deletions api/src/main/java/org/jd/gui/api/model/TreeNodeData.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import javax.swing.*;

public interface TreeNodeData {
public String getLabel();
String getLabel();

public String getTip();
String getTip();

public Icon getIcon();
Icon getIcon();

public Icon getOpenIcon();
Icon getOpenIcon();
}
66 changes: 33 additions & 33 deletions api/src/main/java/org/jd/gui/api/model/Type.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,60 +11,60 @@
import java.util.Collection;

public interface Type {
public final static int FLAG_PUBLIC = 1;
public final static int FLAG_PRIVATE = 2;
public final static int FLAG_PROTECTED = 4;
public final static int FLAG_STATIC = 8;
public final static int FLAG_FINAL = 16;
public final static int FLAG_VARARGS = 128;
public final static int FLAG_INTERFACE = 512;
public final static int FLAG_ABSTRACT = 1024;
public final static int FLAG_ANNOTATION = 8192;
public final static int FLAG_ENUM = 16384;
int FLAG_PUBLIC = 1;
int FLAG_PRIVATE = 2;
int FLAG_PROTECTED = 4;
int FLAG_STATIC = 8;
int FLAG_FINAL = 16;
int FLAG_VARARGS = 128;
int FLAG_INTERFACE = 512;
int FLAG_ABSTRACT = 1024;
int FLAG_ANNOTATION = 8192;
int FLAG_ENUM = 16384;

public int getFlags();
int getFlags();

public String getName();
String getName();

public String getSuperName();
String getSuperName();

public String getOuterName();
String getOuterName();

public String getDisplayTypeName();
String getDisplayTypeName();

public String getDisplayInnerTypeName();
String getDisplayInnerTypeName();

public String getDisplayPackageName();
String getDisplayPackageName();

public Icon getIcon();
Icon getIcon();

public Collection<Type> getInnerTypes();
Collection<Type> getInnerTypes();

public Collection<Field> getFields();
Collection<Field> getFields();

public Collection<Method> getMethods();
Collection<Method> getMethods();

public interface Field {
public int getFlags();
interface Field {
int getFlags();

public String getName();
String getName();

public String getDescriptor();
String getDescriptor();

public String getDisplayName();
String getDisplayName();

public Icon getIcon();
Icon getIcon();
}

public interface Method {
public int getFlags();
interface Method {
int getFlags();

public String getName();
String getName();

public String getDescriptor();
String getDescriptor();

public String getDisplayName();
String getDisplayName();

public Icon getIcon();
Icon getIcon();
}
}
6 changes: 3 additions & 3 deletions api/src/main/java/org/jd/gui/spi/ContainerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import java.nio.file.Path;

public interface ContainerFactory {
public String getType();
String getType();

public boolean accept(API api, Path rootPath);
boolean accept(API api, Path rootPath);

public Container make(API api, Container.Entry parentEntry, Path rootPath);
Container make(API api, Container.Entry parentEntry, Path rootPath);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
import java.util.Collection;

public interface ContextualActionsFactory {

public static final String GROUP_NAME = "GroupNameKey";
String GROUP_NAME = "GroupNameKey";

/**
* Build a collection of actions for 'entry' and 'fragment', grouped by GROUP_NAME and sorted by NAME. Null values
Expand All @@ -24,5 +23,5 @@ public interface ContextualActionsFactory {
* @param fragment @see jd.gui.api.feature.UriOpenable
* @return a collection of actions
*/
public Collection<Action> make(API api, Container.Entry entry, String fragment);
Collection<Action> make(API api, Container.Entry entry, String fragment);
}
Loading

0 comments on commit 9f77ed9

Please sign in to comment.