Code Monkey home page Code Monkey logo

cjwizard's Introduction

PLEASE NOTE: SPUPORT FOR JAVA 7 IS ENDING, AND THE CJWIZARD PROJECT'S SUPPORT POLICY IS CHANGING.

Going forward, each new CJWizard release will officially support usage of the library with all OpenJDK versions that have long-term support, PLUS the version that is current, at release time. This change will be effective with the next release of CJWizard.

CJWizard

CJWizard is a library for creating swing based wizard dialogs in Java.

This library is meant to be an improvement on the Java Wizard library, formerly at https://wizard.dev.java.net/; that library offered a good framework for simple wizards, but it dictated a great deal of what you can do - justified by the java usability guidelines. However, not all of the restrictions are justified by those guidelines. For example, it is particularly difficult to change the type of widget used on the left side of the wizards (it is initially an image with the list of wizard pages displayed over top of it). Making this area interactive, as a global navigation tool, is non-trivial.

In addition, it is extremely cumbersome to define complex wizards that change their branching behavior at runtime. Generally, the Java Wizard API is difficult to use, and at times contradictory.

That said, we've learned a lot from the Java Wizard API, and some of those ideas have been incorporated into CJWizard.

Take a look at the FAQ and QuickStartGuide to get going, and send me questions if you have any.

Screenshots

This shows CJWizard in action, with a custom PageTemplate (drawing the list of dialog pages on the left) that wraps around a !TitledPageTemplate (drawing the underlined title of the !WizardPage). The Windows L&F was used to make it look like a native app. (The Finish button is enabled because the surrounding app is robust to missing data, and allows for the user to come back to the wizard at a later date, if needed. Generally, and by default, the Finish button is disabled if it is not explicitly enabled, which often happens in the render() method of the last !WizardPage)

sample dialog

Maven coordinates

CJWizard is now hosted in Lobos Studios' java-dev repository.

To use the repo with Gradle:

repositories {
    mavenCentral()
    maven {
        url "https://repos.lobosstudios.com/repository/java-dev/"
    }
}

dependencies {
    // this is just an example; the other Maven artifacts are
    // still available, same as before.
    implementation "com.github.cjwizard:cjwizard:[VERSION]"
}

To use it with Maven:

    <repositories>
        <repository>
            <id>lobosstudios-nexus-java-dev</id>
            <name>Lobos Studios java-dev</name>
            <url>https://repos.lobosstudios.com/repository/java-dev/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.github.cjwizard</groupId>
            <artifactId>cjwizard</artifactId>
            <version>[VERSION]</version>
        </dependency>
    </dependencies>

repos.lobosstudios.com runs on a Sonatype Nexus server. Repos hosted on Nexus require the slash at the end of the URL. Don't forget it...

Documentation

See docs folder

Requirements

To use this library you need

  • Java 7 or later

Dependencies

This library depends on

  • slf4j-api

cjwizard's People

Contributors

chenzhang22 avatar chenzhangg avatar creswick avatar dependabot[bot] avatar fluxw42 avatar guerda avatar mperrando avatar petikoch avatar phoneixs avatar spyhunter99 avatar stevesobol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cjwizard's Issues

Create sample project for testing and demonstrations.

Issue #38 revealed how bad our current testing is. One thing we could do to help is to build a minimal sample project (adapting the quickstart?) and put it in the repo (perhaps in a samples directory).

Ideally, that would be built and run, using the latest version in target, before each deploy. I expect that that will require some interesting scripting / maven magic to happen in a nice seamless way, but even if it's manual that'd be a start.

If anyone has a simple sample that they'd be willing to share, please let me know!

Access to Buttons in WizardContainer would be useful

From [email protected] on June 16, 2011 17:41:58

In order to add accelerators and such to the 4 buttons in a WizardContainer (Finish, Cancel, Previous and Next), or to contextually change their text, I had to traverse the Swing container hierarchy and match them by finding JButton's whose actions have the right names. This is less than optimal.

It would be wondrously useful to have accessors for the buttons, such as getNextButton(), etc. And it wouldn't be very hard.

Original issue: http://code.google.com/p/cjwizard/issues/detail?id=9

Caused by: java.util.MissingResourceException: Can't find bundle for base name com.github.cjwizard.i18n.cjwizard, locale de_CH (Version 1.0.5)

I just tried to integrate the released 1.0.5 Version...

At runtime, I get

Caused by: java.util.MissingResourceException: Can't find bundle for base name com.github.cjwizard.i18n.cjwizard, locale de_CH
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:773)
    at com.github.cjwizard.WizardContainer.<clinit>(WizardContainer.java:61)
    ... 43 common frames omitted

I looked into the cjwizard-1.0.5.jar, there is indeed the i18n package missing with the properties files...

Best regards,
Peti

