Use different "fx-border-image-source" for first tab and remaining tabs

Hi,
I'm using something like this
.tab {
-fx-padding: 0px 5px -2px 5px;
-fx-background-insets: 0 -20 0 0;
-fx-background-color: transparent;
-fx-text-fill: #c4d8de;
-fx-border-image-source: url("images/tab5.png");
-fx-border-image-slice: 20 20 20 20 fill;
-fx-border-image-width: 20 20 20 20;
-fx-border-image-repeat: stretch;
-fx-font-size: 22px;
.tab:selected {
-fx-border-image-source: url("images/tab-selected5.png");
-fx-text-fill: #333333;
     -fx-background-color: red;*/
to customize the tab appearance of a TabPane.
That worked well. But I need to use a different set of images for just the first tab. Does anyone know a way to accomplish that?
Thanks.

How can I "fix up" the first tab of tab panes that are created after I "fixed up" the first tab of the initial tab pane?
My app allows user to create new tab panes at any moment during program execution.Not easy to answer this one.
The best answer would be to use structural pseudoclasses, but (as David points out), they are not yet implemented.
The trick here is how to identify the first tab of each tab pane so that it can be styled separately from the other panes.
Doing the styling without a dynamic lookup is preferrable to using a dynamic lookup (i.e. when the first tab is created give it a specific style, e.g. tab0).
This is how the charts work, where they set style classes based on series of data, e.g. series0, series1 - this allows you to independently style each series of data.
However the chart stuff has all of that built into the implementation, whereas the tabs don't. To achieve that you would likely need to go into the TabSkin code (http://openjdk.java.net/projects/openjfx/) find out where and how it generates the Tab nodes and write a custom tab skin or extension of the existing one which assigns a numeric style class to each new tab in a pane (e.g tab0, tab1, etc). In other words, not particularly easy if you are unfamilar with the tab skin implementation. You could log a javafx jira feature request to have those style classes set on tabs - file it here => http://javafx-jira.kenai.com.
In the meantime a simple alternative is to use the dynamic lookup method in my previous post and a hack such that whenever you add a new tab pane to the scene you do something like the following:
new Timeline(
  new KeyFrame(
    Duration.millis(50),
    new EventHandler<ActionEvent>() {
      @Override public void handle(ActionEvent arg0) {
        Node tab = newTabPane.lookup(".tab");
        if (tab != null) tab.getStyleClass().add("first-tab");
).play();The reason for the Timeline is that I don't really know at what stage the css layout pass is executed. I know that when you initially show the stage and then do a lookup, the css pass seems to have already been done and the lookup will work. But for something that is dynamically added or modified after the scene is displayed - I have no idea when the css layout pass occurs, other than it's some time in the future and not at the time that you add the tabPane to the scene. So, the Timeline introduces a short delay to (hopefully) give the css layout pass time to execute and allow the lookup to work (not return null). Not the best or most efficient solution, but should work for you.

Similar Messages

  • Can you use SQL as a data source for a project in the same way you can in Excel?

    Excel allows you to create a data source that executes a SQL stored procedure, display that data as a table in a spreadsheet and have that data automatically refresh each time you open the spreadsheet. Is it possible to do the same thing in MS Project, displaying
    the data from the stored procedure as a series of tasks?
    Here's what I'm trying to do - I have a stored procedure that pulls task data meeting a specific criteria from all projects in Project Server. We're currently displaying this data as an Excel report. However, the data includes start dates and durations so
    it would be nice to be able to display it as a Gantt Chart. I've played around with creating a Gantt chart in Excel and have been able to do a very basic one, but it doesn’t quite fit our needs.

    No, You can not use sql as a data source for a project.
    You have 3 options to achieve it:
    1. You can create a Sharepoint list with desired column ,fill desired data in that list then you can create a MS project from Sharepoint List.
    2. You can create a SSRS report in which you can display grantt chart Joe has given you that link.
    3. You can write a macro in MPP which will take data from your excel. In excel you will fetch data from your stored procedure. write a schedule which will run every day to update your data or
    create an excel report in which will update automatically and write macro in mpp which will fetch the data then publish it so that it would be available to team members.
    kirtesh

  • I rented a movie. I want to see it using different user on same mac for security reason. How can I do this? Home Sharing fails to do this, so far.

    I rented a movie. I want to see it using different user on same mac for security reason. How can I do this? Home Sharing fails to do this, so far.

    Copy the movie from the current library to the correct library.
    iDevices can only sync to one library at a time.

  • Using iPod shuffle 4th generation for first time and receiving the error : one of the USB devices attached to this computer has malfunctioned, and windows does not recognize it. For assistance in solving this problem, click this message

    Using iPod shuffle 4th generation for first time and receiving the error : one of the USB devices attached to this computer has malfunctioned, and windows does not recognize it. For assistance in solving this problem, click this message.
    Using win 7 and latest iTunes [10.6.3]. Have already gone through below links and did not find any solution.
    http://support.apple.com/kb/HT2292
    http://support.apple.com/kb/TS1369
    http://support.apple.com/kb/HT1923
    http://en.kioskea.net/forum/affich-17997-ipod-not-detected

    I was hoping it would be something like a USB device conflict, but now the shuffle is the only thing connected...
    This article was one of the ones you linked to above in your initial post
    http://support.apple.com/kb/TS1369
    Under Part 9. Verify that USB drivers are installed, did you try the steps in If only "Unknown Device" appears?  That appears to be your situation.
    Also, you said that the shuffle initially worked well enough to do a sync, then it had the same problem again.  If you can get it to work again initially, before doing anything else, try the following.  Select the shuffle in the iTunes sidebar, under DEVICES.  Over to the right, go to the Summary tab.  By default, the checkbox for Enable disk use should be unchecked.  If so, check it and Apply the change.  See if that makes any difference. 
    (If Enable disk use was already checked, try unchecking it and Apply the change.  Basically, set it the "other way" and see if there is any improvement.)
    NOTE:  When disk use is enabled, you have to eject the iPod in iTunes before disconnecting it physically.
    If the disk use change makes a difference, that may provide a clue about the actual cause.

  • HT201359 My wife and I want to use different credit cards to pay for our personal purchases while still being part of the Family. How is that possible?

    My wife and I want to use different credit cards to pay for personal purchased will being part of a family share.. How is that possible?

    Ricki46,
    Thank you for allowing me to clarify. As it says in that article:
    "When you initiate a new purchase, it will be billed directly to the family organizer's account, unless you have gift or store credit."
    These are the only current billing options in Family Sharing. Using a second credit card is not currently an option. 
    If you need further clarification, you can use one of the other support options here: https://getsupport.apple.com/GetproductgroupList.action
    Regards,
    Jeff D. 

  • I have a hard drive for CD storage that needs to connect to the Ethernet router. sInce my router is not in this room, and in another room, I want to use my Mac as a router for the drive, and share the wifi. Ho do I do this

    I have a hard drive for CD storage that needs to connect to the Ethernet router. sInce my router is not in this room, and in another room, I want to use my Mac as a router for the drive, and share the wifi. Ho do I do this? I gace tried the System Preferences -> Sharing, shared internet to Ethernet, but can't se ethe device on Finder

    Djembe wrote:
    UEFI (unified extensible firmware interface) boot requires Global unique identifier Partition Table (GPT) as opposed to the older Master Boot Record (MBR). If your existing drive is formatted in MBR, you will need to adjust BIOS settings to enable legacy boot in order for it to work properly.
    Is there a performance difference between GPT and MBR? If GPT is better, I do not mind formatting the drive with it.
    5. No special drivers are needed.
    Thanks. What about the thunderbolt port?
    7. I think Lenovo estimates 6 hours.
    Lenovo says 6 hours with the 6-cell battery on its website.
    BrendaEM wrote:
    Hi,
    There was a serious BIOS/UEFI problem with that SSD . Perhaps this thread will save you some headaches. Someone is recomending shutting off Rapid Boot in the setup, which would probable mean little with a SSD, anyway.
    I read through this, and it looks like the problem was fixed in a BIOS update, which I plan to do. However, it also seems like Intel Rapid Start is not even worth it in the first place, as sleep consumes almost no power at all.
    W540: i7-4700mq, K2100m, 8 GB DDR3L, 512 GB SSD
    T510: i7-620m, NVS 3100m, 8 GB DDR3, 512 GB SSD

  • Mac 10.9.5 trying to launch Illustrator CS6 for first time and prompts Java even though I have Java 8 installed.

    Mac 10.9.5 trying to launch Illustrator CS6 for first time and won't launch, prompts for Java 6 even though I have Java 8 installed!
    Apple says Java 6 is very insecure and not to use it.  I have the latest Java installed.  Why won't Illustrator launch?  What else can I do?

    tm,
    I believe you should be able to get round the issue by following this:
    http://oliverdowling.com.au/2014/03/28/java-se-8-on-mac-os-x/
    It is even more thoroughly described in this thread, see post #3 on by gator soup:
    https://forums.adobe.com/thread/1706469

  • ADF application taking more time for first time and less from second time

    Hi Experts,
    We are using ADF 11.1.1.2.
    Our application contains 5 jsp pages, 10 - 12 taskflows, and 50 jsff pages.
    For the first time in the day if we use the application it is taking more than 60 sec on some actions.
    And from the next time onwords it is taking 5 to 6 sec.
    Same thing is happening daily.
    Can any one tell me why this application is taking more time for first time and less time from second time.
    Regards
    Gayaz

    Hi,
    If you don't restart you WLS every day, then you should read about Tuning Application Module Pools and Connection Pools
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcampool.htm#sm0301
    And pay attention to the parameter: Maximum Available Size, Minimum Available Size
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcampool.htm#sm0314
    And adjust them to suit your needs.

  • HT5622 Hello - my wife and I use the same appleID (legacy of our first ipod) and now that we've gone to the cloud with multiple devices, is there a smart, easy way to either segregate the data in the iCloud to each of our respective devices or ??  Thx

    Hello - my wife and I use the same appleID (legacy of our first ipod) and now that we've gone to the cloud with multiple devices, is there a smart, easy way to either segregate the data in the iCloud to each of our respective devices or ??  Thx in advance ...

    Hello eagjdw
    You can keep the one Apple ID for purchases and then create another one for a personal account for contacts and calendars. The article below will assist further
    Using your Apple ID for Apple services
    http://support.apple.com/kb/ht4895
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • How can I use two single-dimensional arrays-one for the titles and array

    I want to Use two single-dimensional arrays-one for the titles and one for the ID
    Could everyone help me how can i write the code for it?
    Flower
    public class Video
    public static void main(String[] args) throws Exception
    int[][] ID =
    { {145,147,148},
    {146,149, 150} };
    String[][] Titles=
    { {"Barney","True Grit","The night before Christmas"},
    {"Lalla", "Jacke Chan", "Metal"} };
    int x, y;
    int r, c;
    System.out.println("List before Sort");
    for(c =0; c< 3; ++c)
    for(r=0; r< 3; ++ r)
    System.out.println("ID:" + ID[c][r]+ "\tTitle: " + Titles[c][r]);
    System.out.println("\nAfter Sort:");
    for(c =0; c< 3; ++c)
    for(r=0; r< 3; ++ r)
    System.out.println("ID:" + ID[c][r]+ "\tTitle: " + Titles[c][r]);

    This is one of the most bizarre questions I have seen here:
    public class Video
    public static void main(String[] args) throws Exception
    int[] ID = {145,147,148, 146,149, 150};
    String[] Titles= {"Barney","True Grit","The night before Christmas", "Lalla", "Jacke Chan", "Metal"};
    System.out.println("List before Sort");
    for(int i = 0; i < Titles.length; i++)
       System.out.println("ID:" + ID[i]+ "\tTitle: " + Titles);
    System.out.println("\nAfter Sort:");
    for(int i = 0; c < Titles.length; i++)
    System.out.println("ID:" + ID[i]+ "\tTitle: " + Titles[i]);
    Generally you don't use prefix (++c) operators in you for loop. Use postfix (c++).
    Prefix means that it will increment the variable before the loop body is executed. Postfix will cause it to increment after.

  • In Address Book, I would like to have a field "File As". So, l can list "Joe Smith", as "The Smith Family". I will use this when I print labels for Xmas cards and such. Thanks!

    In Address Book, I would like to have a field "File As". So, l can list "Joe Smith", as "The Smith Family". I will use this when I print labels for Xmas cards and such. Thanks!

    In Address Book, I would like to have a field "File As". So, l can list "Joe Smith", as "The Smith Family". I will use this when I print labels for Xmas cards and such. Thanks!

  • I have been using Itunes on my HP laptop for 12 months and over the past month have not been able to access the Itunes store or any of the Itunes Help type menu's. When in Itunes I click on the Store icon and the top middle box gets to Half way. Pls help

    I  have been using Itunes on my HP laptop for 12 months and over the past month have not been able to access the Itunes store or any of the Itunes Help type menu's. When in Itunes I click on the Store icon and the top middle box gets to Half way. Pls help

    I had the same tried loads of fixes
    saw this on the community from whatheck
    In windows 7 click on your start menu, go to the accessories, right click on the command icon and choose "run as administrator"
    Once it opens type the following command...
    netsh winsock reset
    Hit enter and it should say something like winsock reset successful now reboot your computer
    IT WORKED....... cleared all the "action2 on the CPU and loads IStore perfectly

  • Please recommend me some books or source for objective c and iphone ipad development.

    Please recommend me some books or source for objective c and iphone ipad develpoment
    i am new in programing so know few things about xcode and programing development.
    so please recommend new books or other source that can help beginner like me.

    Mujtaba Tarar wrote:
    do u think xcode unleashed is for beginner?
    Not really. It is just one of the few decent books I've seen. If you are a true beginner, I suggest a computer science program at your local college or university.

  • Using CSV to create Image.source

    So, here's what I have.
    I've got a datagrid that has a group of comma seperated
    values. I've been tinkering with it all night trying to get out the
    values to use them as sources for images.
    The values look like this "undefined, assets/1.png,
    assets/2.png, assets/3.png"
    I want to display them in a container separate from the
    dataGrid. So far I know I think I have to get the data to parse,
    and then use an item renderer to display it?
    Any help is much appreciated, code snippets are a big plus.
    -Thanks

    So, here's what I have.
    I've got a datagrid that has a group of comma seperated
    values. I've been tinkering with it all night trying to get out the
    values to use them as sources for images.
    The values look like this "undefined, assets/1.png,
    assets/2.png, assets/3.png"
    I want to display them in a container separate from the
    dataGrid. So far I know I think I have to get the data to parse,
    and then use an item renderer to display it?
    Any help is much appreciated, code snippets are a big plus.
    -Thanks

  • Using an EJB as a source for a Model

    Hi,
    Before starting with this post content it might be helpful to give you the desired output of what I am trying to do. Basically I need to have an HTML table that is populated from an EJB.
    The current proposed solution is as follows: the Model that is associated with a TiledView will be used as client for the EJB. The Model will make use of the methods in the EJB to get different java.util.Collection objects for different Helper classes based on the find criteria.
    For example, if the EJB represent a book and there is a home method to retrieve a list of books based of the book category. In this case the Model will act as a client of the EJB, retrieve the list of books and use the different methods in the Model, such as insert and retrieve, to get the list of books and to add a book up on request.
    I know that my post might not be clear. But as I said, all that is needed is to have a TiledView that displays books information, which are retrieved from an EJB, and allow a user to select a book to display its information.
    My suggested solution could be completely wrong, not visible and reflect a bad design. Please if any one went through such a situation give me a hint.
    Regards,
    Basil Mahdi

    Basil,
    This is some material I snipped from an internal Sun forum I posted to regarding a simple EJB Jato integration example.
    I hate to give just any EJB JATO example because frankly there are so many different use cases with EJBs that no one example will match up against your needs. You can use an EJB
    - in a Custom Model Operation you can encapsulate an EJB Method invocation
    - in a Custom Command you can encapsulate any arbitrary code include calling an EJB
    - as the backingstore for a CustomModel
    - use a BeanAdapterModel to adapt to the value/transfer beans which are uses as parameters or return values of EJB methods
    - use an ObjectAdapterModel to adapt an EJB directly by assigning the EJB reference in setObject() in the constructor of the OAM
    As you can see, an EJB is just another business object API...its just that you acquire the reference with a few lines of ugly JDNI and Home interface APIs.
    Nevertheless, here is some guidance. I would like to reinforce that there is no direct solution for adapting an EJB from BAM; EJBs are not JavaBeans. What is a solution is to have the parameters or return values of your EJBs use value/transfer object patterns in the form of JavaBeans. The BAM may be used to adapt to these parameters or return value of the EJB.
    In short, when using BAM in a tileview to work with an EJB, there is little difference than using BAM at any other time, you the developer, must manage/code the placement of the EJB parameters directly into the BAM or in a scoped attribute to be used by the BAM.
    In another example, you may have a SLSB which models an employee called EmployeeSupport. You may have a transfer object (JavaBean) of type EmployeeRecord. You may have operations on the EJB including:
    public EmployeeRecord findEmployee(String employeeID);
    public EmployeeRecord[] findEmployees(String location);
    public void updateEmployee(EmployeeRecord);
    One could create a BAM in the studio called EmployeeModel
    You would set the JavaBean class to EmployeeRecord
    You would run the Design Action to bootstrap the properties of EmployeeRecord as fields on the model
    Now you have a model which is ready to adapt to EmployeeRecord bean.
    Feel free to add material to the EmployeeModel to make a richer API; for instance you could encapsulate some EJB'ish code in their to act as a service locator for a EmployeeSupprt SLSB.
    protected static EmployeeSupport support;
    static {
    javax.naming.Context context = new javax.naming.InitialContext();
    Object objref = context.lookup("ejb/EmployeeSupport");
    EmployeeSupportHome home = (EmployeeSupportHome)
    javax.rmi.PortableRemoteObject.narrow(objref,EmployeeSupportHome .class);
    support = home.create();
    public static EmployeeSupport getEmployeeSupport() {
    return support;
    If you really wanted to hide the EJB'ishness of the EmployeeSupport you could even wrap the behavior and handle exceptions, etc.
    public static EmployeeRecord findEmployee(String employeeID) {
    return getEmployeeSupport().findEmployee(employeeID);
    public static EmployeeRecord[] findEmployees(String location) {
    return getEmployeeSupport().findEmployees(location);
    public static void updateEmployee(EmployeeRecord record) {
    return getEmployeeSupport().updateEmployee(record);
    You could even help the view developer latch EJB transfer objects into the model for adaption; saving them from the effort
    public void adaptEmployee(String employeeID) {
    setBean(findEmployee(employeeID));
    public void adaptLocation(String location) {
    setBean(findEmployees(location));
    public void save() {
    updateEmployee((EmployeeRecord)getBean());
    Create a search ViewBean, place a text field on it for an EmployeeID and button labeled Find. Leave the EmployeeID model binding default (to use a DefaultModel memory model). Open the handle request event method on the viewbean for the Find button.
    public void handleFindRequest....{
    EmployeeModel model = .....;
    model.adaptEmployee(getEmployeeIDChild().getValue());
    // display Edit page which has fields for editing the employee record
    Create an edit ViewBean, with editable fields bound to the EmployeeModel; add an button labeled update
    public void handleUdpateRequest....{
    EmployeeModel model = .....;
    model.save();
    // do whatever is next ....
    Notice that the we are jumping across request boundaries in this example. Using just default model reference configurations, the EmployeeModel will be created brand new during the Update request and there will be no bean currently adapted. Most likely, you would want to have the model (and hence its adapted bean) stored in HttpSession across at least these related requests. In this case the model reference used by the search ViewBean would have "store in session" true. and the model reference in the edit ViewBean would have "look in session" true.
    What we recommend is that someone who understands the business tier design take the responsibility to create a set of "business delegates" as JATO models. An advanced technique would be to encapsulate these models in a component library JAR which multiple web applications can reuse. As you can imagine, there are so many ways to do the same thing. You could just as easily make a CustomModel or SimpleCustomModel to adapt to your EJB. You can also, if your EJB uses primitives or JavaBeans (or graphs of JavaBeans) for all parameters, use the ObjectAdapterModel to directly connect to an EJB.

Maybe you are looking for

  • Satellite U - Crashes when starting windows and recovery cannot fix

    Most of the time but not every time the laptop crashes when starting windows. I get a blue screen, a dump file is created and then it restarts and gives me the option of starting windows normally or using windows recovery. The windows recovery cannot

  • Providing a TooltipText for the ListBox  data selection  in Javascript

    Hi , I have a ListBox(select) which contains multiple values when i select a value it should popup a tooltip text mentioning that selected value. How to do it Javascript? Please do provide a solution for this. Since this is urgent. Thanks, M.Ananthu

  • BBP_GET_STATUS_2 - issue

    Hi Guy's , We are currently on SRM7 and recently have noticed that when the BBP_GET_STATUS_2 job is run it is applying a lock in table USR02 in ECC which causes the ECC system to stale. I have checked the SM37 Log and there i could see the following

  • How to create callable object which implements GP interface

    Hi experts ,                       I am very new to GP . I want to create a simple process , in which employee send an request to HR and then HR approves it. for this I am using two process and two callable object . I can create simple WD java projec

  • Option "No SLD Destination"

    Hi, I need some clarification according to following situation: On one machine (A) I have installed SAP NetWeaver, Development Subscription, with double stack engines ABAP+Java and all possible usage types. On this machine I have configured a SLD (CE


HashFlare