From 217d36e4f81c21a55355fb9de4c2e42aba9cec4c Mon Sep 17 00:00:00 2001 From: pardonmycode Date: Fri, 24 May 2024 14:04:15 +0200 Subject: [PATCH] performance optim. --- .../commands/ActionsBeforeActivation.java | 4 ++-- src/abapactionchain/utils/ProjectUtility.java | 2 +- src/abapactionchain/views/CommandListener.java | 14 ++++++++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/abapactionchain/commands/ActionsBeforeActivation.java b/src/abapactionchain/commands/ActionsBeforeActivation.java index 216e095..27d32ea 100644 --- a/src/abapactionchain/commands/ActionsBeforeActivation.java +++ b/src/abapactionchain/commands/ActionsBeforeActivation.java @@ -115,13 +115,13 @@ public static void useAbapCleaner() { } catch (ExecutionException | NotDefinedException | NotEnabledException | NotHandledException e) { e.printStackTrace(); } - sleep(100); + sleep(10); } public static void saveCurrentFile(IAbapSourcePage sourcepage, IProgressMonitor monitor) { System.out.println( "Start save currentFile" ); sourcepage.doSave(monitor); - sleep(100); + sleep(50); } diff --git a/src/abapactionchain/utils/ProjectUtility.java b/src/abapactionchain/utils/ProjectUtility.java index 12eb296..baa34be 100644 --- a/src/abapactionchain/utils/ProjectUtility.java +++ b/src/abapactionchain/utils/ProjectUtility.java @@ -113,6 +113,7 @@ public static IEditorPart getActiveEditor() { IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .getActiveEditor(); System.out.println(" getActiveEditor in ProjectUtility.java : " + activeEditor ); + return activeEditor; } catch (Exception e) { System.out.println(e); @@ -188,7 +189,6 @@ public static void openObject(final IProject project, final IAdtObjectReference public static void runObject(final IProject project, final IAdtObjectReference adtObjectRef) { - AdtSapGuiEditorUtilityFactory.createSapGuiEditorUtility().openEditorForObject(project, adtObjectRef, true, WorkbenchAction.EXECUTE.toString(), null, Collections.emptyMap()); } diff --git a/src/abapactionchain/views/CommandListener.java b/src/abapactionchain/views/CommandListener.java index 93b13c7..91e324d 100644 --- a/src/abapactionchain/views/CommandListener.java +++ b/src/abapactionchain/views/CommandListener.java @@ -31,7 +31,15 @@ public void postExecuteSuccess(String commandId, Object returnValue) { } case "org.eclipse.ui.file.save": { - ActionsBeforeActivation.runActionChain(commandId); + + boolean debug = true; + if (debug) { + System.out.println(this.getClass().getSimpleName()); + System.out.println( commandId ); + System.out.println( returnValue ); + } + + ActionsBeforeActivation.runActionChain(commandId); } } } @@ -42,9 +50,11 @@ public void preExecute(String commandId, ExecutionEvent event) { // TODO Auto-generated method stub boolean debug = true; if (debug) { + System.out.println(this.getClass().getSimpleName()); + System.out.println("preExecute"); System.out.println( event ); + System.out.println( ); } - } }