Skip to content

Commit

Permalink
Renames final static fields
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanue1 committed May 25, 2015
1 parent 3db50b4 commit da96bad
Show file tree
Hide file tree
Showing 30 changed files with 133 additions and 135 deletions.
6 changes: 3 additions & 3 deletions app/src/main/groovy/jd/gui/view/OpenTypeHierarchyView.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import java.awt.event.MouseAdapter
import java.awt.event.MouseEvent

class OpenTypeHierarchyView {
static final ImageIcon rootClassIcon = new ImageIcon(OpenTypeHierarchyView.class.classLoader.getResource('images/generate_class.png'))
static final ImageIcon rootInterfaceIcon = new ImageIcon(OpenTypeHierarchyView.class.classLoader.getResource('images/generate_int.png'))
static final ImageIcon ROOT_CLASS_ICON = new ImageIcon(OpenTypeHierarchyView.class.classLoader.getResource('images/generate_class.png'))
static final ImageIcon ROOT_INTERFACE_ICON = new ImageIcon(OpenTypeHierarchyView.class.classLoader.getResource('images/generate_int.png'))

SwingBuilder swing
API api
Expand Down Expand Up @@ -213,7 +213,7 @@ class OpenTypeHierarchyView {
def package_ = superTypeName.substring(0, lastPackageSeparatorIndex).replace('/', '.')
def name = superTypeName.substring(lastPackageSeparatorIndex + 1).replace('$', '.')
def label = package_ ? name + ' - ' + package_ : name
def icon = ((type.flags & Type.FLAG_INTERFACE) == 0) ? rootClassIcon : rootInterfaceIcon
def icon = ((type.flags & Type.FLAG_INTERFACE) == 0) ? ROOT_CLASS_ICON : ROOT_INTERFACE_ICON
def rootTreeNode = new TreeNode(null, superTypeName, null, new TreeNodeBean(label, icon))

if (package_.startsWith('java.')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import java.awt.event.MouseEvent
import java.awt.event.MouseListener

class TabbedPanel extends JPanel implements PreferencesChangeListener {
static final ImageIcon closeIcon = new ImageIcon(TabbedPanel.class.classLoader.getResource('images/close.gif'))
static final ImageIcon closeActivateIcon = new ImageIcon(TabbedPanel.class.classLoader.getResource('images/close_active.gif'))
static final ImageIcon CLOSE_ICON = new ImageIcon(TabbedPanel.class.classLoader.getResource('images/close.gif'))
static final ImageIcon CLOSE_ACTIVE_ICON = new ImageIcon(TabbedPanel.class.classLoader.getResource('images/close_active.gif'))

static final String TAB_LAYOUT = 'UITabsPreferencesProvider.singleLineTabs'

Expand Down Expand Up @@ -94,13 +94,13 @@ class TabbedPanel extends JPanel implements PreferencesChangeListener {
page.preferencesChanged(preferences)
}
// Add a new tab
JLabel tabCloseButton = new JLabel(closeIcon)
JLabel tabCloseButton = new JLabel(CLOSE_ICON)
tabCloseButton.toolTipText = 'Close this panel'
tabCloseButton.addMouseListener(new MouseListener() {
void mousePressed(MouseEvent e) {}
void mouseReleased(MouseEvent e) {}
void mouseEntered(MouseEvent e) { e.source.icon = closeActivateIcon }
void mouseExited(MouseEvent e) { e.source.icon = closeIcon }
void mouseEntered(MouseEvent e) { e.source.icon = TabbedPanel.@CLOSE_ACTIVE_ICON }
void mouseExited(MouseEvent e) { e.source.icon = TabbedPanel.@CLOSE_ICON }
void mouseClicked(MouseEvent e) { removeComponent(page) }
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import javax.swing.tree.DefaultMutableTreeNode
import java.util.regex.Pattern

class ClassFileTreeNodeFactoryProvider implements TreeNodeFactory {
static final ImageIcon classFileIcon = new ImageIcon(ClassFileTreeNodeFactoryProvider.class.classLoader.getResource('images/classf_obj.png'))
static final ImageIcon CLASS_FILE_ICON = new ImageIcon(ClassFileTreeNodeFactoryProvider.class.classLoader.getResource('images/classf_obj.png'))

static {
// Early class loading
Expand All @@ -37,7 +37,7 @@ class ClassFileTreeNodeFactoryProvider implements TreeNodeFactory {
public <T extends DefaultMutableTreeNode & UriGettable> T make(API api, Container.Entry entry) {
int lastSlashIndex = entry.path.lastIndexOf('/')
def name = entry.path.substring(lastSlashIndex+1)
return new ClassFileTreeNode(entry, new TreeNodeBean(label:name, icon: classFileIcon))
return new ClassFileTreeNode(entry, new TreeNodeBean(label:name, icon:CLASS_FILE_ICON))
}

static abstract class AbstractTreeNode extends DefaultMutableTreeNode implements UriGettable, PageCreator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import javax.swing.JComponent
import javax.swing.tree.DefaultMutableTreeNode

class CssFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
static final ImageIcon icon = new ImageIcon(HtmlFileTreeNodeFactoryProvider.class.classLoader.getResource('images/css_obj.png'))
static final ImageIcon ICON = new ImageIcon(HtmlFileTreeNodeFactoryProvider.class.classLoader.getResource('images/css_obj.png'))

String[] getSelectors() { ['*:file:*.css'] }

public <T extends DefaultMutableTreeNode & UriGettable> T make(API api, Container.Entry entry) {
int lastSlashIndex = entry.path.lastIndexOf('/')
def name = entry.path.substring(lastSlashIndex+1)
return new TreeNode(entry, new TreeNodeBean(label:name, icon:icon, tip:"Location: $entry.uri.path"))
return new TreeNode(entry, new TreeNodeBean(label:name, icon:ICON, tip:"Location: $entry.uri.path"))
}

static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import javax.swing.tree.DefaultMutableTreeNode
import java.util.regex.Pattern

class DirectoryTreeNodeFactoryProvider implements TreeNodeFactory {
static final ImageIcon icon = new ImageIcon(DirectoryTreeNodeFactoryProvider.class.classLoader.getResource('images/folder.gif'))
static final ImageIcon openIcon = new ImageIcon(DirectoryTreeNodeFactoryProvider.class.classLoader.getResource('images/folder_open.png'))
static final ImageIcon ICON = new ImageIcon(DirectoryTreeNodeFactoryProvider.class.classLoader.getResource('images/folder.gif'))
static final ImageIcon OPEN_ICON = new ImageIcon(DirectoryTreeNodeFactoryProvider.class.classLoader.getResource('images/folder_open.png'))

String[] getSelectors() { ['*:dir:*'] }
Pattern getPathPattern() { null }
Expand Down Expand Up @@ -47,8 +47,8 @@ class DirectoryTreeNodeFactoryProvider implements TreeNodeFactory {
return node
}

ImageIcon getIcon() { icon }
ImageIcon getOpenIcon() { openIcon }
ImageIcon getIcon() { ICON }
ImageIcon getOpenIcon() { OPEN_ICON }

static class TreeNode extends DefaultMutableTreeNode implements UriGettable, TreeNodeExpandable {
Container.Entry entry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import javax.swing.*
import javax.swing.tree.DefaultMutableTreeNode

class DtdFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
static final ImageIcon icon = new ImageIcon(DtdFileTreeNodeFactoryProvider.class.classLoader.getResource('images/dtd_obj.gif'))
static final ImageIcon ICON = new ImageIcon(DtdFileTreeNodeFactoryProvider.class.classLoader.getResource('images/dtd_obj.gif'))

String[] getSelectors() { ['*:file:*.dtd'] }

public <T extends DefaultMutableTreeNode & UriGettable> T make(API api, Container.Entry entry) {
int lastSlashIndex = entry.path.lastIndexOf('/')
def name = entry.path.substring(lastSlashIndex+1)
return new TreeNode(entry, new TreeNodeBean(label:name, icon:icon, tip:"Location: $entry.uri.path"))
return new TreeNode(entry, new TreeNodeBean(label:name, icon:ICON, tip:"Location: $entry.uri.path"))
}

static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import javax.swing.*
import javax.swing.tree.DefaultMutableTreeNode

class EarFileTreeNodeFactoryProvider extends ZipFileTreeNodeFactoryProvider {
static final ImageIcon icon = new ImageIcon(JarFileTreeNodeFactoryProvider.class.classLoader.getResource('images/ear_obj.gif'))
static final ImageIcon ICON = new ImageIcon(JarFileTreeNodeFactoryProvider.class.classLoader.getResource('images/ear_obj.gif'))

String[] getSelectors() { ['*:file:*.ear'] }

public <T extends DefaultMutableTreeNode & UriGettable> T make(API api, Container.Entry entry) {
int lastSlashIndex = entry.path.lastIndexOf('/')
def name = entry.path.substring(lastSlashIndex+1)
def node = new TreeNode(entry, 'ear', new TreeNodeBean(label:name, icon:icon))
def node = new TreeNode(entry, 'ear', new TreeNodeBean(label:name, icon:ICON))
// Add dummy node
node.add(new DefaultMutableTreeNode())
return node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import javax.swing.*
import javax.swing.tree.DefaultMutableTreeNode

class EjbJarXmlFileTreeNodeFactoryProvider extends FileTreeNodeFactoryProvider {
static final ImageIcon icon = new ImageIcon(ManifestFileTreeNodeFactoryProvider.class.classLoader.getResource('images/xml_obj.gif'))
static final ImageIcon ICON = new ImageIcon(ManifestFileTreeNodeFactoryProvider.class.classLoader.getResource('images/xml_obj.gif'))

String[] getSelectors() { ['jar:file:META-INF/ejb-jar.xml'] }

public <T extends DefaultMutableTreeNode & UriGettable> T make(API api, Container.Entry entry) {
return new TreeNode(entry, new TreeNodeBean(label:'ejb-jar.xml', icon:icon, tip:"Location: $entry.uri.path"))
return new TreeNode(entry, new TreeNodeBean(label:'ejb-jar.xml', icon:ICON, tip:"Location: $entry.uri.path"))
}

static class TreeNode extends FileTreeNodeFactoryProvider.TreeNode implements PageCreator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import javax.swing.tree.DefaultMutableTreeNode
import java.util.regex.Pattern

class FileTreeNodeFactoryProvider implements TreeNodeFactory {
static final ImageIcon icon = new ImageIcon(FileTreeNodeFactoryProvider.class.classLoader.getResource('images/file_plain_obj.png'))
static final ImageIcon ICON = new ImageIcon(FileTreeNodeFactoryProvider.class.classLoader.getResource('images/file_plain_obj.png'))

String[] getSelectors() { ['*:file:*'] }

Expand All @@ -25,7 +25,7 @@ class FileTreeNodeFactoryProvider implements TreeNodeFactory {
public <T extends DefaultMutableTreeNode & UriGettable> T make(API api, Container.Entry entry) {
int lastSlashIndex = entry.path.lastIndexOf('/')
def name = entry.path.substring(lastSlashIndex+1)
return new TreeNode(entry, new TreeNodeBean(label:name, icon:icon))
return new TreeNode(entry, new TreeNodeBean(label:name, icon:ICON))
}

static class TreeNode extends DefaultMutableTreeNode implements UriGettable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import javax.swing.*
import javax.swing.tree.DefaultMutableTreeNode

class HtmlFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
static final ImageIcon icon = new ImageIcon(HtmlFileTreeNodeFactoryProvider.class.classLoader.getResource('images/html_obj.gif'))
static final ImageIcon ICON = new ImageIcon(HtmlFileTreeNodeFactoryProvider.class.classLoader.getResource('images/html_obj.gif'))

String[] getSelectors() { ['*:file:*.html', '*:file:*.xhtml'] }

public <T extends DefaultMutableTreeNode & UriGettable> T make(API api, Container.Entry entry) {
int lastSlashIndex = entry.path.lastIndexOf('/')
def name = entry.path.substring(lastSlashIndex+1)
return new TreeNode(entry, new TreeNodeBean(label:name, icon:icon, tip:"Location: $entry.uri.path"))
return new TreeNode(entry, new TreeNodeBean(label:name, icon:ICON, tip:"Location: $entry.uri.path"))
}

static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import javax.swing.*
import javax.swing.tree.DefaultMutableTreeNode

class JarFileTreeNodeFactoryProvider extends ZipFileTreeNodeFactoryProvider {
static final ImageIcon jarFileIcon = new ImageIcon(JarFileTreeNodeFactoryProvider.class.classLoader.getResource('images/jar_obj.png'))
static final ImageIcon ejbFileIcon = new ImageIcon(JarFileTreeNodeFactoryProvider.class.classLoader.getResource('images/ejbmodule_obj.gif'))
static final ImageIcon JAR_FILE_ICON = new ImageIcon(JarFileTreeNodeFactoryProvider.class.classLoader.getResource('images/jar_obj.png'))
static final ImageIcon EJB_FILE_ICON = new ImageIcon(JarFileTreeNodeFactoryProvider.class.classLoader.getResource('images/ejbmodule_obj.gif'))

String[] getSelectors() { ['*:file:*.jar'] }

public <T extends DefaultMutableTreeNode & UriGettable> T make(API api, Container.Entry entry) {
int lastSlashIndex = entry.path.lastIndexOf('/')
def name = entry.path.substring(lastSlashIndex+1)
def icon = isAEjbModule(entry) ? ejbFileIcon : jarFileIcon
def icon = isAEjbModule(entry) ? EJB_FILE_ICON : JAR_FILE_ICON
def node = new TreeNode(entry, 'jar', new TreeNodeBean(label:name, icon:icon))
// Add dummy node
node.add(new DefaultMutableTreeNode())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import javax.swing.*
import javax.swing.tree.DefaultMutableTreeNode

class JavascriptFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
static final ImageIcon icon = new ImageIcon(JavascriptFileTreeNodeFactoryProvider.class.classLoader.getResource('images/js_obj.png'))
static final ImageIcon ICON = new ImageIcon(JavascriptFileTreeNodeFactoryProvider.class.classLoader.getResource('images/js_obj.png'))

String[] getSelectors() { ['*:file:*.js'] }

public <T extends DefaultMutableTreeNode & UriGettable> T make(API api, Container.Entry entry) {
int lastSlashIndex = entry.path.lastIndexOf('/')
def name = entry.path.substring(lastSlashIndex+1)
return new TreeNode(entry, new TreeNodeBean(label:name, icon:icon, tip:"Location: $entry.uri.path"))
return new TreeNode(entry, new TreeNodeBean(label:name, icon:ICON, tip:"Location: $entry.uri.path"))
}

static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import javax.swing.JComponent
import javax.swing.tree.DefaultMutableTreeNode

class JspFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
static final ImageIcon icon = new ImageIcon(HtmlFileTreeNodeFactoryProvider.class.classLoader.getResource('images/html_obj.gif'))
static final ImageIcon ICON = new ImageIcon(HtmlFileTreeNodeFactoryProvider.class.classLoader.getResource('images/html_obj.gif'))

String[] getSelectors() { ['*:file:*.jsp', '*:file:*.jspf'] }

public <T extends DefaultMutableTreeNode & UriGettable> T make(API api, Container.Entry entry) {
int lastSlashIndex = entry.path.lastIndexOf('/')
def name = entry.path.substring(lastSlashIndex+1)
return new TreeNode(entry, new TreeNodeBean(label:name, icon:icon, tip:"Location: $entry.uri.path"))
return new TreeNode(entry, new TreeNodeBean(label:name, icon:ICON, tip:"Location: $entry.uri.path"))
}

static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import javax.swing.*
import javax.swing.tree.DefaultMutableTreeNode

class ManifestFileTreeNodeFactoryProvider extends FileTreeNodeFactoryProvider {
static final ImageIcon icon = new ImageIcon(ManifestFileTreeNodeFactoryProvider.class.classLoader.getResource('images/manifest_obj.png'))
static final ImageIcon ICON = new ImageIcon(ManifestFileTreeNodeFactoryProvider.class.classLoader.getResource('images/manifest_obj.png'))

String[] getSelectors() { ['*:file:META-INF/MANIFEST.MF'] }

public <T extends DefaultMutableTreeNode & UriGettable> T make(API api, Container.Entry entry) {
return new TreeNode(entry, new TreeNodeBean(label:'MANIFEST.MF', icon:icon, tip:"Location: $entry.uri.path"))
return new TreeNode(entry, new TreeNodeBean(label:'MANIFEST.MF', icon:ICON, tip:"Location: $entry.uri.path"))
}

static class TreeNode extends FileTreeNodeFactoryProvider.TreeNode implements PageCreator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import javax.swing.ImageIcon
import java.util.regex.Pattern

class MetainfDirectoryTreeNodeFactoryProvider extends DirectoryTreeNodeFactoryProvider {
static final ImageIcon icon = new ImageIcon(MetainfDirectoryTreeNodeFactoryProvider.class.classLoader.getResource('images/inf_obj.png'))
static final ImageIcon ICON = new ImageIcon(MetainfDirectoryTreeNodeFactoryProvider.class.classLoader.getResource('images/inf_obj.png'))

Pattern pattern = ~/(WEB-INF|(WEB-INF\/classes\/)?META-IN(F|F\/.*))/

String[] getSelectors() { ['jar:dir:*', 'war:dir:*', 'ear:dir:*'] }

Pattern getPathPattern() { pattern }

ImageIcon getIcon() { icon }
ImageIcon getIcon() { ICON }
ImageIcon getOpenIcon() { null }
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package jd.gui.service.treenode
import jd.gui.api.API
import jd.gui.api.feature.UriGettable
import jd.gui.api.model.Container
import jd.gui.spi.TreeNodeFactory
import jd.gui.util.JarContainerEntryUtil
import jd.gui.view.data.TreeNodeBean

Expand All @@ -17,7 +16,7 @@ import javax.swing.tree.DefaultMutableTreeNode
import java.util.regex.Pattern

class PackageTreeNodeFactoryProvider extends DirectoryTreeNodeFactoryProvider {
static final ImageIcon icon = new ImageIcon(PackageTreeNodeFactoryProvider.class.classLoader.getResource('images/package_obj.png'))
static final ImageIcon ICON = new ImageIcon(PackageTreeNodeFactoryProvider.class.classLoader.getResource('images/package_obj.png'))

String[] getSelectors() { ['jar:dir:*'] }

Expand Down Expand Up @@ -46,7 +45,7 @@ class PackageTreeNodeFactoryProvider extends DirectoryTreeNodeFactoryProvider {
return node
}

ImageIcon getIcon() { icon }
ImageIcon getIcon() { ICON }
ImageIcon getOpenIcon() { null }

static class TreeNode extends DirectoryTreeNodeFactoryProvider.TreeNode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import javax.swing.*
import javax.swing.tree.DefaultMutableTreeNode

class PropertiesFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
static final ImageIcon icon = new ImageIcon(PropertiesFileTreeNodeFactoryProvider.class.classLoader.getResource('images/ascii_obj.png'))
static final ImageIcon ICON = new ImageIcon(PropertiesFileTreeNodeFactoryProvider.class.classLoader.getResource('images/ascii_obj.png'))

String[] getSelectors() { ['*:file:*.properties'] }

public <T extends DefaultMutableTreeNode & UriGettable> T make(API api, Container.Entry entry) {
int lastSlashIndex = entry.path.lastIndexOf('/')
def name = entry.path.substring(lastSlashIndex+1)
return new TreeNode(entry, new TreeNodeBean(label:name, icon:icon, tip:"Location: $entry.uri.path"))
return new TreeNode(entry, new TreeNodeBean(label:name, icon:ICON, tip:"Location: $entry.uri.path"))
}

static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import javax.swing.*
import javax.swing.tree.DefaultMutableTreeNode

class SqlFileTreeNodeFactoryProvider extends TextFileTreeNodeFactoryProvider {
static final ImageIcon icon = new ImageIcon(SqlFileTreeNodeFactoryProvider.class.classLoader.getResource('images/sql_obj.png'))
static final ImageIcon ICON = new ImageIcon(SqlFileTreeNodeFactoryProvider.class.classLoader.getResource('images/sql_obj.png'))

String[] getSelectors() { ['*:file:*.sql'] }

public <T extends DefaultMutableTreeNode & UriGettable> T make(API api, Container.Entry entry) {
int lastSlashIndex = entry.path.lastIndexOf('/')
def name = entry.path.substring(lastSlashIndex+1)
return new TreeNode(entry, new TreeNodeBean(label:name, icon:icon, tip:"Location: $entry.uri.path"))
return new TreeNode(entry, new TreeNodeBean(label:name, icon:ICON, tip:"Location: $entry.uri.path"))
}

static class TreeNode extends TextFileTreeNodeFactoryProvider.TreeNode {
Expand Down
Loading

0 comments on commit da96bad

Please sign in to comment.