Resolves #235
This commit is contained in:
parent
a2c79f2a81
commit
e1d2196977
4 changed files with 13 additions and 12 deletions
|
@ -158,9 +158,7 @@ public class WorkPaneMainComponent extends VisibleComponent
|
|||
//load class resources
|
||||
public void addClassResource(final FileContainer container, final String name, final ClassNode cn)
|
||||
{
|
||||
final String workingName = container.name + ">" + name;
|
||||
|
||||
addResource(container, name, new ClassViewer(container, name, cn, workingName));
|
||||
addResource(container, name, new ClassViewer(container, name, cn));
|
||||
}
|
||||
|
||||
//Load file resources
|
||||
|
@ -168,16 +166,14 @@ public class WorkPaneMainComponent extends VisibleComponent
|
|||
{
|
||||
if (contents == null) //a directory
|
||||
return;
|
||||
|
||||
final String workingName = container.name + ">" + name;
|
||||
|
||||
addResource(container, name, new FileViewer(container, name, contents, workingName));
|
||||
addResource(container, name, new FileViewer(container, name, contents));
|
||||
}
|
||||
|
||||
private void addResource(final FileContainer container, final String name, final ResourceViewer resourceView)
|
||||
{
|
||||
final String workingName = container.name + ">" + name;
|
||||
|
||||
final String workingName = container.generateWorkName(name);
|
||||
|
||||
//create a new tab if the resource isn't opened currently
|
||||
if (!openedTabs.contains(workingName))
|
||||
{
|
||||
|
|
|
@ -69,9 +69,9 @@ public class ClassViewer extends ResourceViewer
|
|||
public List<MethodParser> methods = Arrays.asList(new MethodParser(), new MethodParser(), new MethodParser());
|
||||
public final String workingName;
|
||||
|
||||
public ClassViewer(final FileContainer container, final String name, final ClassNode cn, String workingName)
|
||||
public ClassViewer(final FileContainer container, final String name, final ClassNode cn)
|
||||
{
|
||||
this.workingName = workingName;
|
||||
this.workingName = container.generateWorkName(name);
|
||||
this.container = container;
|
||||
|
||||
this.name = name;
|
||||
|
|
|
@ -61,11 +61,11 @@ public class FileViewer extends ResourceViewer
|
|||
public BufferedImage image;
|
||||
public boolean canRefresh;
|
||||
|
||||
public FileViewer(final FileContainer container, final String name, final byte[] contents, String workingName)
|
||||
public FileViewer(final FileContainer container, final String name, final byte[] contents)
|
||||
{
|
||||
this.name = name;
|
||||
this.contents = contents;
|
||||
this.workingName = workingName;
|
||||
this.workingName = container.generateWorkName(name);
|
||||
this.container = container;
|
||||
this.setName(name);
|
||||
this.setLayout(new BorderLayout());
|
||||
|
|
|
@ -57,4 +57,9 @@ public class FileContainer {
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
public String generateWorkName(String name)
|
||||
{
|
||||
return file.getAbsolutePath() + ">" + name;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue