eclipse e4 (Juno) : Not able to hide view Part minimize/maximize buttons - eclipse

within part stack, i have part views. , and each view has minimize/maximize buttons,
Is there is any way i can hide minimize/maximize buttons for some particular view part ?

This is a bug in e4:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394231
There are two different ways to work around this:
Remove this dependency org.eclipse.e4.ui.workbench.addons.swt
Use this CSS-snippet:
.MPartStack {
swt-maximize-visible: false;
swt-minimize-visible: false;
}

But there is another bug if you apply rule as below:
.MPartStack {
swt-maximize-visible: true;
swt-minimize-visible: false;
}
Initially "Minimize" button is hidden.
If you maximize a part stack, now "Minimize" button is visible and you can really minimize the part stack.
MinMaxAddon#setCTFButtons(..) does not respect what css rule said, which always reveal the "Minimize" button for maximized part stack.

Related

how to hide eclipse rcp viewpart borders

Within the View RCP , I'm trying to figure out how to modify or hide the standard 1-pixel black border around each view, or if it's even possible. Anybody know how?
The view is created using standard rcp viewpart extension
Any help or pointers will be helpful
Thanks
You can remove the border around the views if you modifiy the view's parent layout in ViewPart#createPartControl in one of your views like this:
public void createPartControl(Composite parent) {
Composite view_parent = parent.getParent().getParent().getParent();
StackLayout stack_layout = (StackLayout) view_parent.getLayout();
stack_layout.marginHeight = -1;
stack_layout.marginWidth = -1;
// Your code
}
After that you should set the views attributes:
standalone to true
showTitle to false
Unfortunately the border of the "resizer" between the views is still there. If I find a solution for that I will update my answer.
Note: If you have just one view, everything looks nice.

UIStepper does not move up when Navigation Bar dissapears

I am writing a IPhone App. In it there is a search bar (UISearchBar with Controller). When I select it, it gets focussed, and the navigation bar disappears, and the body gets darkened so that when I type on search bar the suggestions (search results) appear. My problem is when I select the search bar, before I type anything, I can see my original view through a tinted black body area. There I see all of my other controls (buttons, textfields) moved up (because navigation bar disappeared), but the UISteppers have not moved, which makes them misaligned.
Why is this ?
It may depend on how you have the relative alignment setup. In your Storyboard, use the Inspector (the ruler icon on the right hand side options) and see if you have set the others to be relative.
I believe this is a bug. I have noticed the same exact behavior in several apps I have worked on (both iPad and iPhone) Storyboard based apps. I have re-produced this behavior on apps with only one orientation. To re-produce, simply layout a scene and add UI elements of different types with at least one UIStepper. Then add the scene to a Nav Controller and all the UI elements will move EXCEPT for any UISteppers.

How to create a toolbar in a TableView with a Label?

I would like to add a toolbar with a label entitled "Save your search?" on the left and a button "Save" on the right that triggers a specific action when tapped. How could I do that programmatically, especially I want this Toolbar to show up only when a particular View is loaded on a screen but not on every view.
Also, I want the toolbar to have a static image as background. "Save" button will also have a static image for background
Just to check; why do you need to add this toolbar of sorts onto a TableView? Depending on how you've set things up; and specially seeing that you need to conditionally hide/show this toolbar, might be easier to add it outside the tableView (just above it I guess).
Seeing as you need to hide/show this toolbar at will; guess you can simply use a UIView for it and add the UIButtons on top as subviews; --> declare it as a property in the .h file so that it can be freely accessed in the .m file whenever you need to hide / show it.
Did you need help on some specific issue related to this perhaps; or would this serve as a goo enough starting point?

JFace - hiding ApplicationWindow menubar and toolbar?

I'm trying to make a method to hide the toolbar and menu in a JFace ApplicationWindow. I tried:
getToolBarControl().setVisible(false);
getMenuBarManager().setVisible(false);
This has no effect on the menu bar. It hides the ToolBar but still leaves the space where the ToolBar was.
(I'm trying to full-screen a composite by hiding them.)
Try overriding ApplicationWindow.addMenuBar() and ApplicationWindow.addToolBar(int) with empty methods.
UPDATE
Sorry, I didn't understand, that you want to hide the controls only temporarily.
That's more complicated. ApplicationWindow overrides Window.getLayout(), and instantiates an ApplicationWindowLayout in this method. That layout does not provide an option to exclude a child temporarily.
You could override this method again and provide a GridLayout instance instead. To position you all direct children of your window, such as the toolbar, the menu, the status bar and your main content component, you need to set GridData instances on them. But if you do so, you can toggle gridData.exclude and call window.layout(), to show or hide the menu and tool bar.

UIButton disabled when covered (or semi covered) by a view

I have a view that holds some UIButtons. Another view covers and hides the buttons. When the top view slides off to reveal the buttons (with an animation).. the UI draws the buttons grayed out until the top view no longer covers or overlaps the buttons at all.. causing an undesirable flicker from gray to the normal button color (white).
is there a way to keep the UIButton from rendering itself disabled while covered or semi covered by another view?
I dont think that its correct that a button is disabled while covered. What is happening is that when its covered, touch events are prevented from getting to the button, so the button cant get pressed. If the button is only partially covered, touch events to that part that are not covered can be received by the button and the button can be depressed. If you really wanted the button to work while it was covered (maybe you can relayer your views so the button is in front of the view instead of behind it?) you could hack your view and void its hit testing so it doesnt capture the touches.
Well, in lieu of actually finding the correct answer, I simply swapped out the buttons with UIImageViews and attached UITapGestureRecognizers to them... this solved the problem.