Show model properties in visual components

Hi,
My application has a model Track object with some properties like artist, title, album, ...
When a track is selected in a table, it's properties are shown in another JPanel composed with JTextField components.
For this purpose I have implemented the Observer pattern where every JTextField components implement a TrackSelectedEventListener to show a
specific property.
This approach is working fine, but the only drawback of it is that I needed to create a new Component that extends JTextField for each textfield
that implements TrackSelectedEventListener, which leaves me with a fair amount of custom components just for this purpose.
This made me thinking if there is another, maybe better? approach (apart from bean binding).
Gr

Ok thx for the reply.
But about the "only 1 JTextField subclass needed" remark:
Let's say we have 3 textfields, 1 to display the title, 1 to display the artist, 1 to display the album.
Now if I create 1 JTextField subclass which implements a listener to update the value of the textfields whenever a track is
selected like this:
public class PropertyTextField extends JTextField implements EditTrackEventListener {
     private static final long serialVersionUID = 1L;
     @Override
     public void editTrackEventOccurred(EditTrackEvent event) {
           setText("custom text for title, artist, album");     
}As I see it, the editTrackEventOccurred(EditTrackEvent event) implementation is custom for each of the textfields (title, artist, album)?
So I guess this means that I need to make a custom component for each of the textfields?
Or am I missing something?
Gr

Similar Messages

  • [svn] 4735: Fixing id selectors for non-visual components.

    Revision: 4735
    Author: [email protected]
    Date: 2009-01-29 10:53:55 -0800 (Thu, 29 Jan 2009)
    Log Message:
    Fixing id selectors for non-visual components. This required a special modification to the compiler to include id properties in generated code if a component was guaranteed to have an id property. A new mx.core.IID interface was introduced to opt in to the id property to be included. This change also required TextGraphicElement based components to implement IAdvancedStyleClient instead of just IStyleClient (though note that pseudo-selectors have no meaning for these components as they do not possess states).
    QE: Yes
    Doc: It's reasonably advanced, but we may want to document mx.core.IID for the case where a custom component exists that needs to be styled but is not based on UIComponent or GraphicElement.
    Checkintests: Pass
    Reviewers: Glenn, Paul R
    Bugs:
    SDK-18651 - Advanced CSS not setting styles on FXG elements correctly when styling using IDs
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18651
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.a s
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/TextGraphicEleme nt.as
    flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IAdvancedStyleClient.as
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.jav a
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/AttributeHandler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java
    Added Paths:
    flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IID.as

    Anyone able to help?

  • JSF design view - visual components are shrinking

    Hello,
    I have some strange issue while using Design view for JSF and data binding.
    Once I drop any data control elements into visual component (panel, etc) my visual components are shrinking to such size, that I cannot distinguish any elements within design view. I cannot use design view since then and have to place all elements base on structure panel.
    How to reproduce:
    1. Create new JSF page with wizard and accept defaults.
    2. Drop one of the panels (panel box, panel group layout) into JSF layout
    At this stage my visual elements occupy 100% of design view screen and represent anticipated outcome
    3. Drag and drop one of the data control elements (data control panel) into created panels on JSF and create table or form
    Immediately after it visual panel where data control was dropped shrinks to approximately 1/4 of the screen and I cannot see neither available space nor created table for my data components.
    I figured out, that if I remove created by wizard default <af:messages> tag from the top of my JSF, then design view representation fixes. Not sure if I should remove <af:messages> from all my pages.
    Above all looks to me as and bug.
    Environment:
    -Jdeveloper 11g
    -Windows Vista 64b
    -Not bundled JDK 6

