Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Hiding/Showing shared parts in multiple placeholders
Hiding/Showing shared parts in multiple placeholders [message #1715311] Sat, 21 November 2015 19:29
Stefan Häusler is currently offline Stefan HäuslerFriend
Messages: 23
Registered: May 2013
Junior Member
I have the following problem:

In my application, there exists a shared element (a Part). This part is used in three perspectives, with a placeholder in each.

I now wanted to create a menu item in the application menu bar that shall show/hide this specific view. As it is part of placeholder, the action has to hide actually all placeholder:

Used the following code in the handler:

private void setViewVisibility(MWindow window, EModelService mService) {
        //Find all placeholder holding the View as MPart, Selector implements the criteria to search for a placeholders holding a part with a certain view id
        for (MPlaceholder mPlaceholder : mService.findElements(window, MPlaceholder.class,
            EModelService.IN_ANY_PERSPECTIVE, new ViewSelector())) {
            //
            mPlaceholder.setVisible(!mPlaceholder.isVisible());
            mPlaceholder.getParent().setVisible(mPlaceholder.isVisible());

            //If placeholder became visible and its on active perspective
            if (mService.getActivePerspective(window).equals(mService.getPerspectiveFor(mPlaceholder))
                && mPlaceholder.isToBeRendered()) {
                mService.bringToTop(mPlaceholder);
                pService.activate((MPart)mPlaceholder.getRef(), true);
            }
        }
    }


It looks like it works the first time from user perspective. After first time, the view always appears (just the Part Tab does), i always have to click it once, so that the real content appears. Also no bringToTop or set focus did work though.

Also tried it with the toBeRendered attribute, is this seems to be set when you manually close the view...looks a little bit better, but even also not working perfectly

What should be the way to go here...

Thanks in advance,
Stefan

[Updated on: Sat, 21 November 2015 19:46]

Report message to a moderator

Previous Topic:Eclipse Luna RC1 shows blank window after start.
Next Topic:container data stopped working
Goto Forum:
  


Current Time: Fri Sep 25 11:26:35 GMT 2020

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

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

Back to the top