Class DecompilationController
- java.lang.Object
-
- org.jrd.frontend.frame.main.decompilerview.DecompilationController
-
- All Implemented Interfaces:
ClassesAndMethodsProvider,ClasspathProvider,LoadingDialogProvider,ModelProvider
public class DecompilationController extends java.lang.Object implements ModelProvider, LoadingDialogProvider, ClassesAndMethodsProvider, ClasspathProvider
This class provides Action listeners and request handling for the GUI.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDecompilationController.AgentApiGeneratorclassDecompilationController.BytesActionListenerclassDecompilationController.LoadClassNames-
Nested classes/interfaces inherited from interface org.jrd.backend.completion.ClassesAndMethodsProvider
ClassesAndMethodsProvider.SettingsClassesAndMethodsProvider
-
Nested classes/interfaces inherited from interface org.jrd.frontend.frame.main.decompilerview.dummycompiler.providers.ClasspathProvider
ClasspathProvider.SettingsClasspathProvider
-
-
Field Summary
Fields Modifier and Type Field Description private BytecodeDecompilerViewbytecodeDecompilerViewstatic java.lang.StringCLASSES_NOPEprivate booleanisVerboseprivate LoadingDialogloadingDialogprivate MainFrameViewmainFrameViewprivate NewConnectionViewnewConnectionDialogprivate NewFsVmViewnewFsVmDialogprivate PluginConfigurationEditorControllerpluginConfigurationEditorControllerprivate PluginConfigurationEditorViewpluginConfigurationEditorViewprivate VmInfovmInfo
-
Constructor Summary
Constructors Constructor Description DecompilationController(MainFrameView mainFrameView, boolean isVerbose)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidabortClassLoading()private voidaddClass(java.lang.String fqnSpaceBody)private voidaddJar(java.lang.String fqnSpaceBody)static java.lang.StringbytesToBase64(byte[] bytes)private voidchangeVm(java.awt.event.ActionEvent event)private voidcleanup(boolean halt)private voidclearOtherList(javax.swing.JList<VmInfo> vmList)If selected list is remoteVmList clears localVmList and vice versa.
Effectively merging them into one.java.lang.StringcpTextInfo()private voidcreateConfigurationEditor()private java.lang.StringcreateFilter(java.lang.String text, int caretPosition)private voidcreateNewConnectionDialog()private voidcreateNewFsVMDialog()private AgentRequestActioncreateRequest(AgentRequestAction.RequestAction action, java.lang.String... commands)static AgentRequestActioncreateRequest(VmInfo vmInfo, AgentRequestAction.RequestAction action, java.lang.String... commands)private booleanexitOnEmpty(java.lang.String vmType, VmInfo selectedVm)static java.lang.StringfileToBase64(java.lang.String path, boolean deHex)static byte[]fileToBytes(java.lang.String path)static java.util.List<java.lang.String>fileToLines(java.lang.String path)java.lang.String[]getClasses(CompletionSettings settings)RuntimeCompilerConnector.JrdClassesProvidergetClassesProvider()byte[]getClassItself(CompletionSettings settings, java.lang.String fqn)ClassesAndMethodsProvidergetClasspath()private java.lang.String[]getMethodsFromClassInRunningVm(CompletionSettings settings, java.lang.String fqn)private java.lang.String[]getMethodsFromClassInRunningVmCatched(CompletionSettings settings, java.lang.String fqn)java.lang.String[]getOverrides()PluginManagergetPluginManager()private java.util.Collection<io.github.mkoncek.classpathless.api.IdentifiedBytecode>getSingleClassFromRunningVmCatched(java.lang.String fqn)java.lang.StringgetVm()VmInfogetVmInfo()VmManagergetVmManager()java.lang.String[]getWhateverFromClass(CompletionSettings settings, java.lang.String fqn)private voidhaltAgent()voidhideLoadingDialog()private voidinitClass(java.lang.String fqn)booleanisMissingVmInfo()booleanisVerbose()private voidkillAllSession()private booleanloadClassBytecode(ClassInfo name)voidremoveOverrides(java.lang.String pattern)private voidremoveVmDialog(java.awt.event.ActionEvent event)private voidsearchInClasses(java.lang.String substringAndRegex)voidsetVerbose(boolean verbose)voidshowLoadingDialog(java.awt.event.ActionListener listener, java.lang.String title)private voidshowLoadingDialog(java.lang.String title)static java.lang.StringstdinToBase64(boolean deHex)static byte[]stdinToBytes()static java.util.List<java.lang.String>stdinToStrings()static java.lang.StringstringToBase64(java.lang.String s)(package private) java.lang.StringsubmitRequest(AgentRequestAction request)static java.lang.StringsubmitRequest(VmManager vmManager, AgentRequestAction request)private voidupdateVmLists()private booleanwarnOnOvveridesOfFsVm(VmInfo selectedVm)static booleanwarnOnOvveridesOfFsVm(VmInfo vmInfo, javax.swing.JFrame parent)
-
-
-
Field Detail
-
mainFrameView
private final MainFrameView mainFrameView
-
bytecodeDecompilerView
private final BytecodeDecompilerView bytecodeDecompilerView
-
newConnectionDialog
private NewConnectionView newConnectionDialog
-
newFsVmDialog
private NewFsVmView newFsVmDialog
-
pluginConfigurationEditorView
private PluginConfigurationEditorView pluginConfigurationEditorView
-
pluginConfigurationEditorController
private PluginConfigurationEditorController pluginConfigurationEditorController
-
loadingDialog
private LoadingDialog loadingDialog
-
vmInfo
private VmInfo vmInfo
-
isVerbose
private boolean isVerbose
-
CLASSES_NOPE
public static final java.lang.String CLASSES_NOPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DecompilationController
public DecompilationController(MainFrameView mainFrameView, boolean isVerbose)
-
-
Method Detail
-
createConfigurationEditor
private void createConfigurationEditor()
-
createNewConnectionDialog
private void createNewConnectionDialog()
-
createNewFsVMDialog
private void createNewFsVMDialog()
-
removeVmDialog
private void removeVmDialog(java.awt.event.ActionEvent event)
-
exitOnEmpty
private boolean exitOnEmpty(java.lang.String vmType, VmInfo selectedVm)
-
warnOnOvveridesOfFsVm
private boolean warnOnOvveridesOfFsVm(VmInfo selectedVm)
-
warnOnOvveridesOfFsVm
public static boolean warnOnOvveridesOfFsVm(VmInfo vmInfo, javax.swing.JFrame parent)
-
updateVmLists
private void updateVmLists()
-
changeVm
private void changeVm(java.awt.event.ActionEvent event)
-
clearOtherList
private void clearOtherList(javax.swing.JList<VmInfo> vmList)
If selected list is remoteVmList clears localVmList and vice versa.
Effectively merging them into one.- Parameters:
vmList- list that doesn't get cleared containing the VM that user wants to attach.
-
showLoadingDialog
private void showLoadingDialog(java.lang.String title)
-
showLoadingDialog
public void showLoadingDialog(java.awt.event.ActionListener listener, java.lang.String title)- Specified by:
showLoadingDialogin interfaceLoadingDialogProvider
-
hideLoadingDialog
public void hideLoadingDialog()
- Specified by:
hideLoadingDialogin interfaceLoadingDialogProvider
-
cleanup
private void cleanup(boolean halt)
-
abortClassLoading
private void abortClassLoading()
-
initClass
private void initClass(java.lang.String fqn)
-
addClass
private void addClass(java.lang.String fqnSpaceBody)
-
addJar
private void addJar(java.lang.String fqnSpaceBody)
-
searchInClasses
private void searchInClasses(java.lang.String substringAndRegex)
-
loadClassBytecode
private boolean loadClassBytecode(ClassInfo name)
-
getVm
public java.lang.String getVm()
-
getOverrides
public java.lang.String[] getOverrides()
-
removeOverrides
public void removeOverrides(java.lang.String pattern)
-
getClasspath
public ClassesAndMethodsProvider getClasspath()
- Specified by:
getClasspathin interfaceClasspathProvider
-
getVmInfo
public VmInfo getVmInfo()
- Specified by:
getVmInfoin interfaceClasspathProvider- Specified by:
getVmInfoin interfaceModelProvider
-
getVmManager
public VmManager getVmManager()
- Specified by:
getVmManagerin interfaceClasspathProvider- Specified by:
getVmManagerin interfaceModelProvider
-
getClassesProvider
public RuntimeCompilerConnector.JrdClassesProvider getClassesProvider()
- Specified by:
getClassesProviderin interfaceModelProvider
-
getClasses
public java.lang.String[] getClasses(CompletionSettings settings)
- Specified by:
getClassesin interfaceClassesAndMethodsProvider
-
getClassItself
public byte[] getClassItself(CompletionSettings settings, java.lang.String fqn)
- Specified by:
getClassItselfin interfaceClassesAndMethodsProvider
-
isMissingVmInfo
public boolean isMissingVmInfo()
- Specified by:
isMissingVmInfoin interfaceClassesAndMethodsProvider
-
getSingleClassFromRunningVmCatched
private java.util.Collection<io.github.mkoncek.classpathless.api.IdentifiedBytecode> getSingleClassFromRunningVmCatched(java.lang.String fqn)
-
getWhateverFromClass
public java.lang.String[] getWhateverFromClass(CompletionSettings settings, java.lang.String fqn)
- Specified by:
getWhateverFromClassin interfaceClassesAndMethodsProvider
-
getMethodsFromClassInRunningVmCatched
private java.lang.String[] getMethodsFromClassInRunningVmCatched(CompletionSettings settings, java.lang.String fqn)
-
getMethodsFromClassInRunningVm
private java.lang.String[] getMethodsFromClassInRunningVm(CompletionSettings settings, java.lang.String fqn)
-
getPluginManager
public PluginManager getPluginManager()
-
fileToBase64
public static java.lang.String fileToBase64(java.lang.String path, boolean deHex)
-
stdinToBase64
public static java.lang.String stdinToBase64(boolean deHex)
-
fileToBytes
public static byte[] fileToBytes(java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
fileToLines
public static java.util.List<java.lang.String> fileToLines(java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
stdinToBytes
public static byte[] stdinToBytes() throws java.io.IOException- Throws:
java.io.IOException
-
stdinToStrings
public static java.util.List<java.lang.String> stdinToStrings() throws java.io.IOException- Throws:
java.io.IOException
-
bytesToBase64
public static java.lang.String bytesToBase64(byte[] bytes)
-
stringToBase64
public static java.lang.String stringToBase64(java.lang.String s)
-
haltAgent
private void haltAgent()
-
killAllSession
private void killAllSession()
-
createRequest
private AgentRequestAction createRequest(AgentRequestAction.RequestAction action, java.lang.String... commands)
-
createRequest
public static AgentRequestAction createRequest(VmInfo vmInfo, AgentRequestAction.RequestAction action, java.lang.String... commands)
-
submitRequest
java.lang.String submitRequest(AgentRequestAction request)
-
submitRequest
public static java.lang.String submitRequest(VmManager vmManager, AgentRequestAction request)
-
isVerbose
public boolean isVerbose()
-
setVerbose
public void setVerbose(boolean verbose)
-
createFilter
private java.lang.String createFilter(java.lang.String text, int caretPosition)
-
cpTextInfo
public java.lang.String cpTextInfo()
- Specified by:
cpTextInfoin interfaceClassesAndMethodsProvider
-
-