How to control the visibility of objectContribution in popupMenus? - eclipse

Hi guys,I had create a popupmenu with code above and this menu would be only showed if the folder's name matched "AAA".
Here is the problem:if there is a folder which is also named "AAA" after another folder,this menu would be showed,too.Actually we just wanna our popupmenu be showed in specific main folders,not their sub-folders.So how can i do this?

Define an additional "visibility" tag for that contribution and then use a PropertyTester inside the visibility tag to check the name in more detail.

Related

install4j: Configurable form change visibility from drop-down list

I have a Configurable Form and i want to change the visibility of another field based on the value of a Drop-down list.
For example I have a Drop-Down list with entries A,B and the variable name for it is testDD.
I have a Text field smtpMailServer that I want to display only if testDD's value is A.
I have tried the following approaches in smtpMailServer's visibility without success:
return ((String) context.getVariable("testDD")).equals("A");
return (context.getVariable("testDD")).equals("A");
and I've also tried to add a script to testDD Change Selection Script with The following code
context.setVariable("ThisFormConfiguration", selectedItem);
And use the code above with ThisFormConfiguration instead of testDD. But it's not working.
Could you please help me?
Thanks!
I have tried the following approaches in smtpMailServer's visibility without success
The visibility script of a form component is only evaluated when the form is shown. You should keep it, but it only handles the initial condition.
and I've also tried to add a script to testDD Change Selection Script with
The following code context.setVariable("ThisFormConfiguration", selectedItem); A
Using the "Selection change script" property is the right idea, but your script has no effect. There is no live binding from the variables to the form components, the variable is read when the form is shown and updated when the user clicks "Next".
You have to use the following selection script:
formEnvironment.getFormComponentById("123").setVisible(selectedItem.equals("A"));
where "123" has to be replaced by the ID of the text field.

What is the name space of conversion.val in C#?

I have one text box in C# window application.And i wants to set a initial value of this text box is zero.
so i use conversion.val(textbo1.text) method.
But it gives a error in name space.
I use Using Microsoft.visulbasic; name space but it is not working.
So which name space i use for conversion.val().
Please help me.
Thank you.
The namespace you are adding is correct.
Refer: http://msdn.microsoft.com/en-us/library/9da280t0.aspx
Only adding namespace might not work, you will have to manually add Reference to Microsoft.VisualBasic.dll.
You can add the reference as follows:
- Goto the Solution Explorer panel.
- Right click on References > Add Reference.
- Select the tab ".Net"
- Select Component "Microsoft.VisualBasic"
- Click OK.
Now you can use the Conversion class.
Note: You can find Solution Explorer in the View menu.
Good luck!

transfer netbeans made component to lwuit's "Resource Editor"

I tried to use "table" Component in a Form with "Resource Editor" in lwuit, but I could not add/edit the rows items. so I end up with this question:
Is it possible to create/edit the table component in the generated "StateMachine" class in Netbeans and see the result in "Resource Editor"?
And if it's not possible, how can I hack the .res file in order to make the "table" as it should be?
There is support for live embedding in the resource editor but its deprecated and obtuse.
I suggest you just add a label where you want the custom component to be, give it a unique name and override the method createComponentInstance which is invoked internally with the name of the label (name it something unique).
You can then just return the instance of your custom made component and it will appear where the label is in the GUI builder.

Find button in a EXT JS form

I can do myForm.getForm().findField('myFld'); to find a field by name. What's the equivalent of finding a button?
Fields exept name can also have ref propety:
name: 'fieldID',
ref: 'your_reference',
this way you do not need to find them - to access this.your_reference
you can do it with button also. Trick is: if button is on toolbar (top or bottom) use ref: '../your_btn_ref' to get 1 level up 9direct will go to toolbar)
Do you mean find? "Find a component under this container at any level by property."
More generally, you can use findBy.
Try this:
getItemByItemId(btnId)
using "ref" doesnt always work, it is abit hit and miss.
I would recommend either giving the button and ID and using Ext.getCmp(buttonid);
or
Search for the button class using Ext.select and select the approriate array key, Ext.select();

How to make tinymce styleselect to overwrite actual class with selected one

As i use styleselect combobox, i am able to apply many classes to one object simply by chosing each style from styleselect combobox, and I can turn off class only by chosing same class again. so all styles work like "checkboxes", and i wish to make from them "radiobuttons", i want mine tinymce to apply max 1 class to object, if parent has class, then split parent and aply class, for example
Some text here (i select "text" and set my_class2) and i wish to get result:
Some text here
and 2nd case, if i select all "Some text here" and aply my_class2 i wish to get result:
Some text here
(now result will be: Some text here
I hope it's clear now ;)
Best regards!
You might, if you don't mind meddling in their code. using the formatselect option, check out theme_advanced_blockformats in editor_template_src.js and add your tags with 'class=moshe' in them.. there could be only one tag (it replaces them), so you got your radio buttons :)
There is no standard way to insert checkboxes inside the tinymce UI. You should be able to make it work using checkboxes outside the editor and link to the function the style plugin uses.