|
|
|
Re: Detached views to be brought up independently [message #713763 is a reply to message #713157] |
Tue, 09 August 2011 01:16 |
Leung Wang Hei Messages: 64 Registered: July 2010 |
Member |
|
|
Some dirty work...
<extension
point="org.eclipse.ui.internalTweaklets">
<tweaklet
definition="org.eclipse.ui.internal.tweaklets.WorkbenchImplementation"
description="Customized Detached View"
id="id1"
implementation="tweaklets.WorkbenchImplementation"
name="Customized Detached View">
</tweaklet>
</extension>
import java.lang.reflect.Field;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.internal.ShellPool;
import org.eclipse.ui.internal.WorkbenchWindow;
import org.eclipse.ui.internal.tweaklets.Workbench3xImplementation;
public class WorkbenchImplementation extends Workbench3xImplementation {
@Override
public WorkbenchWindow createWorkbenchWindow(int newWindowNumber) {
// return super.createWorkbenchWindow(newWindowNumber);
return new WorkbenchWindow(newWindowNumber) {
@Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
try {
Field field =
WorkbenchWindow.class.getDeclaredField("detachedWindowShells");
field.setAccessible(true);
field.set(this, createShellPool(shell));
} catch (Exception e) {
}
}
};
}
protected ShellPool createShellPool(Shell shell) {
// return new ShellPool(null, SWT.TOOL | SWT.TITLE | SWT.MAX |
SWT.RESIZE | Window.getDefaultOrientation());
return new ShellPool(null, SWT.NO_TRIM | Window.getDefaultOrientation());
}
}
Any other better way?
On 8/8/2011 2:30 PM, Leung Wang Hei wrote:
> I got similar problem.
>
> Let's say I have 2 views(A,B) detached. View A on top of view B on top
> of workbench shell.
>
> Question 1:
> How to let user click at a view to make it on top?
>
> Question 2:
> Now I use a window of other app, say, notepad, to cover view A.
> Is it possible to let user just click at view A to flip it on top of the
> notepad while keeping view B and the main behind notepad?
>
>
>
> On 8/7/2011 5:01 AM, Wim Jongman wrote:
>> Please elaborate.
>>
>>
>>> Currently once any of the detached views is brought up, all others
>>> will be
>> brought top top together with the main app window. Is there any way so
>> that
>> we can control them as if they were an ordinary window or dialog?
>
|
|
|
Re: Detached views to be brought up independently [message #714128 is a reply to message #713763] |
Tue, 09 August 2011 20:31 |
Wim Jongman Messages: 423 Registered: July 2009 |
Senior Member |
|
|
mmm. You should consult with the SWT guru's in the SWT newsgroup.
You can detach both views in the same group. Then they can come on top of
each other.
But it is an interesting topic. Thanks for sharing a solution.
Regards,
Wim
> Some dirty work...
>
>
> <extension
> point="org.eclipse.ui.internalTweaklets">
> <tweaklet
>
> definition="org.eclipse.ui.internal.tweaklets.WorkbenchImplementation"
> description="Customized Detached View"
> id="id1"
> implementation="tweaklets.WorkbenchImplementation"
> name="Customized Detached View">
> </tweaklet>
> </extension>
>
>
>
>
> import java.lang.reflect.Field;
>
> import org.eclipse.jface.window.Window;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.widgets.Shell;
> import org.eclipse.ui.internal.ShellPool;
> import org.eclipse.ui.internal.WorkbenchWindow;
> import org.eclipse.ui.internal.tweaklets.Workbench3xImplementation;
>
> public class WorkbenchImplementation extends Workbench3xImplementation {
>
> @Override
> public WorkbenchWindow createWorkbenchWindow(int newWindowNumber) {
> // return super.createWorkbenchWindow(newWindowNumber);
> return new WorkbenchWindow(newWindowNumber) {
>
> @Override
> protected void configureShell(Shell shell) {
> super.configureShell(shell);
>
> try {
> Field field =
> WorkbenchWindow.class.getDeclaredField("detachedWindowShells");
> field.setAccessible(true);
> field.set(this, createShellPool(shell));
> } catch (Exception e) {
> }
> }
>
> };
> }
>
> protected ShellPool createShellPool(Shell shell) {
> // return new ShellPool(null, SWT.TOOL | SWT.TITLE | SWT.MAX |
> SWT.RESIZE | Window.getDefaultOrientation());
> return new ShellPool(null, SWT.NO_TRIM | Window.getDefaultOrientation());
> }
>
> }
>
>
>
> Any other better way?
>
>
>
>
> On 8/8/2011 2:30 PM, Leung Wang Hei wrote:
>> I got similar problem.
>>
>> Let's say I have 2 views(A,B) detached. View A on top of view B on top
>> of workbench shell.
>>
>> Question 1:
>> How to let user click at a view to make it on top?
>>
>> Question 2:
>> Now I use a window of other app, say, notepad, to cover view A.
>> Is it possible to let user just click at view A to flip it on top of the
>> notepad while keeping view B and the main behind notepad?
>>
>>
>>
>> On 8/7/2011 5:01 AM, Wim Jongman wrote:
>>> Please elaborate.
>>>
>>>
>>>> Currently once any of the detached views is brought up, all others
>>>> will be
>>> brought top top together with the main app window. Is there any way so
>>> that
>>> we can control them as if they were an ordinary window or dialog?
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03347 seconds