Pre-selects project template in new project wizard. dev_j2ee-platform_bm3_Dec16_trunk
authormarkroth8@netbeans.org
Wed, 15 Dec 2004 21:54:05 +0000
changeset 5494fd89a9c9a063
parent 5493 7ad63069645a
child 5495 31596708d16c
Pre-selects project template in new project wizard.
j2ee.blueprints/src/org/netbeans/modules/j2ee/blueprints/ui/BluePrintsPanel.java
     1.1 --- a/j2ee.blueprints/src/org/netbeans/modules/j2ee/blueprints/ui/BluePrintsPanel.java	Wed Dec 15 21:51:11 2004 +0000
     1.2 +++ b/j2ee.blueprints/src/org/netbeans/modules/j2ee/blueprints/ui/BluePrintsPanel.java	Wed Dec 15 21:54:05 2004 +0000
     1.3 @@ -344,7 +344,16 @@
     1.4      private boolean navigating = false;
     1.5      private int lastSelectedIndex = -1;
     1.6      private Timer scrollTimer = null;
     1.7 -    
     1.8 +
     1.9 +    // Special constants that allow us to preselect a template in the new 
    1.10 +    // project wizard
    1.11 +    private static final String BUNDLE_PROPERTY_PREFIX = 
    1.12 +        "Blueprints"; // NOI18N
    1.13 +    private static final String PRESELECT_CATEGORY = 
    1.14 +        "PRESELECT_CATEGORY"; // NOI18N
    1.15 +    private static final String PRESELECT_TEMPLATE =
    1.16 +        "PRESELECT_TEMPLATE"; // NOI18N
    1.17 +
    1.18      public Category getSelectedCategory() {
    1.19          Object entry = entryCbx.getSelectedItem();
    1.20          if(!(entry instanceof Category)) {
    1.21 @@ -651,8 +660,7 @@
    1.22      }
    1.23      
    1.24      private void installExample() {
    1.25 -        String path = getExamplePath();
    1.26 -        performAction(OPEN_SAMPLE_ACTION, path);
    1.27 +        performAction(OPEN_SAMPLE_ACTION, "");
    1.28      }
    1.29      
    1.30      private String getExamplePath() {
    1.31 @@ -716,6 +724,9 @@
    1.32          if (a == null) {
    1.33              return false;
    1.34          }
    1.35 +        a.putValue(PRESELECT_CATEGORY, BUNDLE_PROPERTY_PREFIX + "/" // NOI18N
    1.36 +            + getSelectedCategory().getId(0));
    1.37 +        a.putValue(PRESELECT_TEMPLATE, getExamplePath());
    1.38          ActionEvent ae = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, 
    1.39              command);
    1.40          try {