Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8548899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:36:17+00:00 2026-06-11T13:36:17+00:00

I use xml for persisting data about UI elements. For example, I have a

  • 0

I use xml for persisting data about UI elements. For example, I have a tag that stands for JButton, – for JMenuItem and I handle them with the help of Java SAX classes. But I want to build my UI element using Action like this:

Then I’ll handle such tag and build what I want. But I have a problem with passing different amount of options to this Action object. In one case I want to pass name like:

putValue(NAME, "Element name");

In another case it will be:

putValue(NAME, "Some name");
putValue(SHORT_DESCRIPTION, "Tooltip");
putValue(MNEMONIC_KEY, new Integer('A'));

In a code it will look like:

class NewAction extends AbstractAtion {
    public NewAction() {
            putValue(NAME, "Some name");
            putValue(SHORT_DESCRIPTION, "Tooltip");
            putValue(MNEMONIC_KEY, new Integer('A'));
    }
}

But how to do it with xml? Are there any ideas on how to store and handle different amount of Action key:value args. in xml?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:36:18+00:00Added an answer on June 11, 2026 at 1:36 pm

    May be this ?

    <action type="NewAction">
        <property>
            <name>NAME</name>
            <value>Some name</value>      
        </property>
        <property>
            <name>SHORT_DESCRIPTION</name>
            <value>Tooltip</value>      
        </property>
        ...
    </action>
    

    The action could be instantiated via reflection. However its works only if the action have no any dependencies.
    If it become too complex may be you could use spring.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data that I export into an XML file and put in
Ok so I have attempted to use multiple XML libraries that NodeJS have to
I want to use XML for UI layout and element definition. Want them to
I've been reading about serialization, and I don't really understand why we use XML
I was going to use XML for communicating some data betwwen my server and
How to use XML and Web Service Data Sources as a source for Reporting
I am trying to use xml builder without explicit definition of elements. This is
I heard that AJAX use xml concept. But I had some doubt that whether
Without going into too much detail we are looking to use XML as meta-data
I'm using core data on an iPhone application. I have multiple persisntent stores that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.