In Application.e4xmi I have two perspectives:
...
<children xsi:type="advanced:PerspectiveStack" xmi:id="_ySFusPeXEeKXHJPsnYiiYQ" elementId="com.myapplication.ui.perspectivestack.main">
<children xsi:type="advanced:Perspective" xmi:id="_83bVsPeXEeKXHJPsnYiiYQ" elementId="com.myapplication.ui.perspective.testmanager" label="Test manager">
...
<children xsi:type="advanced:Perspective" xmi:id="_bDA4oPeaEeKXHJPsnYiiYQ" elementId="com.myapplication.ui.perspective.configurator" label="Configurator">
...
and a main menu with two items:
<mainMenu xmi:id="_xanVgPfWEeKXHJPsnYiiYQ" elementId="com.myapplication.ui.menu.0">
<children xsi:type="menu:HandledMenuItem" xmi:id="_22vnAPfWEeKXHJPsnYiiYQ" elementId="com.myapplication.ui.handledmenuitem.uno" label="uno" command="_LFFTsPhHEeK44MdhTvpdlg">
<visibleWhen xsi:type="ui:CoreExpression" xmi:id="_28cw8PfXEeKXHJPsnYiiYQ" coreExpressionId="com.myapplication.ui.perspectiveselected.testmanager"/>
</children>
<children xsi:type="menu:HandledMenuItem" xmi:id="_49obAPfWEeKXHJPsnYiiYQ" elementId="com.myapplication.ui.handledmenuitem.due" label="due" command="_NXT1APhHEeK44MdhTvpdlg">
<visibleWhen xsi:type="ui:CoreExpression" xmi:id="_ZP4lgPhHEeK44MdhTvpdlg" coreExpressionId="com.myapplication.ui.perspectiveselected.configurator"/>
</children>
</mainMenu>
The menu item "com.myapplication.ui.handledmenuitem.uno" has to be shown when perspective "com.myapplication.ui.perspective.testmanager" is shown.
The menu item "com.myapplication.ui.handledmenuitem.due" has to be shown when perspective "com.myapplication.ui.perspective.configurator" is shown.
So that, I defined in plugin.xml:
<extension
point="org.eclipse.core.expressions.definitions">
<definition
id="com.myapplication.ui.perspectiveselected.testmanager">
<with
variable="activeWorkbenchWindow.activePerspective">
<equals
value="com.myapplication.ui.perspective.testmanager">
</equals>
</with>
</definition>
</extension>
<extension
point="org.eclipse.core.expressions.definitions">
<definition
id="com.myapplication.ui.perspectiveselected.configurator">
<with
variable="activeWorkbenchWindow.activePerspective">
<equals
value="com.myapplication.ui.perspective.configurator">
</equals>
</with>
</definition>
</extension>
IT DOESN'T WORK !! (menu items are shown always)
Any ideas?
I see that you have applied on the definition itself. Create a new command and register it with your menu and then write your expression on it.
Example:
<command
commandId=" "
label=" "
mnemonic="A">
<visibleWhen
checkEnabled="false">
<with
variable="">
<equals
value="1">
</equals>
</with>
</visibleWhen>
</command>
Related
How can I define a "legal state configuration" according to https://www.w3.org/TR/scxml/#LegalStateConfigurations. I want to specify a target set (!), not a single target. Target sets can be defined inside the initial attribute of the <scxml> and <state> elements, as well as a target attribute of <transition> elements. But I can't seem to find any example of the notation of more than one state inside the above-mentioned attributes. Do they have to be space-separated? Or array notation according to JavaScript? Or object notation? Or comma-separated?
Thanks for any hints.
But anyway I'd like to know, what I have missed in the standard, to be sure to be interpreter-independent.
Here's a little testcode:
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0">
<initial>
<transition target="State_3_2 State_4_2" />
</initial>
<parallel id="Parallel_1">
<history id="hist" type="deep">
<transition target="State_1_2 State_2_2" />
</history>
<state id="State_1">
<state id="State_1_1" />
<state id="State_1_2" />
</state>
<state id="State_2">
<state id="State_2_1" />
<state id="State_2_2" />
</state>
</parallel>
<parallel id="Parallel_2">
<transition target="hist" event="switch_hist" />
<state id="State_3">
<state id="State_3_1" />
<state id="State_3_2" />
</state>
<state id="State_4">
<state id="State_4_1" />
<state id="State_4_2" />
</state>
</parallel>
</scxml>
To test: on entry, the states State_3_2 and State_4_2 must be active (initial element executed correctly), after event switch_hist, states State_1_2 and State_2_2 must be active (transitionattribute executed correctly).
If somebody has an interpreter all set other than SCION, could You test this there?
Also the alternative syntax with the first 4 lines replaced by
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initial="State_3_2 State_4_2">
Thank You.
It is space-separated. You can see an example of this in the SCXML test test suite. For example line 9 of test364.
Hope this helps. Thanks.
I'm trying to do a vimgrep on a file in order to get only two attributs with their values out of the xml file.
so far i can get the complete lines and i'd like with the help of groups to have a better display.
:vimgrep key= % | copen
^ I'd like to add to this command the grouping possibility with "( )" ....but without success for the moment.
i'd appreciate your help in order to have a result as explained in the "result expected"
part of the file that I'm working with :
<policy name="Menu_Controls" class="User" displayName="$(string.Menu_Controls)" explainText="$(string.IE_ExplainMenu_Controls)" presentation="$(presentation.Menu_Controls)" key="Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\AllowedControls">
<parentCategory ref="AdminApproved" />
<supportedOn ref="SUPPORTED_IE5" />
<elements>
<boolean id="MCSiMenu" valueName="{275E2FE0-7486-11D0-89D6-00A0C90C9B67}">
<trueValue>
<decimal value="0" />
</trueValue>
<falseValue>
<decimal value="1" />
</falseValue>
</boolean>
<boolean id="PopupMenu_Object" valueName="{7823A620-9DD9-11CF-A662-00AA00C066D2}">
<trueValue>
<decimal value="0" />
</trueValue>
<falseValue>
<decimal value="1" />
</falseValue>
</boolean>
<boolean id="Ikonic_Control" valueName="{F5131C24-E56D-11CF-B78A-444553540000}">
<trueValue>
<decimal value="0" />
</trueValue>
<falseValue>
<decimal value="1" />
</falseValue>
</boolean>
</elements>
</policy>
<policy name="Microsoft_Agent" class="User" displayName="$(string.Microsoft_Agent)" explainText="$(string.IE_Explain_Microsoft_Agent)" presentation="$(presentation.Microsoft_Agent)" key="Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\AllowedControls">
<parentCategory ref="AdminApproved" />
<supportedOn ref="SUPPORTED_IE5" />
<elements>
<boolean id="Microsoft_Agent_Control" valueName="{D45FD31B-5C6E-11D1-9EC1-00C04FD7081F}">
<trueValue>
<decimal value="0" />
</trueValue>
<falseValue>
<decimal value="1" />
</falseValue>
</boolean>
</elements>
</policy>
my expected result :
name="Menu_Controls" key="Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\AllowedControls"
name="Microsoft_Agent" key="Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\AllowedControls"
thanks in advance for your help.
toshi
two cmds could do it:
v/<policy /d
then
%s/.* \(name="[^"]*"\).*\(key="[^"]*"\).*/\1 \2/g
My ExtractMatches plugin provides a :YankMatches command, with which you can extract the matches and put them into a scratch buffer. As a one-liner:
:execute 'YankMatches \<\%(name\|key\)="[^"]*"' | new | put!
Result:
name="Menu_Controls"
key="Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\AllowedControls"
name="Microsoft_Agent"
key="Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\AllowedControls"
If you find :vimgrep and the quickfix list really helpful, you can use the editqf.vim plugin to make the quickfix list of your grep results editable, and then use e.g. a variation of the :%s command given in #Kent's answer to strip off the extraneous stuff.
I would like to align the button of the right, but keep the content tabs on the left. This is my code:
<ext:TabPanel ID="TabPanel1" runat="server" Height="295" Plain="true" DeferredRender="false" meta:resourcekey="TabPanel1Resource1">
<TabBar>
<ext:Button runat="server" Icon="ArrowOut" meta:resourcekey="fullscreenResource1">
<DirectEvents>
<Click OnEvent="edit_fullOpenAdd" />
</DirectEvents>
</ext:Button>
</TabBar>
<Defaults>
<ext:Parameter Name="autoScroll" Value="true" Mode="Raw" />
</Defaults>
<Items>
......the content ......
</Items>
</ext:TabPanel>
Any Ideas?
Thank you!
Edit: I was told to try tabCls: 'right-tab', but I do not know how to implement this.
Use TabStrip control.
Please see this example: http://examples.ext.net/#/TabPanel/TabStrip/Overview/
I have the following FXML:
<ChoiceBox>
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="2 minutes" />
<String fx:value="5 minutes" />
<String fx:value="15 minutes" />
</FXCollections>
</items>
</ChoiceBox>
But in the GUI it just shows a ChoiceBox with a default of nothing. I would like the first element in the list to be the default, and for a choice of "null" or nothing to be prohibited.
How do I accomplish this?
I added the value attribute to the ChoiceBox tag, and that worked.
<ChoiceBox value="2 minutes">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="2 minutes" />
<String fx:value="5 minutes" />
<String fx:value="15 minutes" />
</FXCollections>
</items>
</ChoiceBox>
First, you should import your needed value model, like Crowell answer, you should import like this in your fxml header:
<?import javafx.collections.*?>
Second, if you want's import your own model, import it first and then like this:
<?import com.zzg.mybatis.generator.model.*?>
....
<ChoiceBox layoutX="24.0" layoutY="14.0" prefWidth="150.0">
<items>
<FXCollections fx:factory="observableArrayList">
<DatabaseDTO name="MySQL" value="1"></DatabaseDTO>
<DatabaseDTO name="Oracle" value="2"></DatabaseDTO>
</FXCollections>
</items>
</ChoiceBox>
#Groostav: In case we programmatically "know" the value that should appear as selected (for example, we landed in an edit form), we can do the following:
1) Add a new item with index 0 (that is, the element we need to show as selected):
myChoiceBox.getItems().add(0, ItemObtainedProgrammatically);
2) Show the item as selected (since we already know it's at position 0):
myChoiceBox.getSelectionModel().select(0);
Probably this qualifies as a dirty hack, but it works. The con: You have the same item twice in your choicebox
I have custom button in lead ribbon. The custom button should be hidden when lead is qualified. How can I do that? Can any one please explain. I appreciate.
You can actually accomplish this entirely with built-in DisplayRule functionality. When a Lead is qualified, the StatusCode property is set to "Qualified", which translates into an OptionSet value of "3". You can check for the value of this property in a ValueRule and display/hide the control appropriately. I can think of two ways to achieve this:
Erik Pool's Visual Ribbon Editor
RibbonXml
<RibbonDiffXml>
<CustomActions>
<CustomAction Id="CompanyName.Form.lead.MainTab.Actions.Sample.CustomAction" Location="Mscrm.Form.lead.MainTab.Actions.Controls._children" Sequence="41">
<CommandUIDefinition>
<Button Id="CompanyName.Form.lead.MainTab.Actions.Sample" Command="CompanyName.Form.lead.MainTab.Actions.Sample.Command" Sequence="29" ToolTipTitle="$LocLabels:CompanyName.Form.lead.MainTab.Actions.Sample.LabelText" LabelText="$LocLabels:CompanyName.Form.lead.MainTab.Actions.Sample.LabelText" ToolTipDescription="$LocLabels:CompanyName.Form.lead.MainTab.Actions.Sample.Description" TemplateAlias="isv" />
</CommandUIDefinition>
</CustomAction>
</CustomActions>
<Templates>
<RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
</Templates>
<CommandDefinitions>
<CommandDefinition Id="CompanyName.Form.lead.MainTab.Actions.Sample.Command">
<EnableRules />
<DisplayRules>
<DisplayRule Id="CompanyName.Form.lead.MainTab.Actions.Sample.Command.DisplayRule.ValueRule" />
</DisplayRules>
<Actions>
<Url Address="http://www.bing.com" />
</Actions>
</CommandDefinition>
</CommandDefinitions>
<RuleDefinitions>
<TabDisplayRules />
<DisplayRules>
<DisplayRule Id="CompanyName.Form.lead.MainTab.Actions.Sample.Command.DisplayRule.ValueRule">
<ValueRule Field="statuscode" Value="3" />
</DisplayRule>
</DisplayRules>
<EnableRules />
</RuleDefinitions>
<LocLabels>
<LocLabel Id="CompanyName.Form.lead.MainTab.Actions.Sample.LabelText">
<Titles>
<Title languagecode="1033" description="Sample" />
</Titles>
</LocLabel>
<LocLabel Id="CompanyName.Form.lead.MainTab.Actions.Sample.Description">
<Titles>
<Title languagecode="1033" description="Sample Description" />
</Titles>
</LocLabel>
</LocLabels>
</RibbonDiffXml>