StackWizardSettings breaks java.util.Map contract

  1. It doesn't implement .entrySet() and .values(), making the whole thing unsafe to use with the code that expects a proper Map (e.g. to save the resulting settings into a file). Is there a reason why it's implemented this way? There's an issue (#46) about it, but I don't quite get why it was closed. Unless, indeed, StackWizardSettings should only be used for controlling the wizard flow, and not for accumulating the resulting settings. Which doesn't seem to be the case, since the data from the named components winds up inside it.
  2. The object returned by .keySet() is not backed by the StackWizardSettings object, which contradicts the Map documentation:

    The set is backed by the map, so changes to the map are reflected in the set, and vice-versa.

  3. Even though some similar conflicts are mentioned in the JavaDoc comments (e.g. the remove method), they still break the contract!

It seems to me that the WizardSettings interface shouldn't extends Map at all, and should instead provide a way to get a Map that would be either a snapshot of, or backed by, the current stack item, as well as a way to get an effective Map snapshot for the whole stack.

Cleanup project

  • Close old issues
  • Create a wiki page for developers / collaborators
  • Create an example project
  • Remove unused files

Where to move Maven repo?

JCenter is going away as of May 1st, 2021.

https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/#:~:text=JFrog%20is%20evolving%20to%20meet%20the%20new%20challenges%20that%20developers%20face.&text=To%20streamline%20the%20productivity%20of,services%20on%20May%201st%2C%202021.

So, the question is, do we move to:

  • A free JFrog Artifactory account? (Artifactory has a free tier, https://jfrog.com/pricing/)
  • Maven Central? I'd have to check whether we're mirroring to Maven Central or not.
  • Nexus? I have a Sonatype Nexus OSS server running at https://repos.lobosstudios.com. It's currently only hosting one private Debian APT repo right now, but my plan's always been to host public repos. I've just had nothing to host up until now.

Add support for Java 9 and 10

We need to make sure we are supporting Java 9 and 10. Oracle has 10.0.1 out now, and it can be downloaded using this link, while the OpenJDK 10.0.1 download can be found here.

It may be as simple as adding the proper keywords to travis.yml and letting Travis successfully build the project. Actually, it SHOULD be that simple. We are constrained, at the moment, by the fact that Travis CI support for Java 10 isn't quite ready for prime-time. And I've had no specific requests to support 9 OR 10 yet, so I'm going to hold off on making any changes for now. But hopefully we'll be able to get this done soon

Documentation

We need more complete documentation, including more sample code.

Change next page based on settings

From [email protected] on March 28, 2014 03:44:18

What steps will reproduce the problem?

  1. Create 3 pages. And in page factory create second page to display based on a setting that is selected int step 1.
  2. Start the wizard.
  3. Make an election in step 1 and click next.
  4. You will see page 2 (for example).
  5. Click back.
  6. Change the settings so is supposed to launch page 3.
  7. Click next.
  8. Page 2 is show again.

What is the expected output? What is expected is that createPage will be called so you show the correct page but instead a cached version is used (that is wrong).

What version of the product are you using? On what operating system? Using r39 . Please provide any additional information below. The problem is in WizardContainer in next method, a todo said it:

  ///TODO [dpd] this won't work with multiple paths
  WizardPage nextPage = null;
  if (_visitedPath.isEmpty()) {
     nextPage = _factory.createPage(getPath(), getSettings());
  } else {
     nextPage = _visitedPath.remove(0);
  }

I think that the cached version must only be show when settings aren't modified.

Original issue: http://code.google.com/p/cjwizard/issues/detail?id=13

How to become a committer?

From [email protected] on March 21, 2011 09:07:54

Hi there,

I just found this project. I've used http://wizard.dev.java.net before, but I don't like the NetBeans-style UI, and at any rate, Oracle has rendered java.net completely unusable...

cjwizard is simple. I like that.

I'd like to help with this project. The concept is great, the implementation seems quite good, and I don't want to see this tool stagnate like so many other worthwhile development tools have.

If you'd like my help, please email me. [email protected]

Thanks :)

Original issue: http://code.google.com/p/cjwizard/issues/detail?id=6

Could we have snapshots in JCenter?

Do you know if it is possible to automate that when we have new commits and travis is ok with them then it is published automatically on JCenter (Bintray)?

validation before "next" and "finish"

From [email protected] on May 15, 2011 09:19:37

There's no easy way to prevent user from moving onto next page.

I suggest implementing validation functional in WizardPage:

/**
* validation for page. should be called before moving on.
* descendants can overload this function to warn user on incorrect fields
* @returns true by default
*/
    public boolean validateFields(){
        return true;
    }

in WizardContainer class couple of methods should be extended:

   public void finish() {
....
      WizardPage lastPage = getPath().get(getPath().size()-1);
      if (!lastPage.validateFields()) return;
....
   }

