Im trying to use fxml and JavaFX for my application.
But when the fxmlLoader load my file, i receive the following error:
javafx.fxml.LoadException: Font is not a valid type.
I really do not understand why. In a other Interface I use exactly the same label.
the fxml code of the used label:
<Label fx:id="blueLabel" alignment="CENTER" maxWidth="Infinity"
prefHeight="10.0" textFill="#054682" BorderPane.alignment="CENTER">
<font>
<Font size="1.0" />
</font>
</Label>
I hope you can help me. Thanks a lot
Import the Font as
<?import javafx.scene.text.Font?>
or with wildcard
<?import javafx.scene.text.*?>
in the FXML file.
Related
I am trying to make a business critical SAPUI5 application more accessible using screen readers by adding ARIA labels and landmarks. One issue is that some SAPUI5 elements such as sap.m.Title's without text have been used (abused) for layout purposes. I would like to add the aria-hidden attribute or a SAPUI5 analogue to these Title elements. But I can't figure out how to do this. I would like to change
<Title text="" class="title" />
into
<Title aria-hidden="true" text="" class="title" />
But setting aria-hidden on the Title like this seems to be invalid. How would I go about setting a standard HTML attribute on a SAPUI5 control?
Thank you in advance for your help!
Joshua
I have a simple Fiori application. I want to delete some texts in it.
I have little knowledge about UI5, and I found that the text is in the file "Detail.View.xml".
<ObjectHeader
id="objectHeader"
title="{
path: 'Zperiod',
formatter: '.sText1'
}"
number="{Pernr}">
<statuses>
<ObjectStatus
text="带薪年假剩余{Zsfnj}天"
state="Error" />
<ObjectStatus
text="带薪病假剩余{Zsybj}天"
state="Success"
visible="{
path: 'Znote1',
formatter: '.statusText'
}"/>
<ObjectStatus
text="调休假剩余{Znumc1}天"
state="Warning" />
</statuses>
<attributes>
<ObjectAttribute text="{Name2}" />
<ObjectAttribute text="{Orgtx}" />
<ObjectAttribute text="{Plstx}" />
</attributes>
</ObjectHeader>
I replaced the texts with text="" in SE80, saved, and activated it. But when I open the application again, the texts are still there.
(My colleague told me we have an independent AS for Fiori application, and we can change object in PRD. So no transport needed.)
I cannot understand the appearance. Could someone tell me why my modification has no effect?
It is an cache issue.
After clearing cache by transaction SMICM, it works fine.
Thanks for all your comments, especially #boghyon, your edit give me a lot of help.
I new to javaFx and using fxml to create templates.
I can't manage to center a Vbox in a Pane that is too big, although I'm certain it must be quite straightforward.
I also want a border around the VBox.
Can anyone help? Here is what I have:
<TitledPane text="Title" collapsible="false">
<content>
<GridPane hgap="10" vgap="10">
<children>
<VBox alignment="TOP_CENTER" spacing="10">
<!-- Content -->
</VBox>
</children>
<columnConstraints>
<ColumnConstraints halignment="CENTER"/>
</columnConstraints>
<rowConstraints>
<RowConstraints/>
</rowConstraints>
</GridPane>
</content>
</TitledPane>
I guess the GridPane is a bad idea, but this is the way I know to have the borders as I want them.
Thanks for your time!
I guess the GridPane is a bad idea, but this is the way I know to have the borders as I want them.
Yes it is. Using a GridPane for a single child is a overkill. Simply use a StackPane with a padding of 10:
<TitledPane text="Title" collapsible="false">
<content>
<StackPane>
<padding>
<Insets topRightBottomLeft="10"/>
</padding>
<children>
<VBox alignment="TOP_CENTER" spacing="10">
<children>
<!-- Content -->
</children>
</VBox>
</children>
</StackPane>
</content>
</TitledPane>
Cross-post from Adobe Community Forums: http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__qugo-we_have_an_imagecom.html
We have an image component, its _cq_editConfig.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
cq:disableTargeting="{Boolean}true"
jcr:primaryType="cq:EditConfig">
<cq:dropTargets jcr:primaryType="nt:unstructured">
<image
jcr:primaryType="cq:DropTargetConfig"
accept="[image/.*]"
groups="[media]"
propertyName="./fileReference">
</image>
</cq:dropTargets>
</jcr:root>
We have a page component ("Blurb") which includes this component as the "featuredImage", as well as a "body" parsys which allows the same component to be used:
<div>
<h1>*Page Title</h1>
<cq:include path="pageTitle" resourceType="sitename/components/plainText"/>
</div>
<div>
<h1>*Featured Image</h1>
<cq:include path="featuredImage" resourceType="sitename/components/image"/>
</div>
<div>
<h1>*Body</h1>
<cq:include path="body" resourceType="sitename/components/page/blurb/parsys"/>
</div>
If I place a sitename/components/image component in the parsys, I can drag an image from the content finder onto the component to set it. The featuredImage, however, will not accept the drag-n-drop from the content finder (the "not allowed" cursor appears, dropping the image does nothing). If I open the featureImage's edit dialog, I can drag a content finder image to there. I am the admin user, there are no permission restrictions.
The same issue applies to text components configured for inline editing. When the text component is placed in the body parsys (or any parsys), the inline editor works. When the text component is placed outside of the parsys (Page Title in the example above), the inline editor will not appear.
Interestingly, when I change the Blurb page component use foundation components, the featuredImage drag-n-drop works, but the pageTitle inline editing does not.
<div>
<h1>*Page Title</h1>
<cq:include path="pageTitle" resourceType="foundation/components/text"/>
</div>
<div>
<h1>*Featured Image</h1>
<cq:include path="featuredImage" resourceType="foundation/components/image"/>
</div>
<div>
<h1>*Body</h1>
<cq:include path="body" resourceType="sitename/components/page/blurb/parsys"/>
</div>
Is this a WCM bug? Are our components' cq:editConfig definitions missing something?
EDIT: This is running on AEM 5.6.1.
Our Image component's .content.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Component"
jcr:title="Image (Custom)"
sling:resourceSuperType="foundation/components/image"
allowedParents="[*/parsys]"
componentGroup="Site Name Group"/>
And dialog.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Dialog"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<advanced
jcr:primaryType="cq:Widget"
path="/apps/sitename/components/image/tab_advanced.infinity.json"
xtype="cqinclude"/>
<image
jcr:primaryType="cq:Widget"
path="/apps/sitename/old/components/image/dialog/items/image.infinity.json"
xtype="cqinclude"/>
</items>
</jcr:root>
And the cqinclude'd /apps/sitename/components/image/tab_advanced.infinity.json
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Panel"
title="Advanced">
<items jcr:primaryType="cq:WidgetCollection">
<image
jcr:primaryType="cq:Widget"
collapsed="{Boolean}false"
collapsible="{Boolean}true"
title="Image"
xtype="dialogfieldset">
<items jcr:primaryType="cq:WidgetCollection">
<title
jcr:primaryType="cq:Widget"
allowBlank="{Boolean}false"
fieldDescription="Required Field: If the Alt Text field is left blank, the image title will be used instead. "
fieldLabel="Image Title"
maxLength="{Long}60"
name="./jcr:title"
xtype="textfield"/>
<linkUrl
jcr:primaryType="cq:Widget"
fieldDescription="Optional Field: use the link field to specify where the image ought to link to."
fieldLabel="Link to"
name="./linkUrl"
regex="/^\\S*$/"
regexText="Please enter a valid link"
xtype="pathfield"/>
<alt
jcr:primaryType="cq:Widget"
fieldDescription="Optional Field: When text is entered into the Alt text field it will be used instead of the image Title. If the image is used as a link, the Alt text is used for the name of the link. For example <a href="http://slipsum.com/"> Visit Samuel L. Ipsum</a>"
fieldLabel="Alt Text"
maxLength="{Long}100"
name="./alt"
xtype="textfield"/>
<description
jcr:primaryType="cq:Widget"
fieldDescription="Optional Field: used to populate the image caption"
fieldLabel="Caption"
maxLength="{Long}256"
name="./jcr:caption"
xtype="textarea"/>
</items>
</image>
</items>
</jcr:root>
And /apps/sitename/old/components/image/dialog/items/image.infinity.json
<image
jcr:primaryType="cq:Widget"
allowUpload="{Boolean}false"
ddGroups="[media]"
fileNameParameter="./fileName"
fileReferenceParameter="./fileReference"
name="./file"
requestSuffix=".img.png"
title="Image"
xtype="html5smartimage"/>
Sample package for testing (with the text component inline editing) at: http://s000.tinyupload.com/index.php?file_id=05420490884931180108
Since I don't have the full source I can only guess which problem you are actually experiencing. I see one of the following as the possible reasons:
You either do not provide the CQ editor classes as described here
Your custom parsys is misconfigured, try replacing it with the foundation one.
I tried to reproduce the issue, but didn't succeeded, it's working for me. I created this sample project for you.
In my plugin/RCP I have defined my own contributions to Eclipse universal intro with page definitions inside the toplevel xml (the one pointed to by the "config" attribute to the "configExtension" element of the org.eclipse.ui.intro.configExtension extension point), which works.
However, I'd like to split out the page definitions to separate files for simpler editing and managing.
So I start out with (in my intro/introcontent.xml):
<page id="myfirststeps" style="$theme$/html/firststeps.css" style-id="page">
<!-- Page content here -->
</page>
And this works. The intro displays the page content correctly. Then I move the page content to firststeps.xml:
<?xml version="1.0" encoding="utf-8" ?>
<introContent>
<page id="myfirststeps" style="$theme$/html/firststeps.css" style-id="page">
<!-- Page content here -->
</page>
</introcontent>
and change the toplevel xml to say:
<page id="myfirststeps" content="intro/firststeps.xml" />
does not work. Running this creates a "File not found" exception, and the file indicated is pointing into the Eclipse installation (like "C:\Program Files\Eclipse") and not, as I would have expected into my plugin. And sure enough, if I copy my xml-file there it finds it.
Any pointers? Is there some trick about the content attribute and how it resolves the path to the file?
Or is there a way to specify a path to the plugin directory in the content attribute?
I'm using Eclipse 3.7.
Turned out that the solution was simple. The file reference in the content attribute is relative to the referencing xml-file, not relative to the plugin-root.
So all I had to do was to remove the "intro"-part of the path. From
<page id="myfirststeps" content="intro/firststeps.xml" />
to
<page id="myfirststeps" content="firststeps.xml" />
And all is well.