    Hi Shay,
    Thank you for response.
    1. I tried to play with screen size without result
    2. I checked your video post, but this does not resolve my issue
    3. This issue occures with all JSF pages and can be reproduced even when following official Oracle step by step tutorials.
    4. I figured out, that removing <af:messages> tag resolves the issue ?! It seems this tag is added by default during drag and drop binding.
    5. On this link http://drop.io/jdev_001 you can see how design view is changes with and without <af:messages> tag
    6. Below is code example from one of the tutorials, that leads to shrinking as well:
    7. Once app is deployed and running page get normal view in IE as expected, so it seems to me, it is issue with Jdev design view, probably influenced by my environment, if nobody reported it before.
    Thank you for your help.
    ===========================================================================
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document id="d1">
    <af:messages id="m1"/>
    <af:form id="f1">
    <af:panelStretchLayout id="psl1">
    <f:facet name="center">
    <!-- id="af_one_column_stretched" -->
    <af:decorativeBox theme="dark" id="db1">
    <f:facet name="center">
    <af:decorativeBox theme="medium" id="db2">
    <f:facet name="center">
    <af:panelFormLayout id="pfl1">
    <af:inputText value="#{bindings.p_name.inputValue}" label="#{bindings.p_name.hints.label}"
    required="#{bindings.p_name.hints.mandatory}" columns="#{bindings.p_name.hints.displayWidth}"
    maximumLength="#{bindings.p_name.hints.precision}" shortDesc="#{bindings.p_name.hints.tooltip}" id="it1">
    <f:validator binding="#{bindings.p_name.validator}"/>
    </af:inputText>
    <af:commandButton actionListener="#{bindings.getEmployeesFindByName.execute}" text="getEmployeesFindByName"
    disabled="#{!bindings.getEmployeesFindByName.enabled}" id="cb1"/>
    <af:panelFormLayout id="pfl2">
    <af:inputText value="#{bindings.commissionPct.inputValue}" label="#{bindings.commissionPct.hints.label}"
    required="#{bindings.commissionPct.hints.mandatory}" columns="#{bindings.commissionPct.hints.displayWidth}"
    maximumLength="#{bindings.commissionPct.hints.precision}" shortDesc="#{bindings.commissionPct.hints.tooltip}"
    id="it4">
    <f:validator binding="#{bindings.commissionPct.validator}"/>
    <af:convertNumber groupingUsed="false" pattern="#{bindings.commissionPct.format}"/>
    </af:inputText>
    <af:inputText value="#{bindings.email.inputValue}" label="#{bindings.email.hints.label}"
    required="#{bindings.email.hints.mandatory}" columns="#{bindings.email.hints.displayWidth}"
    maximumLength="#{bindings.email.hints.precision}" shortDesc="#{bindings.email.hints.tooltip}" id="it7">
    <f:validator binding="#{bindings.email.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.employeeId.inputValue}" label="#{bindings.employeeId.hints.label}"
    required="#{bindings.employeeId.hints.mandatory}" columns="#{bindings.employeeId.hints.displayWidth}"
    maximumLength="#{bindings.employeeId.hints.precision}" shortDesc="#{bindings.employeeId.hints.tooltip}"
    id="it6">
    <f:validator binding="#{bindings.employeeId.validator}"/>
    <af:convertNumber groupingUsed="false" pattern="#{bindings.employeeId.format}"/>
    </af:inputText>
    <af:inputText value="#{bindings.firstName.inputValue}" label="#{bindings.firstName.hints.label}"
    required="#{bindings.firstName.hints.mandatory}" columns="#{bindings.firstName.hints.displayWidth}"
    maximumLength="#{bindings.firstName.hints.precision}" shortDesc="#{bindings.firstName.hints.tooltip}" id="it3">
    <f:validator binding="#{bindings.firstName.validator}"/>
    </af:inputText>
    <af:inputDate value="#{bindings.hireDate.inputValue}" label="#{bindings.hireDate.hints.label}"
    required="#{bindings.hireDate.hints.mandatory}" shortDesc="#{bindings.hireDate.hints.tooltip}" id="id1">
    <f:validator binding="#{bindings.hireDate.validator}"/>
    <af:convertDateTime pattern="#{bindings.hireDate.format}"/>
    </af:inputDate>
    <af:inputText value="#{bindings.jobId.inputValue}" label="#{bindings.jobId.hints.label}"
    required="#{bindings.jobId.hints.mandatory}" columns="#{bindings.jobId.hints.displayWidth}"
    maximumLength="#{bindings.jobId.hints.precision}" shortDesc="#{bindings.jobId.hints.tooltip}" id="it2">
    <f:validator binding="#{bindings.jobId.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.lastName.inputValue}" label="#{bindings.lastName.hints.label}"
    required="#{bindings.lastName.hints.mandatory}" columns="#{bindings.lastName.hints.displayWidth}"
    maximumLength="#{bindings.lastName.hints.precision}" shortDesc="#{bindings.lastName.hints.tooltip}" id="it8">
    <f:validator binding="#{bindings.lastName.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.phoneNumber.inputValue}" label="#{bindings.phoneNumber.hints.label}"
    required="#{bindings.phoneNumber.hints.mandatory}" columns="#{bindings.phoneNumber.hints.displayWidth}"
    maximumLength="#{bindings.phoneNumber.hints.precision}" shortDesc="#{bindings.phoneNumber.hints.tooltip}"
    id="it9">
    <f:validator binding="#{bindings.phoneNumber.validator}"/>
    </af:inputText>
    <af:inputText value="#{bindings.salary.inputValue}" label="#{bindings.salary.hints.label}"
    required="#{bindings.salary.hints.mandatory}" columns="#{bindings.salary.hints.displayWidth}"
    maximumLength="#{bindings.salary.hints.precision}" shortDesc="#{bindings.salary.hints.tooltip}" id="it5">
    <f:validator binding="#{bindings.salary.validator}"/>
    <af:convertNumber groupingUsed="false" pattern="#{bindings.salary.format}"/>
    </af:inputText>
    <f:facet name="footer">
    <af:panelGroupLayout layout="vertical" id="pgl1">
    <af:panelGroupLayout layout="horizontal" id="pgl2">
    <af:commandButton actionListener="#{bindings.First.execute}" text="First" disabled="#{!bindings.First.enabled}"
    partialSubmit="true" id="cb2"/>
    <af:commandButton actionListener="#{bindings.Previous.execute}" text="Previous" disabled="#{!bindings.Previous.enabled}"
    partialSubmit="true" id="cb3"/>
    <af:commandButton actionListener="#{bindings.Next.execute}" text="Next" disabled="#{!bindings.Next.enabled}"
    partialSubmit="true" id="cb4"/>
    <af:commandButton actionListener="#{bindings.Last.execute}" text="Last" disabled="#{!bindings.Last.enabled}"
    partialSubmit="true" id="cb6"/>
    </af:panelGroupLayout>
    <af:commandButton text="Save" id="cb5" actionListener="#{bindings.mergeDepartments.execute}"
    disabled="#{!bindings.mergeDepartments.enabled}" action="browse"/>
    </af:panelGroupLayout>
    </f:facet>
    </af:panelFormLayout>
    </af:panelFormLayout>
    </f:facet>
    </af:decorativeBox>
    </f:facet>
    </af:decorativeBox>
    </f:facet>
    </af:panelStretchLayout>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    Edited by: user555411 on May 2, 2010 2:08 PM