public void next() {
      if (0 != _path.size()){
         // get the settings from the page that is going away:
         WizardPage lastPage = _path.get(_path.size()-1);

         if (!lastPage.validateFields()) return;
....
}

Original issue: http://code.google.com/p/cjwizard/issues/detail?id=7

Maven dependency snippet doesn't work

The maven dependency snippet in the readme doesn't seem to work for me.

<dependency>
  <groupId>com.github.cjwizard</groupId>
  <artifactId>cjwizard</artifactId>
  <version>x.y.z</version>
  <type>pom</type>
</dependency>

The snippet matches the snippet that is provided in the bintray link

In order for my project to actually download the classes, I needed to remove the <type>pom</type> tag. After that the jars were downloaded correctly and I was able to use the classes.

No easy way to update the page title without changing WizardPages.

From [email protected] on July 14, 2008 09:56:55

The WizardController API doesn't expose any means of changing the page
title as displayed in the PageTemplate, or on any surrounding "chrome" (for
example, on the dialog window border.)

One solution is to add a titleChanged(String newTitle) event to the
!WizardListener interface, and a setTitle(String title) method on the
!WizardController. I think that this method would then be fired before or
after the pageChanged(...) listener event, but I'm not sure which --
probably after, so the UI changes take effect later than any
post-processing of the !WizardPage and !WizardSettings that the associated
!WizardListeners need to perform.

Original issue: http://code.google.com/p/cjwizard/issues/detail?id=2

Scrolling the in the Wizard Panel?

I've ran into an issue where I have a Panel that extends WizardPanel that is too tall for displaying on the screen. I'm not a swing expert and i'm not too sure how to proceed. I was thinking i wrap my panel in a scroll view but i'm not sure if there's an easier solution that could be incorporated into the library. Thoughts on this?

WizardSettings.entrySet throws unsupported operating error

perhaps my understanding of it's function is, but I was under the impression that WizardSettings would contain the values of the data entered by the user. It looks like it's more for managing what wizard page to show next, however the test class seems to indicate otherwise.

Demo's are broken

Not sure what happened but all 3 demo's start up, then exit immediately after pressing the next button.

Enable a distributed source control on google code

From [email protected] on October 09, 2013 03:52:12

It could be very good to have the repository of code in a Distributed Source Control so other people can collaborate more easily in the project.

You have many alternatives and Google Code admit Mercurial and Git. Both are very good (my personal preference is mercurial).

If you put your code under DSC, external developers can make more changes, committing this changes into it's own local repository and when the functionality is finished try to push on your Google code repository or in another "test" repository so you can revise the changes. And finally this can other people more happy to help developing this fantastic library.

Original issue: http://code.google.com/p/cjwizard/issues/detail?id=12

Disable cancel method

We have:

  setPrevEnabled(boolean);
  setNextEnabled(boolean);
  setFinishEnabled(boolean);

Is it a good idea to add setCancelEnabled?

Some process can't be cancelled when they start, so a page may disable all buttons until it finish this not-to-be-cancel process. It isn't a good practice to have a process that can't be cancelled, but sometimes you can't avoid it, so it is needed.

Add commit method to WizardSettings

Now, we have a rollBack() methos in WizardSettings interface.

I think that we can also have a commit() method. For example if a page have an action that must be done only once, when you have done it you add a new settings value and commit the changes so although he goes back immediately after the action have been done and then forward again, you can know that the action is already done.

Is this a good idea?

Unespecified version for plugin maven-source-plugin in the pom.xml

The Travis CI have a warning (show bellow) telling that we haven't specified the version of maven-source-plugin. What version we used so we can fix it?

[WARNING]

[WARNING] Some problems were encountered while building the effective model for com.github.cjwizard:cjwizard:jar:1.0.0

[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ line 64, column 15

[WARNING]

[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.

[WARNING]

[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

[WARNING] 

Going "back" from a WizardPage that set "Finish" to be enabled does not disable Finish

From [email protected] on June 30, 2008 21:09:45

Reproduction:

  1. Run a Wizard through to a final page (eg: Page 3 in WizardTest)
  2. Step Back once the Finish button is enabled.
  3. Notice that the Finish button is enabled on a page where it was
    previously disabled.
  4. Note that this remains the case if a different branch is taken.

The "Finish" button should go back to being disabled on all pages by default.

Original issue: http://code.google.com/p/cjwizard/issues/detail?id=1

Documentation needed

We need actual documentation.

This is something I'm going to work on. I'm opening an issue so I can track my progress.

Example for more complex workflows?

Is there any example for optional steps, or tree like structures

For instance, if option A is check, the slide page should page A1, otherwise skip to page B

Who would like / will maintain the cjwizard project?

Hi everybody,

recently, there were a couple of issues and pull requests from @spyhunter99...

@stevesobol mentioned, that he took over the project from @creswick (#49).

That's good news for cjwizard :-)

Technically, I supported the project last year a little bit (https://github.com/cjwizard/cjwizard/releases) and helped to make it available via Bintray (https://bintray.com/cjwizard). I have also the necessary "permissions" for managing the organization in Github as well as in Bintray.

Personally, I don't use cjwizard at the moment, so I'm not that much interested in it right now.

Enough of the introduction...

-> Who would like to maintain the project?

I could help with the transition...

Best regards,
Peti

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.