Kill queued jobs in UI thread [message #285757] |
Wed, 25 May 2005 05:21  |
Eclipse User |
|
|
|
Originally posted by: niall.murphy.ie.ibm.com
Hi,
sorry if i misuse the word job in this post, im using it to describe a
runnable queued on a thread that has yet to be run.
When i make a plugin wizard the class that creates the wizard,
NewProjectCreationOperation, also opens the manifest editor for the
created plugin.xml.
I dont want the editor to open.
at the moment i am closing the editor by adding the following runnable
to the UI thread. This happens before the next UI refresh. This means
there is (at best) a strange sight, as the editor opens, starts to draw
itself and then closes.
PDEPlugin.getActiveWorkbenchWindow().getShell().getDisplay() .asyncExec(new
runnable(){
public void run() {
IFile file = //is acquired
//get the editor associated with this file
IEditorPart ed =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().findEditor(new
FileEditorInput(file));
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().closeEditor(ed,
false);
}
});
What i would like to do is some how get the list of jobs of the UI
thread, pick the one that is going to open the editor and kill it before
the next ui refresh.
is this possible?
is there a better way?
thanks
Niall Murphy
|
|
|
Re: Kill queued jobs in UI thread [message #285769 is a reply to message #285757] |
Wed, 25 May 2005 10:21   |
Eclipse User |
|
|
|
Originally posted by: john.eclipsefaq.org
There is no way to remove runnables from the asynchronous event queue.
Also, NewProjectCreationOperation is not an API class so referencing it
at all (let alone relying on its behaviour) is not recommended. I don't
have a suggestion for a better way to do this, other than writing your
own plugin wizard from scratch. You could enter a feature request
against PDE to make their wizard pages API, as is done by JDT and the
basic platform wizards (org.eclipse.jdt.ui.wizards and
org.eclipse.ui.wizards).
--
Niall Murphy wrote:
> Hi,
> sorry if i misuse the word job in this post, im using it to describe a
> runnable queued on a thread that has yet to be run.
>
> When i make a plugin wizard the class that creates the wizard,
> NewProjectCreationOperation, also opens the manifest editor for the
> created plugin.xml.
>
> I dont want the editor to open.
>
> at the moment i am closing the editor by adding the following runnable
> to the UI thread. This happens before the next UI refresh. This means
> there is (at best) a strange sight, as the editor opens, starts to draw
> itself and then closes.
>
> PDEPlugin.getActiveWorkbenchWindow().getShell().getDisplay() .asyncExec(new
> runnable(){
>
> public void run() {
>
> IFile file = //is acquired
>
> //get the editor associated with this file
> IEditorPart ed =
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().findEditor(new
> FileEditorInput(file));
>
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().closeEditor(ed,
> false);
> }
> });
>
> What i would like to do is some how get the list of jobs of the UI
> thread, pick the one that is going to open the editor and kill it before
> the next ui refresh.
>
> is this possible?
>
> is there a better way?
>
> thanks
> Niall Murphy
|
|
|
Re: Kill queued jobs in UI thread [message #285771 is a reply to message #285769] |
Wed, 25 May 2005 10:57  |
Eclipse User |
|
|
|
Originally posted by: niall.murphy.ie.ibm.com
Thanks for clarifying that John.
Niall
John Arthorne wrote:
> There is no way to remove runnables from the asynchronous event queue.
> Also, NewProjectCreationOperation is not an API class so referencing it
> at all (let alone relying on its behaviour) is not recommended. I don't
> have a suggestion for a better way to do this, other than writing your
> own plugin wizard from scratch. You could enter a feature request
> against PDE to make their wizard pages API, as is done by JDT and the
> basic platform wizards (org.eclipse.jdt.ui.wizards and
> org.eclipse.ui.wizards).
> --
>
> Niall Murphy wrote:
>
>> Hi,
>> sorry if i misuse the word job in this post, im using it to describe a
>> runnable queued on a thread that has yet to be run.
>>
>> When i make a plugin wizard the class that creates the wizard,
>> NewProjectCreationOperation, also opens the manifest editor for the
>> created plugin.xml.
>>
>> I dont want the editor to open.
>>
>> at the moment i am closing the editor by adding the following runnable
>> to the UI thread. This happens before the next UI refresh. This means
>> there is (at best) a strange sight, as the editor opens, starts to
>> draw itself and then closes.
>>
>> PDEPlugin.getActiveWorkbenchWindow().getShell().getDisplay() .asyncExec(new
>> runnable(){
>>
>> public void run() {
>> IFile file = //is acquired
>> //get the editor associated with this file
>> IEditorPart ed =
>> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().findEditor(new
>> FileEditorInput(file));
>>
>> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().closeEditor(ed,
>> false);
>> }
>> });
>>
>> What i would like to do is some how get the list of jobs of the UI
>> thread, pick the one that is going to open the editor and kill it
>> before the next ui refresh.
>>
>> is this possible?
>>
>> is there a better way?
>>
>> thanks
>> Niall Murphy
|
|
|
Powered by
FUDForum. Page generated in 0.09499 seconds