Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » how to remove grip dots from toolbars
how to remove grip dots from toolbars [message #670084] Thu, 12 May 2011 15:27 Go to next message
Carlo Salinari is currently offline Carlo SalinariFriend
Messages: 66
Registered: October 2010
Member
Hi,

each time I add a toolbar to my rcp application, it comes with a
vertical dotted grip for moving it (I'm under Windows).

Is there a way to remove/hide the dots and make the toolbar unmovable?

Views' toolbars doesn't seem to have them.

I tried setting layout.setFixed(true) in my perspective, but it doesn't
seem to affect toolbars.

Regards,
Carlo
Re: how to remove grip dots from toolbars [message #670092 is a reply to message #670084] Thu, 12 May 2011 16:06 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

In your RCP app WorkbenchWindowAdvisor, use the action bar configurer to get the ICoolBarManager. The use org.eclipse.jface.action.ICoolBarManager.setLockLayout(boole an). That might not get rid of the drag handles, but would prevent the user from moving them around.

PW


Re: how to remove grip dots from toolbars [message #670107 is a reply to message #670092] Thu, 12 May 2011 16:53 Go to previous messageGo to next message
Carlo Salinari is currently offline Carlo SalinariFriend
Messages: 66
Registered: October 2010
Member
On 5/12/2011 6:06 PM, Paul Webster wrote:
> In your RCP app WorkbenchWindowAdvisor, use the action bar
> configurer to get the ICoolBarManager. The use
> org.eclipse.jface.action.ICoolBarManager.setLockLayout(boole
> an). That might not get rid of the drag handles, but would
> prevent the user from moving them around.

this:
public ActionBarAdvisor createActionBarAdvisor(
IActionBarConfigurer configurer) {
ICoolBarManager manager = configurer.getCoolBarManager();
manager.setLockLayout(true);
return new ApplicationActionBarAdvisor(configurer);
}

locks the main toolbar, but the other toolbars I have (in the status
line, see my other message "taking control of the StatusLine") are still
movable, and the handles are invariably there.

I thought this should be easy, since, for example, in eclipse's Console
view I can see a toolbar without handles. How come?
Re: how to remove grip dots from toolbars [message #670117 is a reply to message #670107] Thu, 12 May 2011 17:34 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You could try setting the eclipse preference org.eclipse.ui.IWorkbenchPreferenceConstants.LOCK_TRIM instead (or as well as locking the coolbar). It is usually done by providing a plugin_customization.ini file (either in your product, or using the runtime option -pluginCustomization - see http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/misc/runtime-options.html )

View toolbars are completely different (they were never designed to be moved around).


PW


Re: how to remove grip dots from toolbars [message #670148 is a reply to message #670117] Thu, 12 May 2011 19:29 Go to previous messageGo to next message
Carlo Salinari is currently offline Carlo SalinariFriend
Messages: 66
Registered: October 2010
Member
On 5/12/2011 7:34 PM, Paul Webster wrote:
> You could try setting the eclipse preference
> org.eclipse.ui.IWorkbenchPreferenceConstants.LOCK_TRIM
> instead (or as well as locking the coolbar). It is usually
> done by providing a plugin_customization.ini file (either in
> your product, or using the runtime option
> -pluginCustomization - see
> http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/misc/runtime-options.html
> )

ok, this worked! well, sort of.

I already had a pluginCustomization file preferences.ini for my product
containing:

org.eclipse.ui/KEY_CONFIGURATION_ID=ui.accelerators.scheme.d efault

to which I added:

org.eclipse.ui/LOCK_TRIM=true

(I tried org.eclipse.ui.IWorkbenchPreferenceConstants.LOCK_TRIM=true
first but it didn't work, so by analogy I guessed the correct value for
LOCK_TRIM, but I don't know where this "/slashed" syntax comes from).

Effects:
- the uncool-toolbar in the status-line is now unmovable and shows no
drag handlers (yeah!)
- the coolbar is unmovable, but it still shows the handlers (bad, but I
can live with it)

does this make sense to you?


> View toolbars are completely different (they were never
> designed to be moved around).

I see, thanks.
Re: how to remove grip dots from toolbars [message #670293 is a reply to message #670148] Fri, 13 May 2011 12:08 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Carlo Salinari wrote on Thu, 12 May 2011 15:29

Effects:
- the uncool-toolbar in the status-line is now unmovable and shows no
drag handlers (yeah!)
- the coolbar is unmovable, but it still shows the handlers (bad, but I
can live with it)

does this make sense to you?



Yes. The trim (like the status line) just doesn't create the drag handles in its hosing trim area. The main toolbar is hosted in a coolbar ... they coolitems always have drag handles AFAIK, but locking the coolbar prevents them from moving.

PW


[Updated on: Fri, 13 May 2011 12:08]

Report message to a moderator

Re: how to remove grip dots from toolbars [message #1719249 is a reply to message #670084] Wed, 06 January 2016 15:35 Go to previous message
Michael Dedina is currently offline Michael DedinaFriend
Messages: 6
Registered: January 2016
Junior Member
The following code worked for me. In the application's WorkbenchWindowAdvisor.

	/* (non-Javadoc)
	 * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#postWindowCreate()
	 */
	@Override
	public void postWindowCreate() {
		
		super.postWindowCreate();
		
		// lock the coolbar so that the grip is not displayed
		ICoolBarManager cbManager = getWindowConfigurer().getActionBarConfigurer().getCoolBarManager();
		if (cbManager instanceof CoolBarManager) {
			((CoolBarManager)cbManager).getControl().setLocked(true);
		}
	}


Michael Dedina
Previous Topic:Missing contents in RCP Runtime Binary / RCP SDK ?
Next Topic:Closing a viewpart with a table(50k) rows take too long
Goto Forum:
  


Current Time: Tue Apr 23 15:42:14 GMT 2024

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

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

Back to the top