  • EDI Problem: no visual components

    Sometimes when I move my project from a machine to another, I have no visual components but just <f:form> etc instead of viewing the components wich is really a problem for me. If I move Jdeveloper directory with my project files I have no problems.
    Any idea would be greatly appreciated.
    Thanks.
    Bertrand

    Anybody has any idea? You have a loop somewhere in your program so the GUI never get a chance to repaint itself.
    This is first time I'm using JComponent for painting and I guess this might be a problem. Here is a simple example that works:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=594537

  • QuickTime Pro keeps crashing when I open "Show Movie Properties"

    I keep getting the "QuickTime Player has encountered a problem and needs to close. We are sorry for the inconvenience." crash when I try and do "Show Movie Properties" on .MOV files.
    The error signature is:
    EventType : BEX P1 : QuickTimePlayer.exe P2 : 7.65.17.80
    P3 : 4afa5828 P4 : QuickTimePlayer.dll P5 : 7.65.17.80 P6 : 4afa5820
    P7 : 0000130d P8 : c0000409 P9 : 00000000
    Any suggestions?
    I'm running the latest QuickTimePro (7.6.5) on WinXP SP3

    in fact it's one of the few bits of Quick Time that seems stable on my PC!
    Hmmmmm ... your symptoms aren't typical for what I'm about to check on. But I think we ought to check to see if any other application has sprayed old QuickTime componentry into unorthodox places on the PC. (That's one possible cause of a BEX.)
    (1) Go Start > My Computer.
    (2) From the Tools menu, select Folder Options ...
    (3) Click the View tab.
    (4) Make sure Show hidden files and folders is selected and Hide extensions for known filetypes is unchecked.
    (5) Click OK.
    Now head down into your C:\Windows\system32\ directory. What files and folders with QuickTime in the file/folder-name can you see in there?
    (In a standard QuickTime installation, you should see precisely two files, QuickTime.qts and QuickTimeVR.qtx, and no QuickTime folders whatsoever.)

  • Quicktime Player X Show Movie Properties is gone?

    I still have QT player 7 on my machine, but why is "Show Movie Properties" gone from QT X Player? I need that in order to turn on and off text layers to get chapters to work in BitVice. So I guess the fix is just use QT Player 7 in the meantime? Thanks for any insight!

    Hi,
    Maybe there should have been an option for Quicktime Pro users to ignore the Quicktime X update.
    I don't see the point of Quicktime X (other than the cosmetic changes) Why do we need two copies of Quicktime when everything we need from Pro is absent from X.
    I hope that X gets a Pro option in the near future before Apple brings out another OS update that makes Quicktime 7 Pro obsolete.
    Regards

  • Problem showing certificate properties from signed PDFs

    I'm signing two PDF files with two distinct signatures.
    When performing the following operation in Adobe Acrobat Reader 8 we obtain different results:
    Signatures, right button on top of "Signed By ...", Show Signature Properties, Show Certificate
    With one of the PDFs that's possible and we can see the certificate properties, with the other we cannot see the properties of the certificate and Acrobat Reader crashes.
    The main differences between the certificates are:
    Certificate with good results:
    Basic Constraints: "Subject Type = End Entity
    Path Length = None Constraint "
    Key Usage: Digital Signature, Non-Repudiation, Key Encipherment, Date Encipherment, Key Agreement (f8)
    Certificate with bad results:
    Basic Constraints: "Subject Type = End Entity
    Path Length Constraint = None "(Critical X.509 Version 3 extension)
    Key Usage: Digital Signature, Key Encipherment, Encipherment Date (b0 00) (Critical X.509 Version 3 extension)
    Is Adobe Acrobat Reader capable of obtainning a signature property that has Critical Extensions?
    Thanks for any help.

    Send me the file to [email protected], I'll try to have a look at my environment
    Tal
    www.arx.com

  • Binding issue between POJO properties and JavaFX components

    Currently, what I want to do is use bidirectionnal binding between POJO properties and JavaFX components.
    For example, if the property is a String, a Textfield will be generated and binded with it.
    My POJOs are generated by JAXB.
    To do that, I proceeded as followed :
    In order to make the binding works I changed the default generation of JAXB
    I created a factory which takes a class instance at input and return a Map containing the POJO properties as key and the JavaFX components as value
    I displayed this map in a JFXPanel
    Here is a sample of the factory  :
    public static Map<Field, Node> createComponents(Object obj) throws NoSuchMethodException
               Map<Field, Node> map = new LinkedHashMap<Field, Node>();
               for (final Field field : obj.getClass().getDeclaredFields())
                   @SuppressWarnings("rawtypes")
                   Class fieldType = field.getType();
                   if (fieldType.equals(boolean.class) || (fieldType.equals(Boolean.class))) //Boolean
                       map.put(field, createBool(obj, field));
                   else if (fieldType.equals(int.class) || (fieldType.equals(Integer.class))) //Integer
                      map.put(field, createInt(obj, field));
                   else if (fieldType.equals(BigInteger.class)) //BigInteger
                      map.put(field, createBigInt(obj, field));
                   else if (fieldType.equals(long.class) || fieldType.equals(Long.class)) //Long
                      map.put(field, createLong(obj, field));
                   else if (fieldType.equals(String.class)) //String
                      map.put(field, createString(obj, field));
               return map;  
    public static Node createBool(Object obj, final Field field) throws NoSuchMethodException
       System.out.println(field.getType().getSimpleName() + " spotted");
       JavaBeanBooleanProperty boolProperty = JavaBeanBooleanPropertyBuilder.create().bean(obj).name(field.getName()).build();
      boolProperty.addListener(new ChangeListener<Boolean>() {
       @Override
       public void changed(ObservableValue<? extends Boolean> arg0, Boolean arg1, Boolean arg2)
      prettyPrinter(field, arg1, arg2);
       CheckBox cb = new CheckBox();
      cb.setText(" : " + field.getName());
      cb.selectedProperty().bindBidirectional(boolProperty);
       return cb;}
    So, the problem I have is : Sometimes the binding will work and sometimes it won't. For example, the binding is working unless I changed the declaration property order in the POJO, or unless I resized the panel where components are displayed.
    Does anybody have an idea of what I am doing wrong ?
    Thanks,
    Bastien

    You may like to look at the PropertySheet from ControlsFX.
    Not sure if it does what you want, but the concept appears similar.

  • How to restore/config JDev Property Inspector to show all properties/attrs

    I'm using JDeveloper 11.1.1.0.0, and found that the Properties Inspector does not display all the attributes (for viewing/editing), instead, it shows only the attributes that has values been set explicitly.
    How can I configure it and/or restore it to show all properties/attributes of a component?

    user518778 - since you are an internal Oracle user please use the internal email list jdev_us to post your questions.

  • Cmd-J  Show Movie Properties missing in QT10???

    Where did the show movie properties window go to in QT10?

    I was having the same problem, needing that movie properties dialog.   Follow these instructions to install QT7, it will solve your problem:  http://support.apple.com/kb/ht3678

  • Java swing/visual components in an Oracle Form

    Hello,
    Has someone used visual javabeans embedded in Oracle Forms ?
    is there a special api or componente to use?
    I want to embed a jclass javabean in an Oracle Form (oracle forms client)
    any help will be welcome, thanks

    There are examples of white papers on OTN which show how you can integrate Java Beans into the Forms UI.
    You may have some success with Swing but forms is based on AWT/EWT of which there was only and old (and not
    very good) Swing version.
    As I said - check out the white papers and you can try the demos which are on the Sample Code page.
    Regards
    Grant Ronald
    Forms Product Management

  • Use J2EE CAS COM Bridge locally for non visual components

    if you only have non visual java-classes which you want to access locally through COM, you should use J2EE CAS COM Bridge. this is a very powerfull component, that makes it very easy to use about ANY java-class in VC++, VB, ASP and VBScripts. Some people said earlier in this forum, that you can only use EJBs which must also have been deployed in a J2EE EJB server. well that's not true!! if you need only local access to java-components, you can use J2EE CAS COM Bridge as well. All you need is just a JRE, actually you can have multiple JREs installed and choose among them, even dynamiclly in runtime. No JDKs and no additional J2EE components are required.
    J2EE CAS COM Bridge comes with very usefull tools and lots of examples that show, how you can access java-classes in VC++, VB, ASP, etc.
    So TRY THIS!!

    unfortunately, it's outdated! The last example (6) doesn't work. The batch file cloudUtil.bat has to be adjusted to use the current cloudscape JAR files. And even then, the Visual Basic Programm terminates with an Exception at line:
    Set AcctHome = J2eeRi.LookupEjbHome("MyAccount", "account.AccountHome")
    Exception:
    Run-time error '-2147467259 (80004005)':
    JavaException: java.lang.Exception: Could not call javax.naming.InitialContext.lookup because:
    javax.naming.CommunicationException: Can't find SerialContextProvider
    :-(

  • Empty Properties in Visual Studio

    Hi
            I am developing some sample mfc apps that includes resources. The issues I am facing is that when ever I try to access the property of the resource it shows nothing. The properties pop up is just empty. i am not
    able to set the ID for my resource. Pls advice......

    Hi Win32Beginner,
    I guess you mean that you cannot open the tree control in resource view. Do you get a red fork if you pop up the properties? Do you have .rc file in your MFC project?
    1.Please make sure that you didnot open the resource.h file. Do you get any error message? Check this:
    http://support.microsoft.com/kb/168405
    2.Please try some solution in this thread.
    http://stackoverflow.com/questions/8101665/visual-studio-c-resource-view-blank
    3.Maybe the .rc file is corrupted. Do you have tried to edit the code in the .rc file? If you modify the .rc file in a incorrect way, you will not be able to open the resource tree.
    Best regards,
    Shu Hu
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • My hp v210(4gb) pen drive is not detected in my pc but it show its properties in my pc

    my hp pen drive was not detected in my pc . my os window 7 64 bit but it show properties of the pendrive

    Hello commandcomitra,
    Take a look at the support Getting Help Guide manual which provides details on support for this product.
    Good luck!
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • File explorer (windows 8) doesn't show the properties of pdf files such a keywords or tittle. Neither when click on second button. I just see them when the file is opened with adobe reader (file prperties)

    I attach some picture to show the problem.
    Im sorry because the os is in spanish, so i translate for you the fileds names shown
    etiquetas means tags or keywords or labels, as you can see in the first picture at the second row, some file (office pack) show the tags but the selected one doesn't (pdf).
    propiedades means properties. The properties shown are different if I opened from file explorer to acrobat.
    I think there is a compatibility problem with the xmp file (metadata) from pdf file ans windows 8.1 (64bits). I tried to solve it by installing a missing file called ifilter, but the problem continues

    I believe this is all normal.

Maybe you are looking for

  • How to Upgrade 11i Database from 10.2.0.2 to 10.2.0.3

    Hi Friends, I have 11i database with (10.2.0.2)...now i want to upgrade my database to 10.2.0.3..... I have gone through the 10.2.0.3 pre instalaltion tasks....Do we again need to run the DBUA from 10g Oracle Home.... Please suggest

  • Developer6i on Redhat7.2 (openmotif-2.1.30-5_ICS)

    Hi there, I am trying to install Developer 6i on RedHat 7.1 and openmotif-devel-2.1.30-5_ICS openmotif-2.1.30-5_ICS I obtain the following message during relinking: ------------ Start of Message --------------------------- /usr/X11R6/lib/libXt.so: un

  • PDA DAQ channels swapping

    Hi everyone. I'm experiencing problems with a PDA based app collecting analog data from 6 channels. All advice appreciated. Hardware is a Juniper Allegro CX, running Windows CE.net 4.20, Intel ARM X-scale processor, 128Mb RAM, NI DAQCard 6024E in exp

  • Killing sessions

    hi, i am using oracle 11gr1 in windows server service pack2.i have generated scripts to kill the user using alter system kill session 'sid,serial# and then dropping the same user.But at times i get the error that cannot drop user who is currently con

  • Still having trouble

    I'm still having trouble updating my itunes still geting errors when trying to update it wont even let me uninstall itunes been looking through the forums and saw someone use fixit but so far its been going for a few hours only saying attempting to r