Is it possible to change the location of the default theme folder in VAADIN? - osgi

I'm currently using vaadin 6 with OSGi.
I'd like to create a new theme, but since I'm using OSGi I can't add one under the VAADIN/theme folder since I don't have access to it.
I want to tell vaadin to look for my theme using another URL in my HTTP namespace.
Can I achieve this? The setTheme() method accepts only strings and I couldn't find anywhere if it's possible to register another default folder for themes.
Thanks

You can do this by creating your theme in a fragment Bundle and then attach it to the Vaadin bundle. This will practically merge/append the resources to the host bundle.
So you provide:
VAADIN/themes/mytheme/
in your fragment bundle and create the manifest with the
Fragment-Host
set to
Vaadin 6: com.vaadin;bundle-version="${vaadin.version}"
Vaadin 7: com.vaadin.client-compiled;bundle-version="${vaadin.version}"

No, unfortunally this is not possible.
From here : https://vaadin.com/de/book/vaadin6/-/page/themes.creating.html
Custom themes are placed in VAADIN/themes folder of the web application (in the WebContent directory) as illustrated in Figure 8.1, “Contents of a Theme”. This location is fixed. You need to have a theme folder for each theme you use in your application, although applications rarely need more than a single theme. For example, if you want to define a theme with the name mytheme, you will place it in folder VAADIN/themes/mytheme.

You might also try pax for vaadin, it's not released yet and I'm laking some time to work on it more, but it should work for your use case. It tries to find vaadin applications and themes in your bundles.
https://ops4j1.jira.com/wiki/display/PAXVAADIN/Home

Related

Extjs projects binding at runtime

I have three different Extjs projects, all the three using MVC architecture. Out of these three one is going to be common to the other two projects. I would want the common project to be controlling and deciding which project to be loaded. But however I also want to separate the project codes and not have them binded together in a single project. is it possible ? if so how ?
Change:
In Simple Words how can i access few js files in extjs which is not inside the app folder.
We can use the Paths{} attribute inside Ext.loader to set a different path apart from the app path to access files outside app folder. The appFolder attribute of app.js is set to app by default. You can also change that to map a different app path. You can verify these in Sencha Docs.

Magento Extension/Theme Packaging

just a quick developer question in regards to Magento Extension/Theme Packaging, more specifically, when packaging, would I place the template files, layout files, skin folders etc in the base folder (see path below)(and not overriding any core files either)
app/design/frontend/base/default/template
app/design/frontend/base/default/layout
skin/frontend/base/default/css
and so on? I see this would be most suitable as alot of platform users would have custom themes with maybe custom namespaces for the theme folders. As users would have to stuff around to rename/move files/folders to work with their platform if packaged the default way I have seen in the past (ie in the default/default folder paths).
cheers for any feedback
This is the only way to package extension to use base/default or default/default location for template, layout and skin folders. Because if custom theme is used, then also this will work due to Magento's fallback mechanism. And if user want to add those files in custom theme location, then he/she should manually copy or move files in theme's respective location as you have said. And it is obvious that we can not predict custom theme path while packaging extension.

Events are disabled in codenameone

I have problem when I want to access events. I already copied the resource files (nativej2me.res) under src directory but still the events are disabled within my project.
Can anyone help me how to arrange the resources so it enables the vents..?
Thanks
Don't move that resource file. Its not the place for it.
I'm guessing you created a handcoded application where GUI builder events aren't supported. You need to create a GUI builder project when creating a new project.
That's a GUI builder project (notice the visual not manual in the brackets)
Just for the googlers out there:
Have a look in the file codenameone_settings.properties - in there you'll find the property userClassAbs=something/StateMachine.java
Its an absolute path and it was showing the wrong directory. After fixing this I was able to add Events in the Designer again.

Qooxdoo - how do i create a new theme and use it in the application?

