Menu visibility control [message #641545] |
Fri, 26 November 2010 01:26 |
ash Messages: 142 Registered: July 2010 |
Senior Member |
|
|
Hi
I have Check Box table and toolbar item, i want toolbar item to be enabled only when if user has checked more than once any row ...if he not checked any row toolbar item has to be disabled..
please can one provide "org.eclipse.core.expressions.definitions" fot this implementation or any other way to implements this
Thanks
ashok
[Updated on: Fri, 26 November 2010 01:27] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: Menu visibility control [message #642559 is a reply to message #641545] |
Wed, 01 December 2010 19:07 |
ash Messages: 142 Registered: July 2010 |
Senior Member |
|
|
Hi dude,,,,,
Thanks of ur instant reply
mViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
IEvaluationService service (IEvaluationService) PlatformUI.getWorkbench().getService(IEvaluationService.clas s);
service.requestEvaluation("com.jobsleaf.canEnable");
}
});
in selection change of table i am trying to invoke requestEvaluation();
wht should be the type to be defined in plugin.xml
wht happens when i call requestEvaluation()....?
propertttester test method is invoked ? if yes ... for me its not invoking.
now how will i pass the count value to the property tests test()method so that
when no selection is there i can return false else true....
if have ready made example please provide me
service.requestEvaluation("com.jobsleaf.canEnable");
wht shld the parameter for requestevaluation weather i am passeing right paarmeter.
[Updated on: Thu, 02 December 2010 01:17] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Menu visibility control [message #643549 is a reply to message #641545] |
Tue, 07 December 2010 11:14 |
ash Messages: 142 Registered: July 2010 |
Senior Member |
|
|
Hi,,
Thanks for ur quick reply...
i thought i will implemenyt with the help of any selectprovider
are any selection change event.... that was i was excepting.
i dont want to carry view reference to the property tester class..
Thats the reason i was thing how to get the count.
Thanks
Ashok
[Updated on: Tue, 07 December 2010 11:17] Report message to a moderator
|
|
|
|
|
|
Re: Menu visibility control [message #644060 is a reply to message #644002] |
Thu, 09 December 2010 10:06 |
Daniel Krügler Messages: 853 Registered: July 2009 |
Senior Member |
|
|
On 12/9/2010 02:41, ashok_kumar_rr@yahoo.com wrote:
> Is it possible to send information at the runtime...
> I dont want to pass value in plugin.xml file
There would be several options to realize that, but it is clear that
those would not provide the context information via the Object[] args or
via the Object expectedValue parameter since these are deduced from the
extension points which are by definition static information. Of-course
this static information can be easily transformed in dynamic
information, if you consider a given static parameter as the key or
argument of some service or map, that allows to dispatch the argument
into runtime behaviour (e.g. an interface method call).
Some more explicit examples:
- Use your own Java properties (global state, ugly, but possible)
- Retrieve the information from services that exist or that you have
defined. You can always ask the Workbench itself for a service
- Use the adaptable mechanism: Either the tested object implements
IAdaptable or you directly query the adapter manager (IAdapterManager
from Platform.getAdapterManager()) and ask for a "service" that has been
associated to your type. You can use the
org.eclipse.core.runtime.adapters ext. pt to register your own adapter
factories.
Thus, there are numerous solutions. Since we don't know, what exactly
you want, we can only guess here. I strongly recommend to provide useful
information, because otherwise you cannot expect much helpful replies.
HTH & Greetings from Bremen,
- Daniel Krügler
|
|
|
|
Powered by
FUDForum. Page generated in 0.05854 seconds