CTRL + L Hotkey
Opens your last opened file. If there is a more well known global hotkey for this function it should be changed to that
This commit is contained in:
parent
c60bcb3fb2
commit
af26f2c257
4 changed files with 32 additions and 0 deletions
|
@ -300,6 +300,14 @@ public class BytecodeViewer
|
||||||
return Configuration.java;
|
return Configuration.java;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if there is at least one file resource loaded
|
||||||
|
*/
|
||||||
|
public static boolean hasResources()
|
||||||
|
{
|
||||||
|
return !files.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if there is currently a tab open with a resource inside of it
|
* Returns true if there is currently a tab open with a resource inside of it
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package the.bytecode.club.bytecodeviewer;
|
package the.bytecode.club.bytecodeviewer;
|
||||||
|
|
||||||
|
import sun.security.krb5.Config;
|
||||||
import the.bytecode.club.bytecodeviewer.gui.components.FileChooser;
|
import the.bytecode.club.bytecodeviewer.gui.components.FileChooser;
|
||||||
import the.bytecode.club.bytecodeviewer.gui.components.RunOptions;
|
import the.bytecode.club.bytecodeviewer.gui.components.RunOptions;
|
||||||
import the.bytecode.club.bytecodeviewer.util.DialogueUtils;
|
import the.bytecode.club.bytecodeviewer.util.DialogueUtils;
|
||||||
|
@ -126,5 +127,19 @@ public class GlobalHotKeys
|
||||||
if (BytecodeViewer.hasActiveResource())
|
if (BytecodeViewer.hasActiveResource())
|
||||||
BytecodeViewer.viewer.workPane.tabs.remove(BytecodeViewer.viewer.workPane.getActiveResource());
|
BytecodeViewer.viewer.workPane.tabs.remove(BytecodeViewer.viewer.workPane.getActiveResource());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//CTRL + L
|
||||||
|
//open last opened resource
|
||||||
|
else if ((e.getKeyCode() == KeyEvent.VK_L) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0))
|
||||||
|
{
|
||||||
|
Configuration.lastHotKeyExecuted = System.currentTimeMillis();
|
||||||
|
|
||||||
|
String recentFile = Settings.getRecentFile();
|
||||||
|
|
||||||
|
System.out.println("Opening..." + recentFile);
|
||||||
|
|
||||||
|
if(!BytecodeViewer.hasResources() && recentFile != null)
|
||||||
|
BytecodeViewer.openFiles(new File[]{new File(recentFile)}, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,14 @@ public class Settings
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getRecentFile()
|
||||||
|
{
|
||||||
|
if(recentFiles.isEmpty())
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return recentFiles.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add to the recent plugin list
|
* Add to the recent plugin list
|
||||||
*
|
*
|
||||||
|
|
|
@ -19,6 +19,7 @@ of features BCV has, and what they do.
|
||||||
<li>Add (Ctrl + O) - If you add a jar/zip BCV will unzip it, if you add an APK or DEX file, BCV will run dex2jar
|
<li>Add (Ctrl + O) - If you add a jar/zip BCV will unzip it, if you add an APK or DEX file, BCV will run dex2jar
|
||||||
then run the jar input process.
|
then run the jar input process.
|
||||||
</li>
|
</li>
|
||||||
|
<li>Reopen Recent File (Ctrl + L) - Reopens your last recent opened file.</li>
|
||||||
<li>New Workspace (Ctrl + N) - It clears the opened jars/resources.</li>
|
<li>New Workspace (Ctrl + N) - It clears the opened jars/resources.</li>
|
||||||
<li>Run (Ctrl + R) - Runs the classfiles you've loaded into BCV in a secure sandboxed JVM instance that you can
|
<li>Run (Ctrl + R) - Runs the classfiles you've loaded into BCV in a secure sandboxed JVM instance that you can
|
||||||
fully debug.
|
fully debug.
|
||||||
|
|
Loading…
Reference in a new issue