I am quite new to qooxdoo and I need help in creating a custom theme for my application.
I copied the native Modern theme and modified some of its features, now my question is how do I add it as new theme to qooxdoo and how can I use it in my application?
any help or guidance would be greatly appreciated.
You don't need to copy it over, simply extending the theme would be good. If you created your app with the qooxdoo desktop skeleton using the create-application.py helper, you should already have a custom theme in place running and extending the modern theme. If not, you simply have to edit the config.json file which should be in your root project folder and search for a key named QXTHEME. The value of that key is a classname which specifies your theme. Change that to your custom theme class and rebuild the app to see the result.
Here are some further resources on how to work with themes: http://manual.qooxdoo.org/current/pages/desktop/ui_custom_themes.html
To add a bit to Martin's answer: You don't copy and modify theme code, you extend and override, much as with class code.
If you create an application skeleton with create-application.py, the default code structure under source/class already contains custom theme classes (under source/class//theme/*). The thing is those theme classes extend from the Modern theme without actually overriding anything, so you effectively get the Modern look and feel.
But you can then go ahead and flesh out those custom theme classes, with properties that suite your taste, thereby creating your own theme.
i found it very difficult to create a custom theme by extending one of the existing native themes (classic, modern... etc) without looking at the source code, also i don't want to mess up the original API's files by modifying them, so i did the following:
1- replaced files in my application's directory: myapplication/source/class/myapplication/theme/ with the files in /qooxdoo-directory/framework/source/class/qx/theme/modern/. replaced four files in total (Appearance.js, Decoration.js, Color.js and Font.js).
2- copied decoration directory from /qooxdoo-directory/framework/source/resource/qx/decoration/Modern to my application's directory: myapplication/source/recourse/myapplication/decoration.
3- copied icons directory from qooxdoo-directory/framework/source/resource/qx/icon/Tango to my application's directory myapplication/source/resource/myapplication/icon.
4- copied Tango.js from qooxdoo-directory/framework/source/class/qx/theme/icon/Tango.js to my application's directory myapplication/source/class/myapplication/theme/icon/Icon.js.
5- edited the meta file Themes.js and changed it to:
qx.Theme.define("myapplication.theme.Theme",
{
meta :
{
color : myapplication.theme.Color,
decoration : myapplication.theme.Decoration,
font : myapplication.theme.Font,
icon : myapplication.theme.icon.Icon,
appearance : myapplication.theme.Appearance
}
});
6- edited Icon.js file (which i copied from Tango.js in step 4) and changed it to:
qx.Theme.define("myapplication.theme.icon.Icon",
{
title : "myIcons",
aliases : {
"icon" : "myapplication/icon"
}
});
7- edited Decoration.js, Appearance.js, Color.js and Font.js in my application's theme directory and changed the classes' namespaces from:
qx.Theme.define("qx.theme.modern.<file's name>",
to
qx.Theme.define("myapplication.theme.<file's name>",
8- corrected assets paths in Decoration.js and Appearance.js from the original path qx/decoration/Modern or qx/icon/Tango to the one relevant to my appliaction myapplication/decoration and myapplication/icon, for example:
#asset(qx/decoration/Modern/toolbar/toolbar-part.gif)
changed to
#asset(myapplication/decoration/toolbar/toolbar-part.gif)
ps: the relative path in an application is application-name/source/resource, so you can refer to any directory in this folder by application-name/folder-name.
9- likewise in step 8 i changed aliases in decoration.js to:
aliases : {
decoration : "myapplication/decoration"
},
10 - ran generate.py file in myapplication/source.
and done, now i can change anything i want without crashing the API :)

Use ApplicationBar Icons from other assemblies?

I have a Page in a Windows Phone class library. This page has an appbar. I would prefer everything this page needs to be included within the class library so the setup list for consumers of this page / assembly is minimal.
However, When I set ApplicationBar icons, they get added to the class library project under the folder 'icons' just like normal, they show up fine in Blend, but at runtime they are no where to be found!
When I put the icons in the Windows Phone Application project all is well. However this is not my desired scenario as it is additional configuration / setup by the application author to use my pages.
I tried using the resource pathing using /{AssemblyName};component/icons/{IconName} but of course the AppBar needs them to be of type "Content" not "Resource". So I am thinking this is impossible but I wanted to know if anybody out there figured out how to do this.
Sorry guys. I just figured it out. I changed the newly added icons from "Resource" to "Content" but I forgot to set "Copy if newer" so they weren't getting outputted to the Bin\Debug\icons folder of the windows Phone Application. something to keep an eye on I guess.

Resources