On The Subject of Organized Imports…
Posted by pookzilla on August 1, 2006
Does this give anyone ideas? *coughscriptingcough*
class MyExecutionListener implements org.eclipse.core.commands.IExecutionListener {
... <snip uninteresting bits > ...
public void preExecute(String commandId, ExecutionEvent event) { if ("org.eclipse.ui.file.save".equals(commandId)) { Command command = service .getCommand("org.eclipse.jdt.ui.edit.text.java.organize.imports"); if (command != null) { ExecutionEvent newEvent = new ExecutionEvent( command, event.getParameters(), event.getTrigger(), event.getApplicationContext()); try { command.executeWithChecks(newEvent); } catch (Exception e) { } } } } }}










Alexander Smirnoff said,
Hi Kim,
If your hint is about using command framework in scripting – good idea.
But if you want to use command framework for record/playback automation, this may not be ehough. Unless IMHO, there will be a way to represent parameters and application context in this framework, in handy serialized manner (aka XML) and detached from Eclipse.
Alex.
Anonymous said,
helloi can’t find pachage of org.eclipse.swt.internal.carbon. can you help?
pookzilla said,
To the above:
It’s in the fragment org.eclipse.ui.carbon, the source of which can be located at :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
Add A Comment