How best to define default styles in widget libraries for public use?

I'm putting together some code to go with my blog, and it will include a custom component. I'd like the default component to use a style I define, but I'd also like the user to be able to easily override this. Does anyone have any suggestions on the best way to do this?
I notice that the [url http://www.jidesoft.com/blog/2011/10/04/meet-our-first-javafx-component/]range slider from JideSoft has us explicitly setting the skin in code in their example. Ideally the end-user would not be doing this. So what is the best practice? Should I build a custom skin for my component and then set the style in my code? Should I define a base style sheet that somehow always gets imported, etc?
In essence, I want to have my base styles work in the same way that caspian.css does - is there a way?

Thanks Jonathan, really helpful responses.
I think my control would be a candidate for a style-2 approach if the method was moved up to Parent as you suggested. If I understood it all right then I'm glad you have been pushing for this, and I'm glad David has been persuaded :)
I've got basic skinning for my component working, but I'm stuck on the getUserAgentStylesheet() method.
My widget is basically a NavigationToolbar with back, forward, home, refresh buttons - simple sort of thing.
I have done this:
public class NavigationToolbar extends Control implements NavigationListener
    private BooleanProperty backAllowed;
    private BooleanProperty forwardAllowed;
    public NavigationToolbar()
        getStyleClass().add("navigation-toolbar");
        this.backAllowed = new SimpleBooleanProperty();
        this.forwardAllowed = new SimpleBooleanProperty();
    ... getters/setters ...
    protected String getUserAgentStylesheet()
        return "styles/nav-toolbar.css";
}Then I have created Skin in the same package, which is basically my real view (what I previously had in the NavigationToolbar class before I made the unfortunate decision to make it nice an skinnable :) ):
public class NavigationToolbarSkin implements Skin
    private NavigationToolbar navigationToolbar;
    private HBox root;
    private Button backButton;
    private Button forwardButton;
    public NavigationToolbarSkin(NavigationToolbar navigationToolbar)
        this.navigationToolbar = navigationToolba
        root = new HBox(4);
        backButton = new Button("Back");
        backButton.getStyleClass().add("back");
        backButton.disableProperty().bind(navigationToolbar.backAllowedProperty().not());
        root.getChildren().add(backButton);
        forwardButton = new Button("Forward");
        forwardButton.getStyleClass().add("forward");
        forwardButton.disableProperty().bind(navigationToolbar.forwardAllowedProperty().not());
        root.getChildren().add(forwardButton);
}My nav-toolbar.css looks like:
.navigation-toolbar {
    -fx-skin: "com.zenjava.jfxflow.navigation.NavigationToolbarSkin"
.back {
    -fx-graphic: url("../images/nav-back.png");
.forward {
    -fx-graphic: url("../images/nav-forward.png");
... other styles ...When I try and use this in code (I just 'new' a NavigationToolbar instance and then add it to the scene, am I suppose to do something more?), I get the following error:
SEVERE: javafx.scene.control.Control impl_processCSS The -fx-skin property has not been defined in CSS for NavigationToolbar@31ad98ef[styleClass=root navigation-toolbar]If I manually set the skin on the toolbar (i.e. setStyle("-fx-skin: \"com.zenjava.jfxflow.navigation.NavigationToolbarSkin\"") ) it works, although obviously I don't have any of my other styles with it. I wondered if maybe it was just a URL issue so I've tried with the css in the root directory as well, and tried various paths (with a slash at front, without, etc). No luck - if you can tell me this is the problem then I can keep mucking around with it, but I'm thinking maybe I have missed a step or misunderstood and cocked up one of the steps above?
Cheers for your help, much appreciated!
zonski

Similar Messages

  • How to create a default Style for several Content Areas

    Hello,
    I have not been able to figure out how to create default styles/nav bars/etc... that can be used between SEVERAL Content Areas, and/or for any new Content Area. It seems to me that what is created in one Content Area, is not available for use in any other Content Area.
    Being that I'd like to keep the Administrative overhead as low as possible, I wonder if anyone has and/or knows how to create a default style, etc.. and use it with each Content Area across an Enterprise site???
    Many thanks for any information you may have!!
    null

    Kahli,
    check out the Shared Objects node in the Content Area navigator.
    Good luck, Tony

  • How to set up Airport Express in Bridge mode for hotel use

    Please provide step by step instructions on how to set up Airport Express in Bridge mode for hotel use. I do not have a computer with me, only an iPhone and AEX 802.11n.

    +"Please provide step by step instructions on how to set up Airport Express in Bridge mode for hotel use. I do not have a computer with me, only an iPhone and AEX 802.11n."+
    AirPort Utility is the application that must be used to setup and make any configuration changes to the AirPort Express. I'm not aware of an "App" for this.
    If you could borrow a computer from someone there for 30 minutes or maybe use the computer in the lobby, you could download AirPort Utility and reconfigure your Express. To help with setup, use an ethernet cable from the computer to the Express to help AirPort Utility "see" the Express.
    http://support.apple.com/downloads/#airport

  • How do I change default style in TextEdit?

    How do I change the default style in TextEdit -- that is, the style that a new document will automatically have? (In particular I want new docs to have certain ruler and spacing parameters.)
    I know how to add favorite styles and remove them -- but want to change the default style so that I don't have to select my favorite every time I create a new rtf document in TextEdit or other programs.
    I suspect this is simple -- but I can't figure it out or find it anywhere. EXTREMELY obliged for any solution.
    Thanks,
    Dave

    That will change the default for all new documents. That's the most formatting control avaiable in Text Edit. For more control over your docs try Apple Pages, neoOffice or MSWord.
    -mj

  • How to Control default Styles(Font,BGColor,Size) for WPC Objects.

    Hi All,
    This is Ganesh, Current i am working on Content Migration Using WPC.Now My Question, while we are creating the Site Content using WPC(Like Articles, Paragraph's, etc...), while we are typing the content for Article, its showing in one font, after creation of article,while we are previewing of the Article , its showing in Blue Color Letter's and Shade Blue back ground and also Coming font big in size.
    If i am creating the paragraph, while we are previewing the its Displaying in Black Color.
    From where the details of font, size and back ground colors are coming in WPC objects.and if they have to modified, how can it be done?
    Where We can Control the Default Styles for WPC Content Creation Objects.If Possible how to modify?
    Please provide some valuble inputs for my Query???
    Thanks in Advance
    Krishna Ganesh

    Ganesh,
    You are absolutely right. If you modify the xml, xsl and css files supplied by the standard SAP it will affect all the users. Please note that whenever you need to modify the css, you need to do the same in /etc/wpceditor/css/runtime folder. Modification of the css in /etc/wpceditor/css/designtime folder is not of any use.
    If you do not want the changes made to the style to affect all other users, it is always wiser and recommended to create your own custom webform. Some webforms like Article, Link List, banner, teaser etc are provided by SAP. If you want to create your own webform and apply the style to that webform alone then you need to follow the process of creating custom webforms in WPC.
    In order to change the style you need to understand a bit of XML and XSL transformation.
    You can refer to the following sdn help for the same - http://help.sap.com/saphelp_nw70/helpdata/en/45/599b78b0aa3bdde10000000a1553f7/frameset.htm
    Hope it helps. Let me know if you need any further clarification.

  • HOW CAN I CHANGE FONT STYLE IN INDEX PAGE FOR IBA?

    Hi
    Is it possible to change the font style in INDEX page for iBA?
    Naidu

    NO. In the index page. I figured out that we can change the space and text formate.
    I am preparing a bokk with 1 chapter and 13 section.
    SO, in the index page it is showing like 1.1, 1.2.......1.10, 1.11 so on; on the left hand side and page numbers on the right hand side.
    Can i take out the numbers on the left and have only the section name and page number?
    If so how?

  • SAP Cloud SDK : Default Check in Marketing Lead for Field "Use Existing Account"

    Hi Experts,
    I have requirement to enhance the standard business object Marketing Lead screen. In that screen i need to make default check on "Use Existing Account" checkbox when user click on New Marketing Lead or QC option.
    I have tried using Application studio but the field "Use Existing Account" not exist in cloud repository its on Front-end UI screen.
    How i can make default value check to this checkbox in UI designer for standard screen
    Or
    How i can make default value check to this checkbox using ABSL code.
    Please refer the screen as shown below.
    Regards,
    Mithun

    Mithun,
    Could you please check Fine tune options available for Leads ?
    Under Involved Parties there is an option "Forbid Manual Changes". For Account Party Role if you select that it will not allow user to enter new account information.
    Fine -Tune -> Leads - > Involved Parties -> Account
    - Shrikant

  • Best Distro for Publicly Used Computers?

    Howdy y'all.
    I was wondering if anybody had some advice as to what distro would be best for a low-power, publicly used computer. My dorm is getting two computers for our common room ("Destitute" model here: http://media.photobucket.com/image/rece … /Guide.png ). I am however, not sure what to put on it.
    Here are the requirements that I am looking at:
    1. Must run on low-performance computer
    2. Must be able to play Flash videos and run Shockwave applications
    3. Must be able to run LibreOffice.
    I was thinking about Linux Mint, because I need something that people can maintain after I leave (so Arch is not really an option, sadly), but I was also wondering if it would be possible to run a completely free distro that met these requirements.
    Right now, my top choices would be Linux Mint, gNuSense (not sure if it meets the requirements though), and Xubuntu. Does anybody have suggestions?
    Additionally, does anybody know where I could procure a 40 GB hard drive? I have been searching on NewEgg, but they only have refurbished models. This computer really only needs to have enough space to run the OS, since people will be saving stuff to their own flash drives.
    Input/Advice/Ideas would be appreciated, thank you.

    janvaletin wrote:I can see how I would be able to set up a regular file deletion with cron. How would I be able remove installed applications while protecting ones I installed?
    There's a few ways you could do this, you could save the list of packages you installed and periodically spit out a new list, then diff that with the old list, remove packages that aren't on both.  Unless you give out the root password, or put people in sudoers, people aren't going to install software.  Your issue will be more that people will mess with the configuration settings to stuff, which will result in a periodically less and less usable desktop, or just some embarrassing bookmarks.  If you use a dedicated guest account for people logging in, you could just periodically delete and recreate the account to revert it back to a "clean" state.  Somebody claimed there's a "kiosk mode" for Xubuntu, I'd look into that, it sounds like something useful for you.
    janvaletin wrote:As far as the hard drive goes, I only need enough to run the OS, and since I will be building the computers, I figured I should aim for the cheapest solution possible.
    The cheapest, new, spinning-platter drive you are going to find is going to be 80GB, I assumed that machine came with a 500GB drive because that's what the linked spec-sheet indicated.  If it doesn't, and you want to consider other options you could do something like:
    1) Don't put a harddrive in the things at all, build yourself a livecd image and run the machine off that (annoying to update, but no-worries about reverting to a clean state, just reboot the machine)  Also, no need to worry about harddrive failure.
    2) Get a usb flash drive and run the machine off that, you could probably get a working system on 4GB, 8GB for sure.  You won't save much money doing this though, maybe $10/$20 and, unless you've got a motherboard with an external usb-port soldered right on the board, you'll have to worry about someone yanking the drive out and rendering your system in-operable.

  • How to get values from a table(in jsp) for validation using javascript.

    hi,
    this is praveen,pls tell me the procedure to get values from a table(in jsp) for validation using javascript.
    thank you in advance.

    Yes i did try the same ..
    BEGIN
    select PROD_tYPE into :P185_OFF_CITY from
    magcrm_setup where atype = 'CITY' ;
    :p185_OFF_CITY := 'XXX';
    insert into mtest values ('inside foolter');
    END;
    When i checked the mtest table it shos me the row inserted...
    inside foolter .. Now this means everything did get execute properly
    But still the vallue of off_city is null or emtpy...
    i check the filed and still its empty..
    while mtest had those records..seems like some process is cleaining the values...but cant see such process...
    a bit confused..here..I tried on Load after footer...
    tried chaning the squence number of process ..but still it doesnt help
    some how the session variables gets changed...and it is changed to empty
    Edited by: pauljohny on Jan 3, 2012 2:01 AM
    Edited by: pauljohny on Jan 3, 2012 2:03 AM

  • How to load a default value in to a column when using sql loader

    Im trying to load from a flat file using sql loader.
    for 1 column i need to update using a default value
    how to go about this?

    Hi!
    try this code --
    LOAD DATA
       INFILE 'sample.dat'
       REPLACE
       INTO TABLE emp
       empno   POSITION(01:04) INTEGER EXTERNAL NULLIF empno=BLANKS,
       ename   POSITION(06:15)  CHAR,
       job         POSITION(17:25)  CHAR,
       mgr       POSITION(27:30)  INTEGER EXTERNAL NULLIF mgr=BLANKS,
       sal        POSITION(32:39)  DECIMAL EXTERNAL NULLIF sal=BLANKS,
       comm   POSITION(41:48)  DECIMAL EXTERNAL DEFAULTIF comm = 100,
       deptno  POSITION(50:51)  INTEGER EXTERNAL NULLIF deptno=BLANKS,
       hiredate POSITION(52:62) CONSTANT SYSDATE
      )-hope this will solve ur purpose.
    Regards.
    Satyaki De.

  • How do I get default/automatic reminders or alarms for every new event?

    I want to set a preference so that all the new calendar events have an alarm or reminder that I have to clear after I get the reminder. At least a daily reminder list or even repeating alarms starting 2 hours before the event.
    Is there a way to do this in the IpHONE calendar preferences or settings; do I have to change it in iCal then sync and that preference will transfer? I've been through every setting menu on the iPhone&Calendar as well as peeking into the settings in iCal.,
    Does anyone know how to do this?
    -Cryptic

    I would like to second this as a common frustration. Migrating from other phones with calendar features I was surprised to miss my first appointment. I would expect to look under settings > mail, contacts,calendars, calendar and see a setting for default appointment reminder so that every time I create an appointment in a hurry I don't have to remember to set a reminder safe in the knowledge it set it to 15 mins on my behalf.

  • How to set line style to be underline for links using PDLinkAnnotSetBorder

    Hello,
    I want to set link line style to be underline. am not finding any difference for solid and underline except cosname of S  (BS) is U or S
    Please anyone tells me how to change the link line style to be underline.
    Thanks,
    Sow

    Thanks for reply.
    I am using code as show below to change line style to solid and dashed.
    PDLinkAnnotBorder pdLinkBorder;
    PDLinkAnnotGetBorder( rpdAnnot, &pdLinkBorder);
    //For solid
      pdLinkBorder.dashArrayLen = 0;
    PDLinkAnnotSetBorder( rpdAnnot, &pdLinkBorder);
    //For dashed
    pdLinkBorder.dashArrayLen = 1;
    for( int iIndex = 0; iIndex < PDAnnotMaxDashes; iIndex++)
    {     ASInt32 iThickness = 3;
        pdLinkBorder.dashArray[iIndex] = Int32ToFixed( iThickness );
    PDLinkAnnotSetBorder( rpdAnnot, &pdLinkBorder);
    how should I do for underline. If am using cosobject how to change line style to underline using cosobject
    Please let me know.
    Thanks,
    Sow

  • How to set a default value in a form, for a current record.

    Hello,
    I have created a form to store the details of an employee, details include employee id, name and lan id. I am wondering if it's possible to set the default value for an e-mail address. The e-mail address would be in the format '[email protected]'. So If I press 'create', I am directed to a form.
    In the forename field, if i type 'stewart'
    In the surname field, if I type 'Young'
    Then in the e-mail field, I should see '[email protected]'
    Furthermore, if I change 'stewart' to 'stuart', while still in the form, the e-mail address field is automatically updated to '[email protected]'
    Would anyone be able to help with this problem?

    Hi,
    to do this you need kind of interactivity in your form.
    You can achieve this either by:
    1) using JavaScript onchange-events on forename and surname items, or
    2) use the AJAX Computations option of ApexLib, see: http://www.oracle-and-apex.com/ajax-computations-rich-client-feeling/
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com

  • How Do I Change Default Chapter Numbers When Compressing for iPad?

    Basically, I'd like to export a program from a FCP 7 timeline with included chapter and compression markers and compress it using Compressor 3.5 or 4.  The program is intended for distribution via iPad and I'd like to include medical disclaimers and a production company logo prior to the start of the program.  The problem is that the chapter numbering seems to default to 1, 2, 3, etc. which makes the program's beginning read as Chapter 2.  Is there any way to reset the default first chapter marker to Chapter 0 or similar?  Or is there a way to do away with the automatic chapter numbering?

    I understand that the markers can be named in the timeline.  The problem I'm having is that, once the file is encoded and moved onto the iPad, the chapter names gain an additional number.  So in my case there is a marker at the beginning of the sequence that I've named Medical Disclaimers and another at the beginning of the program that I've named Program Start and a third marker that I've named Chapter 1.
    When the chapters display on the iPad it reads something like this:
    Chapter 1
    Medical Disclaimers
    Chapter 2
    Program Start
    Chapter 3
    Chapter 1
    You see my problem?  Chapter 3 / Chapter 1 doesn't really work. I can name the chapters anything I want in FCP, but as soon as they're loaded on the iPad they get a shiny new chapter number attached to them no matter what I do with the markers in FCP.  I can of course rename Chapter 1 so that it's not so obvious, but I'd still like the program to start at Chapter 1 rather than Chapter 2 (or, if possible, have no automatic chapter number generation at all).

  • How to set the default the highlight/shawdow colors for BevelBorder?

    Is there a way of setting/changing the default highlightOuter/Inner and shawdowOuter/Inner colors of a BevelBorder?
    I assume that these values are defaulted from the LookAndFeel settings and that there most be a way of changing these like one does for other defaulted values. For example:
    UIManager.getDefaults().put("TabbedPane.shadow",new Color(190,220,255));
    to set the TabbedPane shadow color.

    This is the JDK1.4.1 source code. So it doesn't look like there is any way to change the default since it is based on the components background color:
        public Color getHighlightOuterColor(Component c)   {
            Color highlight = getHighlightOuterColor();
            return highlight != null? highlight :
                                           c.getBackground().brighter().brighter();
        public Color getHighlightInnerColor(Component c)   {
            Color highlight = getHighlightInnerColor();
            return highlight != null? highlight :
                                           c.getBackground().brighter();
        public Color getShadowInnerColor(Component c)      {
            Color shadow = getShadowInnerColor();
            return shadow != null? shadow :
                                        c.getBackground().darker();
        public Color getShadowOuterColor(Component c)      {
            Color shadow = getShadowOuterColor();
            return shadow != null? shadow :
                                        c.getBackground().darker().darker();
        }Of course you can specifiy the color in the BevelBorder constructor.

Maybe you are looking for

  • HOW DO I REMOVE AN APPLICATION IN WLS6?

    Hi everybody, I compiled an ejb into a jar file and ADDED it to the list of already added applications through the WLS6 console (I have WLS6 installed on my Windows 2000 machine). In the WLS6 console I clicked Deployments->EJB->Install a new EJB->Upl

  • Multitenancy and Entity Manager

    We are using JPA with eclipse link. We have extensive JPA queries. Our code is in production for a while. Now we have  a business use case, to support multitenancy. We will be using the Oracle Pluggable Database mechanism where each client will have

  • Deleted objects and nstombstone objectclass

    Hi, When i delete objects in DS5.0 with ldapdelete, DS5.0 create an objectclass nstombstone for all the deleted objects. I can see them with ldapsearch ... (objectclass=nstombstone). Then, the size of the file id2entry.db3 increase. I use a multi mas

  • Multiline element through Mail

    Hi Friends, I am trying to send a multiline attribute value through send mail in workflow. The attribute has a line type TLINE (Char 79). I have it as an event parameter. Whenever i raise an event i pass a table with 3 lines through the INPUT_CONTAIN

  • Lightroom trial download problem ?

    Any thoughts please ? I tried downloading a trial of Lightroom. After 8 hours it started the download and then an error message saying can't be done and system disconnected, I am now getting emails giving suggestions on how to get the best out of the