Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » REPOST: Detached views to be brought up independently (Parent shell behaviour)
REPOST: Detached views to be brought up independently (Parent shell behaviour) [message #714606] Thu, 11 August 2011 03:45
Leung Wang Hei is currently offline Leung Wang HeiFriend
Messages: 64
Registered: July 2010
Member
I believe it is properly more appropriate in SWT group especially for
the shell-parent shell behaviour, so paste here for reference and
further discussion.


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?
Previous Topic:ComboBox sizing
Next Topic:How can I view SWT Image while debugging?
Goto Forum:
  


Current Time: Fri Apr 19 08:09:10 GMT 2024

Powered by FUDForum. Page generated in 0.01665 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top