Styling component

I am setting new style on a combobox instance. Following is the code.
myCombobox.textField.setStyle("textFormat", myStyle);
myCombobox.dropdown.setRendererStyle("textFormat", myStyle);
where myCombobox is the combobox instance and myStyle is textFormat object.
but when i disable the component. i.e, myCombobox.enabled = false;
The combobox textField loses its style and resets to its defualt style, though the dropdown style remains( myStyle ).
What is the reasons for this behaviour. How can i change the style for the disabled state of the component.
Thanks is advance.

then you need to go through the library and select the textfield component used in the combobox.
Regarding changing the textformat have a look here:
http://www.rockabit.com/2008/04/15/combobox-text-formatting-in-as3/
Message was edited by: Tiago "funkysoul" Dias

Similar Messages

  • ARB Issue: Styling Component Parts

    Posted Today:
    http://opensource.adobe.com/wiki/display/flexsdk/Styling+Component+Parts
    Please comment by EOD April 6th. Thanks!

    Hey there again,
    Just bringing a few updates to this subject. I have tried to enforce some specific behavior on af|menu::child-container, calling it according to its container, like this:
    af|panelGroupLayout.MyClass1 af|menu::child-container {
         position:fixed !important;
         top:100px !important;
    af|panelGroupLayout.MyClass2 af|menu::child-container {
         position:fixed !important;
         top:200px !important;
    and, even though the browsers see this exact code (tried with both IE Dev Tool and Firebug), the behavior is still the default one (position:static I guess and, by default, the top property is ignored). I also tried the same for af|menu::scroll-box, af|menu::scroll-content and tried the syntax af|menu::bar-item > table.nth-child(2) {position: fixed; top:100px} (tried this because the 2nd child of the af|menu::bar-item is an html table and indeed, as I said above, the browser sees my specifications for this component but still does not apply them.)
    Just to make it clear, when I say that the browser sees my specifications I mean that it's not just some css that's overwritten by the default component behavior. Firebug / IE Dev Tool say that my specifications are applied, yet the desired behavior does not happen. It's the first time that I encounter a component that does not respect the specifications stated in Firebug / IE Dev Tool.
    I honestly believe this is a framework bug. If anybody has any clue about this kind of behavior, please let me know.
    Thanks,
    Toma

  • Varying size of JScrollPane

    Hi.
    I hope you can help me figure out what's going on. I have a component that I've written that should display buttons vertically (it's a basis for an OutlookBar styled component).
    The component is based on a JPanel that is put in a JScrollPane and the buttons are added to the JPanel. The JPanel has a VerticalFlowLayout (a custom layout class).
    Now for the problem: Every time I adjust the size of the component so that a scroll bar should appear, the getPreferredSize() method of the JScrollPane returns a width that is lesser than it returns when the scroll bar is not visible! The weird thing is that the difference in the width is exactly the width of the scroll bar... but it doesn't make much sense since the width that is returned when the scroll bar is visible is less than the width that is returned when the scroll bar is not visible (it would make sense to have it the other way around!).
    Since my component needs to keep a consistent width this behavior is extremely annoying! Below you can find the code for the panel (and the needed layout) if you'd like to try this out, any help will be greatly appreciated:
    import javax.swing.*;
    import javax.swing.plaf.ComponentUI;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    * A panel that contains a set of operations that are displayed under a common
    * category name on a <code>OutlookBar</code>.
    * @version Revision:$ Date:$
    public class OutlookBarCategoryPanel extends JPanel
        protected JPanel m_contentPanel = new JPanel( new VerticalFlowLayout( 5 ) );
        private JScrollPane m_contentScrollPane = new JScrollPane( m_contentPanel,
                                                        JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                        JScrollPane.HORIZONTAL_SCROLLBAR_NEVER );
         * Constructs a new <tt>OutlookBarCategoryPanel</tt> that is initially empty.
        public OutlookBarCategoryPanel()
            super( new BorderLayout() );
            m_contentPanel.setBackground( SystemColor.control );
            super.add( m_contentScrollPane, BorderLayout.CENTER );
         * If the <code>preferredSize</code> has been set to a
         * non-<code>null</code> value just returns it.
         * If the UI delegate's <code>getPreferredSize</code>
         * method returns a non <code>null</code> value then return that;
         * otherwise defer to the component's layout manager.
         * @return the value of the <code>preferredSize</code> property
         * @see #setPreferredSize
         * @see ComponentUI
        public Dimension getPreferredSize()
            Dimension size = super.getPreferredSize();
            if( size.width < m_contentScrollPane.getPreferredSize().width )
                size.width = m_contentScrollPane.getPreferredSize().width;
            return size;
         * Appends the specified component to the end of this container.
         * This is a convenience method for {@link #addImpl}.
         * <p>
         * Note: If a component has been added to a container that
         * has been displayed, <code>validate</code> must be
         * called on that container to display the new component.
         * If multiple components are being added, you can improve
         * efficiency by calling <code>validate</code> only once,
         * after all the components have been added.
         * @param     comp   the component to be added
         * @see #addImpl
         * @see #validate
         * @see #revalidate
         * @return    the component argument
        public Component add( Component comp )
            return m_contentPanel.add( comp );
         * Adds the specified component to the end of this container.
         * Also notifies the layout manager to add the component to
         * this container's layout using the specified constraints object.
         * This is a convenience method for {@link #addImpl}.
         * <p>
         * Note: If a component has been added to a container that
         * has been displayed, <code>validate</code> must be
         * called on that container to display the new component.
         * If multiple components are being added, you can improve
         * efficiency by calling <code>validate</code> only once,
         * after all the components have been added.
         * @param     comp the component to be added
         * @param     constraints an object expressing
         *                  layout contraints for this component
         * @see #addImpl
         * @see #validate
         * @see #revalidate
         * @see       LayoutManager
         * @since     JDK1.1
        public void add( Component comp, Object constraints )
            m_contentPanel.add( comp );
         * Adds the specified component to this container with the specified
         * constraints at the specified index.  Also notifies the layout
         * manager to add the component to the this container's layout using
         * the specified constraints object.
         * This is a convenience method for {@link #addImpl}.
         * <p>
         * Note: If a component has been added to a container that
         * has been displayed, <code>validate</code> must be
         * called on that container to display the new component.
         * If multiple components are being added, you can improve
         * efficiency by calling <code>validate</code> only once,
         * after all the components have been added.
         * @param comp the component to be added
         * @param constraints an object expressing layout contraints for this
         * @param index the position in the container's list at which to insert
         * the component; <code>-1</code> means insert at the end
         * component
         * @see #addImpl
         * @see #validate
         * @see #revalidate
         * @see #remove
         * @see LayoutManager
        public void add( Component comp, Object constraints, int index )
            m_contentPanel.add( comp, index );
         * Adds the specified component to this container at the given
         * position.
         * This is a convenience method for {@link #addImpl}.
         * <p>
         * Note: If a component has been added to a container that
         * has been displayed, <code>validate</code> must be
         * called on that container to display the new component.
         * If multiple components are being added, you can improve
         * efficiency by calling <code>validate</code> only once,
         * after all the components have been added.
         * @param     comp   the component to be added
         * @param     index    the position at which to insert the component,
         *                   or <code>-1</code> to append the component to the end
         * @return    the component <code>comp</code>
         * @see #addImpl
         * @see #remove
         * @see #validate
         * @see #revalidate
        public Component add( Component comp, int index )
            return m_contentPanel.add( comp, index );
         * Adds the specified component to this container.
         * This is a convenience method for {@link #addImpl}.
         * <p>
         * This method is obsolete as of 1.1.  Please use the
         * method <code>add(Component, Object)</code> instead.
         * @see add(Component, Object)
        public Component add( String name, Component comp )
            return m_contentPanel.add( name, comp );
         * Removes the specified button from the panel.  The reference that is sent as
         * a parameter needs to point to the same instance as the button that should actually
         * be removed (in other words, this method will not perform an equal() comparison).
         * @param button    a reference to the button that should be removed.
        public void remove( OutlookBarOperationButton button )
            m_contentPanel.remove( button );
         * Removes all operations that have the specified caption.
         * @param caption   the caption of the operation(s) that should be removed.
        public void removeOperation( String caption )
            Component[] components = m_contentPanel.getComponents();
            for( int i=0; i<components.length; i++ )
                Component component = components;
    if( component != null && component instanceof AbstractButton )
    if( ((AbstractButton)component).getText().equals( caption ) )
    m_contentPanel.remove( i );
    public static void main( String[] args )
    JFrame frame = new JFrame( "OutlookBarCategorButton" );
    frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    frame.getContentPane().setLayout( new BorderLayout() );
    OutlookBarCategoryPanel obcp = new OutlookBarCategoryPanel();
    obcp.add( new OutlookBarOperationButton( "foo", new ImageIcon( "images/History24.gif" ) ) );
    obcp.add( new OutlookBarOperationButton( "bar", new ImageIcon( "images/Help24.gif" ) ) );
    obcp.add( new OutlookBarOperationButton( "foobar", new ImageIcon( "images/Cut24.gif" ) ) );
    obcp.add( new OutlookBarOperationButton( "index 2", new ImageIcon( "images/isl_faninn.png" ) ), 2 );
    frame.getContentPane().add( obcp, BorderLayout.WEST );
    frame.pack();
    frame.show();
    And here is the code for the VerticalFlowLayout class:
    import java.awt.*;
    * A layout manager that works like the default layout manager in swing
    * (FlowLayout) except that it arranges its components vertically instead
    * of horizontally.
    * @version $Revision: 1.1 $ $Date: 2003/03/11 13:37:38 $
    public class VerticalFlowLayout implements LayoutManager
        private int m_vgap;
         * Creates a new instance of the class with an initial vertical gap of 0
         * pixels.
        public VerticalFlowLayout()
            this( 0 );
         * Creates a new instance of the class with an initial vertical gap of
         * the specified number of pixels.
         * @param vgap  the number of pixels to use as a gap between
         *              components
        public VerticalFlowLayout( int vgap )
            m_vgap = vgap;
         * Lays out the container in the specified panel.
         * @param theParent the component which needs to be laid out
        public void layoutContainer( Container theParent )
            Insets insets = theParent.getInsets();
            int w = theParent.getSize().width - insets.left - insets.right;
            int numComponents = theParent.getComponentCount();
            if( numComponents == 0 )
                return;
            int y = insets.top;
            int x = insets.left;
            for( int i = 0; i < numComponents; ++i )
                Component c = theParent.getComponent(i);
                if( c.isVisible() )
                    Dimension d = c.getPreferredSize();
                    c.setBounds( x, y, w, d.height );
                    y += d.height + m_vgap;
         * Calculates the minimum size dimensions for the specified
         * panel given the components in the specified parent container.
         * @param theParent the component to be laid out
         * @see #preferredLayoutSize
        public Dimension minimumLayoutSize( Container theParent )
            Insets insets = theParent.getInsets();
            int maxWidth = 0;
            int totalHeight = 0;
            int numComponents = theParent.getComponentCount();
            for( int i = 0; i < numComponents; ++i )
                Component c = theParent.getComponent( i );
                if( c.isVisible() )
                    Dimension cd = c.getMinimumSize();
                    maxWidth = Math.max( maxWidth, cd.width );
                    totalHeight += cd.height;
            Dimension td = new Dimension( maxWidth + insets.left + insets.right,
                    totalHeight + insets.top + insets.bottom + m_vgap * numComponents );
            return td;
         * If the layout manager uses a per-component string,
         * adds the component <code>comp</code> to the layout,
         * associating it
         * with the string specified by <code>name</code>.
         * @param name the string to be associated with the component
         * @param comp the component to be added
        public void addLayoutComponent( String name, Component comp )
         * Removes the specified component from the layout.
         * @param comp the component to be removed
        public void removeLayoutComponent( Component comp )
         * Calculates the preferred size dimensions for the specified
         * panel given the components in the specified parent container.
         * @param theParent the component to be laid out
         * @see #minimumLayoutSize
        public Dimension preferredLayoutSize( Container theParent )
            Insets insets = theParent.getInsets();
            int maxWidth = 0;
            int totalHeight = 0;
            int numComponents = theParent.getComponentCount();
            for( int i = 0; i < numComponents; ++i )
                Component c = theParent.getComponent( i );
                if( c.isVisible() )
                    Dimension cd = c.getPreferredSize();
                    maxWidth = Math.max( maxWidth, cd.width );
                    totalHeight += cd.height;
            Dimension td = new Dimension( maxWidth + insets.left + insets.right,
                    totalHeight + insets.top + insets.bottom + m_vgap * numComponents );
            return td;

    You can use calligraphy/ art brush strokes, can you not? Some of them come with AI and you can find quite a few on ze interweb. You could even create your own, if need be.
    Mylenium

  • Links in emails borked

    The links in emails for 'reply/view' this thread, as well as 'you can't start a new thread over email' are both broken.

    Example from last Friday. I assume this was the last ever post to the old mailing list or something.
    ----------------------snip
    Received: from adobeforums.com (browning.webcrossing.com [64.62.177.58])
        by service48.mimecast.com;
        Fri, 03 Apr 2009 00:04:30 +0100
    From: vera carr <[email protected]>
    To: <[email protected]>
    Subject: ARB Issue: Styling Component Parts
    Message-id: <[email protected]>
    Mime-version: 1.0
    Date: Thu, 2 Apr 2009 15:36:20 -0700
    Reply-to: <[email protected]>
    X-webxref: http://www.adobeforums.com/webx?13@@.59b87f33
    X-MC-Unique: 109040300043100102
    Content-Type: text/html;
      charset=WINDOWS-1252
    Content-Transfer-Encoding: quoted-printable
    Return-Path: [email protected]
    X-OriginalArrivalTime: 02 Apr 2009 23:04:32.0315 (UTC) FILETIME=[6233D0B0:01C9B3E7]
    X-Length: 1805
    Status: R
    X-Status: NC
    X-KMail-EncryptionState: 
    X-KMail-SignatureState: 
    X-KMail-MDN-Sent: 
    X-UID: 3204
    A new discussion was started by vera carr in <br><br>
    <b>Developers</b> --<br>
      ARB Issue: Styling Component Parts<br><br>
    Posted Today: <br>
    <a href=3D"http://opensource.adobe.com/wiki/display/flexsdk/Styling+Compo=
    nent+Parts">http://opensource.adobe.com/wiki/display/flexsdk/Styling+Comp=
    onent+Parts</a> <br><br>Please comment by EOD April 6th. Thanks!
    <br><br>
    <hr width=3D200 align=3Dleft>View/reply at <a href=3D"http://www.adobefor=
    ums.com/webx?13@@.59b87f33">ARB Issue: Styling Component Parts</a><br>
    Replies by email are OK.<br>
    Use the <a href=3D"http://www.adobeforums.com/webx?280@@.59b87f33!folder=3D=
    =2E3c060fa3">unsubscribe</a> form to cancel your email subscription.<br><=
    br><DIV> </DIV><br/>
        <br/>
    ---------------------------snip
    I use KMail to conect to Exchange over IMAP, but that's not really the issue, the 'view/reply' link in everyones archjived email is.

  • Problems skinning/styling ComboBox component

    So the first image is the design brief, and below it is my attempt so far. Some ways to go, and the limitations and scarce documentation of this process is getting to me. So i'm putting a call out to see if anyone's well across this process and could assist, or step me through it?
    been a while since i skinned a component in AS2, and I remember I prefered to write my own components rather than go through this process at the time. but i am hoping to use the built-in Flash component this time.
    So what I need help with is:
    Adjust scrollbar scrubber and track width, hopefully add padding around scrubber, and hopefully this would resolve the issue of losing the scrubber's black border on the right.
    Resolve issues with the combo-button (what's that white border doing there?)
    Style font correctly in combo-button
    Increase list row height
    Add dotted line between list rows
    (I'm ignoring the blue numbers)
    If anyone can help with even just one of those issues, i'd love to hear from you.
    Info about my attempt so far:
    I have skinned several clips, such as scrollThumb*, scrollUpArrow*, scrollDownArrow*, comboDownArrow*, etc.
    I have styled with the following:
    comboBox.setStyle("backgroundColor", 0x504C4B);
    comboBox.dropdown.setStyle("backgroundColor", 0x504C4B);
    comboBox.setStyle("themeColor", 0x1F90AE);
    comboBox.setStyle("color", 0xC4C0BF);
    comboBox.setStyle("textSelectedColor", 0xC4C0BF);
    comboBox.setStyle("textRollOverColor", 0xC4C0BF);
    comboBox.setStyle("alternatingRowColors", [0x504C4B, 0x504C4B]);
    comboBox.setStyle("borderStyle", 'none');
    I have attached the fla I've worked with so far in a zip.
    Thanks for your help!

    Well I resolved this merely by lowering my expectations!
    Leaving this unanswered because I am hoping there must be answers to these issues out there for future reference.
    But for now, my comboBox looks like this:
    And i achieve this by skinning some clips, and adjusting my styling code:
    combo.setStyle("backgroundColor", 0x504C4B);
    combo.dropdown.setStyle("backgroundColor", 0x504C4B);
    combo.setStyle("themeColor", 0x1F90AE);
    combo.setStyle("rollOverColor", 0x46bbda);
    combo.setStyle("color", 0xC4C0BF);
    combo.setStyle("textSelectedColor", 0xFFFFFF);
    combo.setStyle("textRollOverColor", 0xFFFFFF);
    combo.setStyle("alternatingRowColors", [0x504C4B, 0x504C4B]);
    combo.setStyle("borderStyle", 'none');
    combo.text_mc.setStyle("borderStyle","none");
    combo.text_mc.setStyle("themeColor", 0x00FF99);
    combo.text_mc.setStyle("borderColor",0xFFFFFF);
    combo.text_mc.setStyle("color",0xC4C0BF);
    combo.dropdown.setStyle("color",0xC4C0BF);

  • Any sources for styling \ skinning the Slider component?

    Any sources for styling \ skinning the Slider component?
    ie setting the background invisible or using another graphic in place of the line/rectangle graphic.   using another graphic for the thumb.  replacing the current graphic thumb has restrictions in dimensions,

    :  http://flash.sikotiko.com/2009/05/05/as3-skinning-slider-component/

  • Skinning/Styling adfp:portlet component while consuming portlets.

    Hi Everyone,
    I am trying to skin the adfp:portlet component in my portal application. However, every styling that appears in JDeveloper to take effect ( for example if I change the background color, it shows up in editor) seems to go off at runtime. This would have been an ADF forum question if the adfp:portlet was part of ADF Core components, which isn't the case. Any helpful pointer is deeply appreciated.
    Thank you.
    Edited by: user12272414 on Dec 19, 2011 9:57 AM

    I missed one point:
    The first WC Application with issue is deployed to:
    http://oow3.oracle.com/oow/faces/order.jspx
    The right one is deployed to
    http://b.cn.oracle.com/oow/faces/order.jspx

  • Styling / Skinning the MediaPlayback Component

    I've been trying to change the colors on the darn
    MediaPlayback Component for months!!! I've read so many tutorials
    on skinning, styling, etc... but I can't get these stupid colors to
    change. I've managed to style other components using code, using
    themes, etc... but this component won't budge!
    Can someone point me to a method that 100% works? I'm not
    looking to change button shapes, only the colors.. specifically the
    green. If code works for this, I am comfortable with code.
    Anything!
    I'm using Flash 8 Professional.

    :  http://flash.sikotiko.com/2009/05/05/as3-skinning-slider-component/

  • Error in Simple mx Component Styling?

    Like many, I am finding the behavior of CSS namespaces in Flex 4 very frustrating.
    I have a very simple example which is not working. I hope I'm missing something!
    I have a SWC with a defaults.css file. The CSS file is setting the style for Alert using the following:
    @namespace "http://www.adobe.com/2006/mxml";
    Alert
    backgroundColor: #333333;
    borderColor:#555555;
    color: #ff0000;
    backgroundAlpha:0.9;
    borderAlpha:1;
    buttonStyleName: Button;
    paddingBottom: 8;
    The namespace is set as you can see. I have also tried this by specifying "mx". The Alert box does not get styled, not even the background color gets set.
    What am I missing? I am using the Alert in Actionscript using Alert.show. This worked fine in Flex 3.

    Alrighty, I've got a Flex Library project compiling a SWC containing a defaults.css file, with the following:
    @namespace "library://ns.adobe.com/flex/mx";
    Alert
    backgroundColor: #333333;
    borderColor:#555555;
    color: #ff0000;
    backgroundAlpha:0.9;
    borderAlpha:1;
    buttonStyleName: Button;
    paddingBottom: 8;
    Then amidst some Actionscript ...
    Alert.yesLabel = "Hi";
    Alert.noLabel = "Bye";
    Alert.buttonWidth = 80;
    Alert.show("Hello World?", "Close", Alert.YES | Alert.NO | Alert.CANCEL, ApplicationUI.instance);
    Pretty basic, just can't get style working on the Alert at all. It is working for Button, but not for the button's background. If you have a simple example of it working, that's be perfect!
    Thanks,
    -Patrick

  • Styling a tree component

    Hi!
    I would like to customize a tree component so that "nodes"
    actually look like buttons.
    i tried exporting the style and edit with flash, but that way
    I can only edit the tree icons...
    what I want is the Name of my node appearing inside of the
    icon so that if i make the icon wide and look like a button, the
    text should not be beside it....if i make any sense here..
    maybe there's a way to use another component?
    i only want one level below the node, so i could use an
    Accordion but it doesn't work for empty containers (Canvas), it
    always slides down a bit , even if you set the canvas' width and
    height to 0 and the accordion to resizeToContent..
    i hope i'm not too confusing and that someone can help me :)
    cheers

    Some people have adapted the tree control to make Treemaps.
    Maybe that could help you
    http://www.zeuslabs.us/2006/12/25/flex-treemap-subversion-download/

  • Please Help.JTable insert styled text

    Hi all java guru,
    on post http://forum.java.sun.com/thread.jsp?forum=57&thread=485469 i've depicted my scenario in which i have a JTable where i want to add styled text.
    i've implemented a CustomTableModel that maintains information about text style, in such way that when renderer cell, i can rebuild exact text with its style....same method is adopted for CellEditor.
    It is possible to have more than one JTable in my application....then to correctly handle all JTables ' put them in a vector and during editing and rendering i find current focusable/selected JTable and edit/render it.
    Clearly i maintain information about style of text when i insert it, that is when i insert text, i update my CustomTableModel...same thing must be done when i delete text from JTable...that is, i must update CustomTableModel too in this case.
    Because my CellEditor is a JEditorPane component (extend it) i've registered document associated to it to a DocumentListener that notify every time that a remove operation is happens.
    What is the problem now???problem is that when i finish to edit a cell and click on another cell i've got a removeUpdate(DocumenEvent e) event, and i can't distinguish it.....it seems a real remove event....
    In this case(when i change cell) the code that is executes returns wrong result and invalidate all the rest.
    I think error is where i register celleditor , now i do it in CustomCellRenderer class that extend JEditorPane and implements TableCellRenderer.
    Please help me...this is a great trouble that invalidate all my work :(
    Any new idea is welcome.
    regards,
    anti-shock

    Hi stanislav, of course i can...you're a myth :)
    public class CustomCellEditor extends AbstractCellEditor implements TableCellEditor {
           CellEditor cellArea;
         JTable table;
         public CustomCellEditor(JTable ta) {
              super();
              table = ta;
              // this component relies on having this renderer for the String class
              MultiLineCellRenderer renderer = new MultiLineCellRenderer();
              table.setDefaultRenderer(String.class,renderer);
         public Object getCellEditorValue() {
              return cellArea.getText();
         public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected,     int row, int column) {
              int start = 0;
              int end = 0;
                                               // Get current selected table
              TableEditor tb = (TableEditor) TableEditor.getSelectedTable();
              TableModel model = (TableModel) tb.getModel();
              Vector fontInfo = model.getFontFor(row,column);
              CellEditor cellArea = (CellEditor) ((CustomCellEditor)tb.getCellEditor (row,column)).getCellEditor();
              Document doc = cellArea.getDocument();
              String content = tb.getValueAt(row,column).toString();     
              if (doc!=null && fontInfo.size()>0 && !content.equals("")) {
                                                     // This method reads from model and get right style info
                                                     // for current text, and restore them
                                                     restoreFontWithAttributes(doc,fontInfo,content);
              else
                   cellArea.setText(tb.getValueAt(row,column).toString());
              cellArea.rowEditing = row;
              cellArea.columnEditing = column;
              cellArea.lastPreferredHeight = cellArea.getPreferredSize().height;
              return cellArea;
          * @return
         public CellEditor getCellEditor() {
              return cellArea;
         public class CellEditor extends JEditorPane {
              private CellStyledEditorKit k;
              public CellEditor() {
                    super("text/plain","");
                    k = new CellStyledEditorKit();
                    setEditorKit(k);
                    // I tried to add document here, but i have had wrong behavior
                   doc = new DocumentListener() {
                   public void removeUpdate(DocumentEvent e) {
                      // Get current selected table
                      TableEditor tb = (TableEditor) TableEditor.getSelectedTable();
                      TableModel model = (TableModel) tb.getModel();
                      model.updateFontInfo();
                   getDocument().addDocumentListener(doc);
    }Ok, stan...this is my CustomCellRenderer class....as i have already said, i have some style text info mainteined by CustomTableModel associated with JTable.
    I update CustomTableModel every time that an insert and remove operation happens.
    If i add a DocumentListener to CellEditor (that rapresents editor cell of my table) happens that, if i remove some character from an editing cell, i got a removeUpdate event.....and this is right!!! But if i change cell (e.g. supposing editing cell(1,1), click on cell(2,1) then stop edit cell(1,1) and start edit cell(2,1)) i got a removeUpdate event, that I don't wait for to me..
    Look at this:
    empty cell | some text
    cell 0 ------- cell1
    supposing you're in cell1 and you have finished to insert "some text".Then click on cell0, that is empty....then document associated with CellArea(extend JEditorPane) before of the click on cell0 had some text, but after click have no text, then for it a removeUpdate is happens.....and is that one i got..
    it's as if an unique document is associated to all cells, while should be one document for each cell (i hope this is right).
    Clearly, i've same code for renderer, in such way that i can restore style of text on rendering.
    Hope is clear....if U have any idea or suggestion please give to me.
    Tnx a lot Stanislav..
    regards,
    anti-shock

  • How to view the source code of JavaFx component ?

    Hi everybody,
    I just want to know if it's possible to view the source code of the component Button (from JavaFx) and how to do it ?
    In fact, I don't really understand if JavaFx is entirely open source ?
    Thanks.

    I lack time right now to experiment, but I think you can get your goal just with CSS.
    Here are the variables I found for Button:
    Button
    borderFill: class javafx.scene.paint.Paint = (null)
    button: class javafx.scene.control.Button = Button
    colorBrightness: Float = 0.8156863
    cornerRadius: Float = 7.0
    fill: class javafx.scene.paint.Paint = (null)
    focusFill: class javafx.scene.paint.Paint = javafx.scene.paint.Color[red=0,green=147,blue=255,opacity=1.0]
    focusSize: Float = 1.4
    highlightFill: class javafx.scene.paint.Paint = (null)
    label: class javafx.scene.control.Label = LabeledImpl [id=-Label]
    paddingBottom: Float = 4.0
    paddingLeft: Float = 10.0
    paddingRight: Float = 10.0
    paddingTop: Float = 4.0
    shadowFill: class javafx.scene.paint.Paint = (null)
    textFill: class javafx.scene.paint.Paint = (null)
    textFont: class javafx.scene.text.Font = Font[name=Verdana, family=Verdana, style=, size=11.0]Try changing cornerRadius and focusFill/highlightFill, etc. Note that some discovered properties are not affected by CSS... Perhaps that's why there isn't an official doc about CSS styling currently.

  • Can we rebrand flex based component using CSS?

    Hi,
    We are new to Flex.
    We just built a custom grid component extending ADG using version 4. We would like the consumers (other application developers) use this component within other J2EE based applications with additional customization like
    branding or themes. --- can we use external CSS ?
    grid columns, order, initial sort order, filtering, , data source   ( or backend service url )  to retrieve data, etc ? how can we do it? if this component is offered as an HTTP(S) url, can we pass in parameters to customize before framing it ? which is the best way ?
    Please let us know whether it is possible ? If so, how best we can implement it ? Any examples out there? Appreciate if someone can share. It will help us to add this custom grid to our component repository.
    Thanks in advance,
    -Shiva

    hi,
    Thanks for the quick reply. It will be helpful if you have any examples of customization by passing in FlashVars or thru ExternalInterface. Appreciate your time and help.
    For styling, it is very disappointing to know that we are limited. If there is a way to tweak in that will help while Adobe comes out with additional support for styling in future versions.
    -Shiva

  • Skins that effect the host component behaviour.

    There was an interesting question that was raised in the pre-release forums about what is the appropriate way to handle animations between the skin and its host. Basically the issue was if there is an animation in the host and another in the skin what would be the best way to code it so that both animations ran in parallel, My thoughts are why not do it all in the skin. this example animates a container by resizing it and centering it in the application.
    I figured it would be an interesting topic for those that are trying adding extra component functionality into the skin.
    @PD - Maybe you could apply a little of your magic to something like this and add it your blog.
    David
    The App
    =============================================================
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/halo"
      creationComplete="application1_creationCompleteHandler(event)" width="100%" height="100%">
    <s:layout>
    <s:BasicLayout/>
    </s:layout>
    <fx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.events.FlexEvent;
    protected function application1_creationCompleteHandler(event:FlexEvent):void
    menu1.verticalCenter=height/2*-1 + 35; 
    menu1.horizontalCenter=width/2*-1 + 110;
    ]]>
    </fx:Script>
    <s:SkinnableContainer id="menu1" left="10" top="10" width="200" height="50"
    skinClass="SkinnableContainerSkin2" backgroundColor="#A16969">
    </s:SkinnableContainer>
    </s:Application>
    =============================================================
    The Skin
    =============================================================
    <?xml version="1.0" encoding="utf-8"?>
    <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:fb="http://ns.adobe.com/flashbuilder/2009" alpha.disabled="0.5" creationComplete="skin1_creationCompleteHandler(event)">
    <fx:Declarations>
    <s:Parallel id="sizer">
    <s:Animate target="{hostComponent}" duration="2000" repeatCount="1">
    <s:SimpleMotionPath id="setheight" property="height" valueTo="500"/>
    </s:Animate>
    <s:Animate target="{hostComponent}" duration="2000" repeatCount="1">
    <s:SimpleMotionPath id="setvertical" property="verticalCenter" valueTo="0"/>
    </s:Animate>
    <s:Animate target="{hostComponent}" duration="2000" repeatCount="1">
    <s:SimpleMotionPath id="sethorizontal" property="horizontalCenter" valueTo="0"/>
    </s:Animate>
    </s:Parallel>
    </fx:Declarations>
    <fx:Metadata>
        <![CDATA[
            [HostComponent("spark.components.SkinnableContainer")]
        ]]>
        </fx:Metadata>
        <fx:Script fb:purpose="styling">
            <![CDATA[       
    import mx.events.FlexEvent;
    import mx.core.FlexGlobals;
    private var Vert:int;
    private var Horz:int;
                override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number) : void
                    bgFill.color = getStyle("backgroundColor");
                    bgFill.alpha = getStyle("backgroundAlpha");
                    super.updateDisplayList(unscaledWidth, unscaledHeight);
    protected function resizeMe(e:MouseEvent): void
    Vert = int(FlexGlobals.topLevelApplication.contentGroup.height/2*-1)+35;
    Horz = int(FlexGlobals.topLevelApplication.contentGroup.width/2*-1)+110;
    if (hostComponent.height < 51)
    setheight.valueTo=500;
    setvertical.valueTo=0;
    sethorizontal.valueTo=0;
    else
    setheight.valueTo=50;
    setvertical.valueTo=Vert;
    sethorizontal.valueTo=Horz;
    sizer.play();
    protected function skin1_creationCompleteHandler(event:FlexEvent):void
    Vert = int(FlexGlobals.topLevelApplication.contentGroup.height/2*-1);
    Horz = int(FlexGlobals.topLevelApplication.contentGroup.width/2*-1);
            ]]>       
        </fx:Script>
        <s:states>
            <s:State name="normal" />
            <s:State name="disabled" />
        </s:states>
        <s:Rect left="0" right="0" top="0" bottom="0">
            <s:fill>
                <s:SolidColor id="bgFill" color="0x00DDDD"/>
            </s:fill>
        </s:Rect>
        <s:Group id="contentGroup" left="0" right="0" top="0" bottom="0" minWidth="0" minHeight="0" click="resizeMe(event)">
            <s:layout>
                <s:BasicLayout/>
            </s:layout>
        </s:Group>
    </s:Skin>

    This is a good question.
    There's no hard and fast rule to apply which says "this belongs in the skin" vs. "this belongs in the component".  Similarly, there are also no hard and fast rules around when to use a the new skinning architecture vs. just creating a custom component.  Just do whatever you feel comfortable with and makes your job easier.  At the end of the day, it's about productivity and not living up to ideals.  That said, there are probably some easier and more logical ways to do some things.
    On the skinning architecture vs. custom component debate, with a SkinnableComponent we have a clear separation of the component properties and behavior on one side and the look and feel of the component on the Skin side.  Also, there's a clear contract we use to talk back and forth to one another.  The reason for the separation between the Skin and the SkinnableComponent is so that we can have one Button SkinnableComponent and multiple Skins for that Button which all tweak the visual appearance of it.
    It doesn't make sense for every component to be skinnable.  If you know what your component is going to be and look like and don't need the extra flexibility skinning provides, then you can get rid of the extra overhead that skinning requires (like having 2 classes).  An example custom component is:
    <s:Group>
    <s:Rect>
    </s:Rect>
    <mx:Image src="..." />
    <s:Panel skinClass="myCustomSkinClass">
    </s:Panel>
    </s:Group>
    If you want more flexibility and want the ability to easily change the look and feel of the component (i.e. skin it), then you'd extend SkinnableComponent, fill out the skinning lifecycle methods, and create a default Skin for its appearance.
    Now, when you're building a SkinnableComponent, there's always a question of what to put in the component vs. what to put in the skin.  In general, we try to put the core properties and behaviors in the component and anything visual in the skin.  However, another guideline to consider is whether all skins would want this behavior.  If so, then it makes sense (and makes your life easier) to put it in the SkinnableComponent rather than the Skin.  We do this in the framework for components like VSlider, where the logic for positioning the y-axis of the thumb is in the component and not the skin, even though it's a "visual" thing.  We also have discussed how we would build up a ColorPicker component, and I think the way we would go about it is by putting a lot of the "visual" logic in the component because otherwise we'd have to duplicate it across all skins.
    Now, the other question you guys are asking here are "when do I bake effects (or any behavior) in to the component (either in the skin or in the SkinnableComponent AS class) vs. when do I declare effects alongside the component".  Again, I think the answer to that is whether you want all your components to have this behavior.  If that was the case, then I'd lose no sleep baking it in to the component.  However, if it's not the case, then I'd make the end-developer delcare it when they use your component, like:
    <s:MyCustomComponent id="myComponent" />
    <s:Resize id="resizer" widthTo="100" heightTo="50" target="{myComponent}"/>
    I would think most of the time, you probably wouldn't want to bake an effect like that in to the component, especially because it has some sizing information on it.  However, we have some effects baked in to some of the framework components, like when the thumb of a Slider moves around due to someone clicking on the track.  I think it's fine that it's baked in to the component, but I do think it should probably be stylable so that a user can customize it (that's on our list of lower-priority things to do btw).
    The framework has definitely evolved.  I think we started out with a more purist attitude and wanted a clear separation between the skin and the component.  However, as we built out components, we realized it's not always practical to do that.  Similarly, we wanted our skins to be pure MXML; however, for usability reasons, we decided that our skins should be styleable, and that requires a little bit of ActionScript code.  Border is a great example where it doesn't really follow a lot of these guidelines, but it's just a styleable component; however, this component makes other people's jobs easier.  At the end of the day, it's about productivity and usability, and hopefully the Spark architecture is a step in the right direction.
    Anyways, I hope that helps some.  These are just some guidelines.  As people play around with the architecture more, I'm sure some other people will have some good advice to share as well.
    -Ryan

  • Comics balloon - styled tooltips?

    Hi, I am making a JApplet for a game, and so far I am using coloring of the component if the user doesn`t do something as he/she is supposed to, i.e if he/she doesn`t enter a player name in the text field, it colors red, I was thinking is it possible to create sort of a pop-up comics balloon styled tooltip when there is a problem with the user`s input. I`ve done a google search but no luck. Any ideas? Thanks in advance.

    I solved this by creating a Popup, sticking a JTooltip inside it and making it visible.
    Thanks anyway :)
    Gili

Maybe you are looking for

  • Finished script: Use grep find/change to fill in a supplied table of contents

    This script is now complete, and has been the subject of most of my previous posts. Just in case anyone wanted to know what the finished script ended as, here it is. Thanks so much to all. A lot of really helpful folks on this board are very responsi

  • Clear Windows local cache

    Hi, After a 10MB file transfer across a WAN from DC to branch office with WAEs in inline intercepting mode, i noticed subsequent transfers were exetremely fast even without the WAAS appliances interception. It appears Windows OS was also doing some l

  • How to Change language in spell check for CS4?

    How do I change language in spell check for CS4?

  • "Previous Shutdown Cause" codes?

    Hi -- My MacBook has been experiencing some problems.. intermittently shutting itself down, and getting worse & worse until I couldn't even start the laptop up. I believe the problem was a faulty memory module (3rd party, installed myself) -- after r

  • Useless product.

    I have an ongoing issue with my hp printer (see previous posts). It is not printing under the wireless connectivity, only through the eprint facility, which is hit and miss as I continually have to re enter my hpeprint address for it to function. I h