Skip to content

Commit

Permalink
Updates API & cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanue1 committed Jun 6, 2015
1 parent ed781a1 commit a305719
Show file tree
Hide file tree
Showing 12 changed files with 605 additions and 117 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.class

# JD-GUI
src-generated/
jd-gui.cfg

# Idea
Expand All @@ -20,6 +21,9 @@ classes/
# Mac
.DS_Store

#Windows
Thumbs.db

# Maven
log/
target/
Expand All @@ -30,4 +34,3 @@ build/

# WinMerge
*.bak

42 changes: 32 additions & 10 deletions api/src/main/java/jd/gui/api/feature/UriOpenable.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,34 @@
import java.net.URI;

/**
* uri = [scheme:][//authority][path][?query][#fragment]<br>
* scheme = generic | jar | war | ear | dex | ...<br>
* authority = ''<br>
* path = path/to/dir/ | path/to/file<br>
* query = '' | highlight=text<br>
* fragment = '' | type | innertype | lineNumber=... | highlightPattern=...&highlightFlags=[drtcmfs]&highlightScope=...<br>
* uri : scheme '://' path ('?' query)? ('#' fragment)?<br>
* scheme : 'generic' | 'jar' | 'war' | 'ear' | 'dex' | ...<br>
* path : singlePath('!' singlePath)*<br>
* singlePath : [path/to/dir/] | [path/to/file]<br>
* query : queryLineNumber | queryPosition | querySearch<br>
* queryLineNumber : 'lineNumber=' [numeric]<br>
* queryPosition : 'position=' [numeric]<br>
* querySearch : 'highlightPattern=' queryPattern '&highlightFlags=' queryFlags ('&highlightScope=' typeName)?<br>
* queryPattern : [start of string] | [start of type name] | [start of field name] | [start of method name]<br>
* queryFlags : 'd'? // Match declarations<br>
* 'r'? // Match references<br>
* 't'? // Match types<br>
* 'c'? // Match constructors<br>
* 'm'? // Match methods<br>
* 'f'? // Match fields<br>
* 's'? // Match strings<br>
* fragment : fragmentType | fragmentField | fragmentMethod<br>
* fragmentType : typeName<br>
* fragmentField : typeName '-' [field name] '-' descriptor<br>
* fragmentMethod : typeName '-' [method name] '-' methodDescriptor<br>
* methodDescriptor : '(*)?' | // Match all method descriptors<br>
* '(' descriptor* ')' descriptor<br>
* descriptor : '?' | // Match a primitive or a type name<br>
* '['* primitiveOrTypeName<br>
* primitiveOrTypeName : 'B' | 'C' | 'D' | 'F' | 'I' | 'J' | 'L' typeName ';' | 'S' | 'Z'<br>
* typeName : [internal qualified name] | '*\/' [name]<br>
* <br>
* Examples:
* Examples:<br>
* <ul>
* <li>file://dir1/dir2/</li>
* <li>file://dir1/dir2/file</li>
Expand All @@ -28,13 +48,15 @@
* <li>jar://dir1/dir2/javafile#type-methodName-descriptor</li>
* <li>jar://dir1/dir2/javafile#innertype</li>
* <li>jar://dir1/dir2/javafile#innertype-fieldName-?</li>
* <li>jar://dir1/dir2/javafile#innertype-methodName-(?)?</li>
* <li>jar://dir1/dir2/javafile#innertype-methodName-(*)?</li>
* <li>jar://dir1/dir2/javafile#innertype-methodName-(?JZLjava/lang/Sting;C)I</li>
* <li>jar://dir1/dir2/javafile#innertype-fieldName-descriptor</li>
* <li>jar://dir1/dir2/javafile#innertype-methodName-descriptor</li>
*
* <li>file://dir1/dir2/file?lineNumber=number</li>
* <li>file://dir1/dir2/file?lineNumber=numeric</li>
* <li>file://dir1/dir2/file?position=numeric</li>
* <li>file://dir1/dir2/file?highlightPattern=hello&highlightFlags=drtcmfs&highlightScope=internalTypeName</li>
* <li>file://dir1/dir2/file?highlightPattern=hello&highlightFlags=drtcmfs&highlightScope=java/lang/String</li>
* <li>file://dir1/dir2/file?highlightPattern=hello&highlightFlags=drtcmfs&highlightScope=*\/String</li>
* </ul>
*/
public interface UriOpenable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import jd.gui.api.model.Indexes
import jd.gui.model.configuration.Configuration
import jd.gui.model.container.FilteredContainerWrapper
import jd.gui.service.type.TypeFactoryService
import jd.gui.util.UriUtil
import jd.gui.view.SearchInConstantPoolsView

import java.awt.Cursor
Expand Down
27 changes: 11 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ allprojects {
}

// 'cleanIdea' task extension //
task fullCleanIdea {
cleanIdea {
file(project.name + '.iws').delete()
ant.delete(dir: 'out')
}
fullCleanIdea.mustRunAfter cleanIdea

// All in one JAR //
subprojects.each { subproject ->
Expand Down Expand Up @@ -116,22 +115,18 @@ task installOsxDistConfig(type: Copy) {
}

distributions {
osx {
contents {
into('JD-GUI.app/Contents') {
from 'build/distributions/osx'
}
into('JD-GUI.app/Contents/Resources/Java') {
from jar.archivePath
}
from 'LICENSE', 'NOTICE', 'README.md'
osx.contents {
into('JD-GUI.app/Contents') {
from 'build/distributions/osx'
}
}
windows {
contents {
from 'build/launch4j/jd-gui.exe'
from 'LICENSE', 'NOTICE', 'README.md'
into('JD-GUI.app/Contents/Resources/Java') {
from jar.archivePath
}
from 'LICENSE', 'NOTICE', 'README.md'
}
windows.contents {
from 'build/launch4j/jd-gui.exe'
from 'LICENSE', 'NOTICE', 'README.md'
}
}
installOsxDist.dependsOn build
Expand Down
1 change: 1 addition & 0 deletions services/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ dependencies {
compile 'com.fifesoft:rsyntaxtextarea:2.5.6'
compile 'jd:jd-core:0.7.1'
compile project(':api')
testCompile 'org.codehaus.groovy:groovy-test:2.4.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ abstract class AbstractTypeFileTreeNodeFactoryProvider extends AbstractTreeNodeF
if (!initialized) {
removeAllChildren()
// Create type node
def type = api.getTypeFactory(entry).make(api, entry, null)
def type = api.getTypeFactory(entry)?.make(api, entry, null)
if (type) {
add(new TypeTreeNode(entry, type, new TreeNodeBean(label: type.displayTypeName, icon: type.icon), pageFactory))
}
Expand Down
Loading

0 comments on commit a305719

Please sign in to comment.