Let's say I have 3 toolbars toolBarA, toolBarB and toolBarC. toolbarA and toolBarB are in top row. toolBarC is in the second row. Now I have added toolBarD. It is automatically placed after toolBarC in second row, but I want it to be placed in first row, after toolBarB.
Now, if drag the toolBarD to the desired location in Qt Creator, everything looks fine, but when I run the project, the toolBarD is always placed after toolBarC in the second row.
How to make it stay where I want? I have tried rebuilding whole project but that doesn't change anything.
Here is what it looks like
It's more like a workaround than a proper solution, but it works.
The order in which toolbars are created makes a difference. Qt Creator will not change the order automatically. To trick Qt Creator that toolBarD was added right after toolBarB and before toolBarC you need to close the Creator and open .ui file inside a text editor and locate following block.
<widget class="QToolBar" name="toolBarD">
...
</widget>
Now you have to cut it and paste it somwhere between block resposible for creation of toolBarB and toolBarD. For example, like this:
<widget class="QToolBar" name="toolBarB">
...
</widget>
<widget class="QToolBar" name="toolBarD">
...
</widget>
<widget class="QToolBar" name="toolBarC">
...
</widget>
Save the file and reopen the project inside Creator. toolBarD should be now placed right after toolBarB.
Related
I am creating a Eclipse e4 RCP Application. I want to add a image at the background. I have tried adding property in plugin.xml:
<property
name="applicationCSSResources"
value="platform:/plugin/rcptutorial/image/image.jpg">
Also, I created a new folder "Images" and added "image.jpg in it. I also added the line in default.css:
Shell { background-image: url('./image.jpg');}
But nothing happens when I run it. I can apply background-color but unable to add image.
Please help.
My Plugin.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
id="product"
point="org.eclipse.core.runtime.products">
<product
name="org.rcptutorial.rcp"
application="org.eclipse.e4.ui.workbench.swt.E4Application">
<property
name="lifeCycleURI"
value="bundleclass://rcptutorial/org.rcptutorial.rcp.E4LifeCycle">
</property>
<property
name="applicationCSS"
value="platform:/plugin/rcptutorial/css/default.css">
</property>
<property
name="applicationCSSResources"
value="platform:/plugin/rcptutorial/images/">
</property>
</product>
</extension>
</plugin>
My default.css is as follows:
Shell { background-image: url('./images/image.jpg');}
I have an "images" folder that contains the image "image.jpg". The folder is located inside my project
applicationCSSResources must specify a folder which contains the images:
<property
name="applicationCSSResources"
value="platform:/plugin/rcptutorial/image/">
</property>
(the ending '/' must be present).
The URL in the CSS should just be:
url('./image.jpg')
I'm stepping through "Eclipse 4 Plug-in Development by Example Beginner's Guide", and on section "Time for action – styling the UI with CSS".
The instructions here specify to edit "css/default.css" and add the following:
Shell {
background-color: blue;
}
Unfortunately, this has no effect. The background is still the default greyish color.
What can I do to debug this?
I tried running the "CSS Spy" tool, but I don't understand how to use it.
Update:
Here is my entire plugin.xml file:
<plugin>
<extension id="product"
point="org.eclipse.core.runtime.products">
<product name="com.packtpub.e4.application"
application="org.eclipse.e4.ui.workbench.swt.E4Application">
<property name="appName" value="com.packtpub.e4.application">
</property>
</product>
</extension>
</plugin>
The instructions in the section don't mention anything to do in here. Where is there more information about what should be in here for this "simple" application?
Update:
So it appears that the book instructions neglected to mention the need for the "applicationCSS" property setting. I added that manually as directed, and that fixed the problem.
The advice about "You should also specify the CSS name in the .product file" brings up additional questions.
It wasn't clear to me why this should also be done, in addition to setting the property in the plugin.xml file. The field on that wizard page doesn't really explain what the value is used for, but it sounded to me like it has the same purpose as setting that property.
So, I tried removing the manual setting in the "plugin.xml" file and using the wizard to browse for the file. I saved that and then inspected the "plugin.xml" file, as I expected that action in the wizard to populate that property. There was no change. I then looked at the wizard again and read the statement after that field, which said this (weird that selecting that text in the wizard and pressing Ctrl-C doesn't put the text into the clipboard):
'You must Synchronize (this word a hyperlink) the product's defining plug-in to ensure that the CSS file specified above is referenced in the plug-in's "org.eclipse.core.runtime.products" extension point.'
So I tried clicking that hyperlink. That inserted the property into the plugin.xml file. This brings up more questions.
If it's apparently important that "the CSS file specified above" is specified as the "applicationCSS" property in the "plugin.xml" file, why does the developer need to take a deliberate action to make this happen, as opposed to Eclipse just mirroring that value in the property?
The reference to the "org.eclipse.core.runtime.products" extension point is curious. When I view the "plugin.xml" file for a non-e4 Eclipse application, I see tabs for "Extensions" and "Extension Points", but not when I view the wizard for this sample e4 application. In addition, I don't see any reference to extensions or extension points in this generated "plugin.xml" file.
Is the value entered into the wizard used for ANYTHING except to use it to (manually) synchronize the value of the "applicationCSS" property?
You must have an applicationCSS entry in the product entry in the plugin.xml (or a cssTheme if using themes) without this no CSS styling will be done.
Something like:
<extension
id="product"
point="org.eclipse.core.runtime.products">
<product
name="greg.e4App2"
application="org.eclipse.e4.ui.workbench.swt.E4Application">
<property
name="applicationCSS"
value="platform:/plugin/greg.e4App2/css/default.css">
</property>
<property
name="appName"
value="greg.e4App2">
</property>
</product>
</extension>
You should also specify the CSS name in the .product file on the 'Customization' tab in the 'CSS Styling' section.
Also check that the 'css' folder is included in the 'build.properties'
I would like to customize the share UI header, for example remove some of buttons such as People and Shared files. I found that this can be done by modifying the share-header.lib.js file located in the tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/share/imports folder.
On modifying this file, I can see the changes. But as has been advised in these links:
https://forums.alfresco.com/forum/developer-discussions/alfresco-share-development/correctbest-way-customize-shares-ui-07182011
http://ecmarchitect.com/archives/2010/09/07/1212
The right way would be to create the same folder structure under the tomcat/webapps/share/WEB-INF/classes/alfresco/web-extension directory and put the modified file there. I created the folder hierarchy and copied the share-header.lib.js file in this folder with the changes but now the changes are not seen on the website. Am I missing something ? Can anyone advise on the right method to do this ?
Thanks !
The general guideline that tomcat/webapps/share/WEB-INF/classes/alfresco/web-extension overrides tomcat/webapps/share/WEB-INF/classes/alfresco is correct but there is one big caveat: it only works for webscripts.
In your case there are two files involved in the generation of the header:
WEB-INF/classes/alfresco/site-webscripts/org/alfresco/share/header/share-header.get.js
WEB-INF/classes/alfresco/site-webscripts/org/alfresco/share/imports/share-header.lib.js
The former belongs indeed to a webscript (you'll find a share-header.get.desc.xml in the same directory). This file can be overridden by placing a file in a similar directory structure under WEB-INF/classes/alfresco/web-extension as you've correctly found in your research.
The latter however is not part of a webscript. Rather it is imported through an import directive. Importing is a completely different mechanism and the WEB-INF/classes/alfresco/web-extension trick doesn't work here.
The first lines of share-header.get.js clarify this:
<import resource="classpath:/alfresco/site-webscripts/org/alfresco/share/imports/share-header.lib.js">
model.jsonModel = {
rootNodeId: "share-header",
...
The imported resource is loaded from the classpath literally, without any web-extension overlay. To import your customised version of share-header.lib.js, the first line should have been:
<import resource="classpath:/alfresco/web-extension/site-webscripts/org/alfresco/share/imports/share-header.lib.js">
So in summary my recommendation is to customise both header/share-header.get.js (just the first line) and imports/share-header.lib.js (as you've already done).
Remember that when you create a new customisation file it is safer to restart Alfresco. On the other hand when you edit an existing customisation file it is sufficient to visit /share/service/index on your local installation and click on Refresh Web Scripts and Clean Dependency Caches.
Actually, your approach isn't the best one.
As in Alfresco documentation you should configure your share-config-custom.xml in tomcat/shared/classes/web-extension folder. You should find a sample file there.
Look for the original one share-config.xml in share webapp folder: and search for the <header> tag. It will look something similar to this:
<app-items>
<!-- defaults: icon="{id}.png" label="header.{id}.label" description="header.{id}.description" -->
<item type="link" id="my-dashboard">{userdashboardpage}</item>
<item type="js" id="sites">Alfresco.module.Sites</item>
<item type="link" id="people">/people-finder</item>
<item type="link" id="repository" condition="conditionRepositoryRootNode">/repository</item>
<item type="container" id="more">
<container-group id="my">
<item type="link" id="my-tasks">/my-tasks</item>
<item type="link" id="my-workflows">/my-workflows</item>
<item type="link" id="my-content">/user/user-content</item>
<item type="link" id="my-sites">/user/user-sites</item>
<item type="link" id="my-profile">{userprofilepage}</item>
</container-group>
<container-group id="tools" permission="admin">
<item type="link" id="application">/console/admin-console/application</item>
<item type="link" id="groups">/console/admin-console/groups</item>
<item type="link" id="replication-jobs" condition="!conditionEditionTeam">/console/admin-console/replication-jobs</item>
<item type="link" id="repository">/console/admin-console/repository</item>
<item type="link" id="trashcan">/console/admin-console/trashcan</item>
<item type="link" id="users">/console/admin-console/users</item>
<item type="link" id="more">/console/admin-console/</item>
</container-group>
</item>
</app-items>
Copy the entire section in your share-config-custom.xml file. make your changes and restart Alfresco. You should be good to go.
Is it possible to add a description or help text to an aspect's property in Alfresco Share? I cannot change the title because it would require too much text.
When defining your type or aspect, you can set both a title and description. These will generally be shown in Forms, in Share and Explorer, and are normally the easiest way to explain to both users and developers about your model.
To see this in use, take a look at the audio:audio aspect in Alfresco, the latest version is available here. You'll see some of the aspect properties have both a title and a description. If you upload an MP3 into Alfresco 4, and edit the metadata for it in Share, you should see that information show up.
As a general guide though, your aspect should look something like:
<aspect name="test:thing">
<title>Testing Content</title>
<description>Aspect applied to mark content as being for testing use</description>
<properties>
<property name="test:edition">
<title>Test Edition</title>
<description>Which testing edition does this belong to?</description>
<type>d:int</type>
</property>
<property name="test:notes">
<title>Test Notes</title>
<description>Notes for using this content in testing</description>
<type>d:text</type>
</property>
</properties>
</aspect>
If you're going to be using your type or aspect in a multi-lingual system, then you should look at the Model Localisation Guide for information on how to specify names, titles and descriptions from properties bundles which can be localised
cdata is not working in title. it is working in description !
<item>
<title>Line and <![CDATA[<br />]]>breaked line</title>
<pubDate>09 Jun 2010</pubDate>
<description>Line and <![CDATA[<br />]]>breaked line</description>
<category>cat</category>
</item>
In what way is it not working? I imagine that most RSS clients won't render HTML in a <title> tag, anyway (especially not line breaks).