Is it possible to trigger a plugin upon clicking Recalculate Opportunity?
I registered a plugin for the Recalculate message but nothing is triggered as far as I can tell from the Plug-In Trace Log...
As far as I know you cannot catch this event. Dynamics (Microsoft) did not opened/ added any method to catch this trigger. This happens all in background.
Related
Before I get into it I'm sorry for the newbie question but I'm new to Moodle and php development. I'm attempting to figure out how to debug the code in event handlers.
Really what I'm looking for is how to debug code in an event handler since I don't call the page directly and am not able to get output from the functions that it's running (that I'm currently aware of).
I know this is likely off topic for this forum but I'm not really sure where to turn for this.
Make sure xdebug is installed on the development computer where you are testing this, then open up your IDE and put a breakpoint at the start of your event handler. If that isn't hit, put a breakpoint on the code that triggers the event and step through it.
If, for some reason, you really can't install xdebug and step through the code (which is something that is essential for any serious PHP development), try using fopen and fwrite to dump information into a log file, whilst the event is happening.
How can I write a plugin or program routine that gets notified when "build workspace" finishes in Eclipse?
Is IProgressMonitor useful for this? If so, how do I get ahold of it?
You can wait for the automatic build to finish using:
Platform.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
This will block until the builds have finished (and do nothing if the build is not running).
You would probably also want to wait on the manual builds are well:
Platform.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, null);
If you really want to receive a notification (rather than blocking), try this:
IWorkspace.addResourceChangeListener(myListener, IResourceChangeEvent.POST_BUILD);
The Javadoc of IResourceChangeEvent gives more details on usage and on information found in the event instance.
I am often stuck twiddling my thumbs for a couple minutes while eclipse cleans, builds, or loads my projects. It would be nice if eclipse could notify me with a beep when the last task in the Progress view has finished running, so I can stop reading the internet and get back to work. Is there a setting or plugin that does this?
Edit: I tried adapting the plugin template that nonty provided below, which adds a listener to the JobManager. I tried implementing done() to beep only when the job change event's name contains "Building workspace," as that is the task that usually takes the longest in my setup. Exasperatingly, the task that builds the workspace never sends a done() call, just scheduled() and aboutToRun() calls. Any other ideas?
There are no preference for this - yet.
The JobManager have the needed API to support this functionality...
EDIT: I have constructed and attached a very simple plug-in that will beep for every job that terminates. That turns out to be rather often :-) . You can modify it to filter out all the false positives, e.g. by getPriority() and getName(). Also you can make the listener play a tune, popup a message (don't!) or whatever...
See jobnotifier.zip.
UPDATED the link above again
Is there a generic way of receiving event notifications from the Eclipse debugger. Specifically I would just like to know when the user steps over/into and when a breakpoint is hit.
I have already got this working in JDT (see my other question: Eclipse Debugger Events) but the same technique doesn't work in CDT (I am using DebugPlugin.addDebugEventListener).
If there is no generic way of doing this, then is there a way to avoid the CDT dependencies from breaking the plugin when it is run in JDT?
Thanks,
Alan
OK, I've found an alternative that may be of use for others. You can use the method outlined above to listen for debug events when the session is created and terminated.
For any stepping events, one way I found was to register an IExecutionListener to be notified of all commands that take place in the Eclipse workspace. You can register an execution listener by getting hold of an ICommandService as follows:
ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class)
Then add an execution listener:
commandService.addExecutionListener(this);
This will give you various event handlers (notHandled, postExecuteFailure, postExecuteSuccess, preExecute) from which you can filter by the commandId value.
I hope this helps someone else.
Alan
In my Eclipse plugin, I would like to be notified on debugger events (e.g. when stepping or a breakpoint is hit). I've managed to get this working in a JDT environment by subscribing to debug events using this code:
DebugPlugin.getDefault().addDebugEventListener(this);
Which gives this event handler:
public void handleDebugEvents(DebugEvent[] events)
{
}
In JDT this is fired on Breakpoint or Suspend events and I was hoping the behaviour would be the same in CDT. However, it is not. I only get two Create events at the start of the debug session:
DebugEvent[org.eclipse.cdt.dsf.gdb.launching.GDBProcess#ae0aae, CREATE, UNSPECIFIED]
DebugEvent[org.eclipse.debug.core.model.RuntimeProcess#920d5d, CREATE, UNSPECIFIED]
Is there a generic solution that wouldn't require specific dependencies on JDT or CDT?
Thanks,
Alan
I did find a solution and have answered my other question here: Eclipse plugin - handling events when stepping or breaking
Alan
I think what you want can't be achieved (generic, implementation-independent solution) without listening and digging through every single action in the Eclipse environment, as I understand that the Eclipse generic debug plug-in is just the framework on which to build a implementation-specific debugger, like Java's own debugger.
The static call you're making to DebugPlugin is a call to this basic 'framework' on which the CDT or JDT is running. For example, if I wanted to register a breakpoint listener to the Java debugger, I would call JDIDebugModel.addJavaBreakpointListener(<Your Java breakpoint listener class>);.
P.S. If there is a way to maybe listen to just the events fired from/under the generic platform debug plug-in, which would include the events fired from plug-ins that extend from this generic debugger, that may ease the task you seek to accomplish.