This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 196526
Collapse All | Expand All

(-)a/j2ee.common/src/org/netbeans/modules/j2ee/common/method/MethodModel.java (-7 / +10 lines)
Lines 46-52 Link Here
46
46
47
import com.sun.source.tree.ExpressionTree;
47
import com.sun.source.tree.ExpressionTree;
48
import java.util.Collections;
48
import java.util.Collections;
49
import java.util.HashMap;
49
import java.util.List;
50
import java.util.List;
51
import java.util.Map;
50
import java.util.Set;
52
import java.util.Set;
51
import javax.lang.model.element.Modifier;
53
import javax.lang.model.element.Modifier;
52
import org.openide.util.Parameters;
54
import org.openide.util.Parameters;
Lines 244-252 Link Here
244
    public static final class Annotation {
246
    public static final class Annotation {
245
247
246
        private final String type;
248
        private final String type;
247
        private final List<? extends ExpressionTree> arguments;
249
        private final Map<String, Object> arguments;
248
250
249
        private Annotation(String type, List<? extends ExpressionTree> arguments) {
251
        private Annotation(String type, Map<String, Object> arguments) {
250
            this.type = type;
252
            this.type = type;
251
            this.arguments = arguments;
253
            this.arguments = arguments;
252
        }
254
        }
Lines 269-284 Link Here
269
         * Creates new instance of a model of {@code Annotation}
271
         * Creates new instance of a model of {@code Annotation}
270
         *
272
         *
271
         * @param type name of annotation type, fully qualified name must be used
273
         * @param type name of annotation type, fully qualified name must be used
272
         * @param arguments {@code List} of annotation arguments, for generation them see {@code GenerationUtils} class
274
         * @param arguments {@code Map<String, String>} of annotation arguments, key of the map determines
275
         * argument name and the maps value implies argument value
273
         * @throws {@code NullPointerException} if any of the parameters is {@code null}
276
         * @throws {@code NullPointerException} if any of the parameters is {@code null}
274
         * @throws {@code IllegalArgumentException} if the parameter type is not fully qualified
277
         * @throws {@code IllegalArgumentException} if the parameter type is not fully qualified
275
         * name of valid annotation
278
         * name of valid annotation
276
         * @return immutable model of {@code Annotation}
279
         * @return immutable model of {@code Annotation}
277
         */
280
         */
278
        public static Annotation create(String type, List<? extends ExpressionTree> arguments) {
281
        public static Annotation create(String type, Map<String, String> arguments) {
279
            Parameters.notNull("type", type);    //NOI18N
282
            Parameters.notNull("type", type);    //NOI18N
280
            Parameters.notNull("arguments", arguments); //NOI18N
283
            Parameters.notNull("arguments", arguments); //NOI18N
281
            return new MethodModel.Annotation(type, arguments);
284
            return new MethodModel.Annotation(type, new HashMap<String, Object>(arguments));
282
        }
285
        }
283
286
284
        // <editor-fold defaultstate="collapsed" desc="Annotation's getters">
287
        // <editor-fold defaultstate="collapsed" desc="Annotation's getters">
Lines 287-299 Link Here
287
            return type;
290
            return type;
288
        }
291
        }
289
292
290
        public List<? extends ExpressionTree> getArguments() {
293
        public Map<String, Object> getArguments() {
291
            return arguments;
294
            return arguments;
292
        }
295
        }
293
296
294
        // </editor-fold>
297
        // </editor-fold>
295
    }
298
    }
296
    
299
297
    // <editor-fold defaultstate="collapsed" desc="MethodModel's getters">
300
    // <editor-fold defaultstate="collapsed" desc="MethodModel's getters">
298
    
301
    
299
    /**
302
    /**
(-)a/j2ee.common/src/org/netbeans/modules/j2ee/common/method/MethodModelSupport.java (-1 / +8 lines)
Lines 46-51 Link Here
46
46
47
import com.sun.source.tree.AnnotationTree;
47
import com.sun.source.tree.AnnotationTree;
48
import com.sun.source.tree.BlockTree;
48
import com.sun.source.tree.BlockTree;
49
import java.util.Map;
49
import javax.lang.model.type.ArrayType;
50
import javax.lang.model.type.ArrayType;
50
import org.netbeans.api.java.source.CompilationController;
51
import org.netbeans.api.java.source.CompilationController;
51
import com.sun.source.tree.ExpressionTree;
52
import com.sun.source.tree.ExpressionTree;
Lines 236-242 Link Here
236
                if (annotation.getArguments() == null) { 
237
                if (annotation.getArguments() == null) { 
237
                    annotationTree = genUtils.createAnnotation(annotation.getType());
238
                    annotationTree = genUtils.createAnnotation(annotation.getType());
238
                } else {
239
                } else {
239
                    annotationTree = genUtils.createAnnotation(annotation.getType(), annotation.getArguments());
240
                    List<ExpressionTree> annotationArgs = new ArrayList<ExpressionTree>();
241
                    Iterator it = annotation.getArguments().entrySet().iterator();
242
                    while (it.hasNext()) {
243
                        Map.Entry pairs = (Map.Entry)it.next();
244
                        annotationArgs.add(genUtils.createAnnotationArgument((String) pairs.getKey(),pairs.getValue()));
245
                    }
246
                    annotationTree = genUtils.createAnnotation(annotation.getType(), annotationArgs);
240
                }
247
                }
241
                annotationList.add(annotationTree);
248
                annotationList.add(annotationTree);
242
            }
249
            }
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/action/AbstractMethodGenerator.java (-1 / +11 lines)
Lines 47-54 Link Here
47
import com.sun.source.tree.ClassTree;
47
import com.sun.source.tree.ClassTree;
48
import com.sun.source.tree.MethodTree;
48
import com.sun.source.tree.MethodTree;
49
import java.io.IOException;
49
import java.io.IOException;
50
import java.util.Collections;
50
import java.util.HashMap;
51
import java.util.HashMap;
51
import java.util.Map;
52
import java.util.Map;
53
import java.util.concurrent.Future;
54
import java.util.logging.Level;
55
import java.util.logging.Logger;
52
import javax.lang.model.element.ElementKind;
56
import javax.lang.model.element.ElementKind;
53
import javax.lang.model.element.Modifier;
57
import javax.lang.model.element.Modifier;
54
import javax.lang.model.element.TypeElement;
58
import javax.lang.model.element.TypeElement;
Lines 128-134 Link Here
128
     * Returns map of EJB interface class names, where keys are appropriate constants from {@link EntityAndSession}
132
     * Returns map of EJB interface class names, where keys are appropriate constants from {@link EntityAndSession}
129
     */
133
     */
130
    protected Map<String, String> getInterfaces() throws IOException {
134
    protected Map<String, String> getInterfaces() throws IOException {
131
        return ejbModule.getMetadataModel().runReadAction(new MetadataModelAction<EjbJarMetadata, Map<String, String>>() {
135
        Future futureResult = ejbModule.getMetadataModel().runReadActionWhenReady(new MetadataModelAction<EjbJarMetadata, Map<String, String>>() {
132
            public Map<String, String> run(EjbJarMetadata metadata) throws Exception {
136
            public Map<String, String> run(EjbJarMetadata metadata) throws Exception {
133
                EntityAndSession ejb = (EntityAndSession) metadata.findByEjbClass(ejbClass);
137
                EntityAndSession ejb = (EntityAndSession) metadata.findByEjbClass(ejbClass);
134
                Map<String, String> result = new HashMap<String, String>();
138
                Map<String, String> result = new HashMap<String, String>();
Lines 141-146 Link Here
141
                return result;
145
                return result;
142
            }
146
            }
143
        });
147
        });
148
        try {
149
            return (Map<String, String>) futureResult.get();
150
        } catch (Exception ex) {
151
            Logger.getLogger(AbstractMethodGenerator.class.getName()).log(Level.WARNING, null, ex);
152
            return Collections.<String, String>emptyMap();
153
        }
144
    }
154
    }
145
    
155
    
146
    private static String findCommonInterface(final String className1, final String className2) throws IOException {
156
    private static String findCommonInterface(final String className1, final String className2) throws IOException {
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/action/BusinessMethodGenerator.java (-5 / +8 lines)
Lines 144-156 Link Here
144
            addMethodToInterface(methodModelCopy, remote);
144
            addMethodToInterface(methodModelCopy, remote);
145
        }
145
        }
146
        
146
        
147
        // ejb class, add 'public' modifier, 'Override' annotation if required
147
        // ejb class
148
        List<MethodModel.Annotation> annotations;
148
        // add all specified annothations and join Override if has local, remote interfaces
149
        List<MethodModel.Annotation> annotations = new ArrayList<MethodModel.Annotation>();
150
        if (!methodModel.getAnnotations().isEmpty()) {
151
            annotations.addAll(methodModel.getAnnotations());
152
        }
149
        if ((generateLocal && local != null) || (generateRemote && remote != null)) {
153
        if ((generateLocal && local != null) || (generateRemote && remote != null)) {
150
            annotations = Collections.singletonList(MethodModel.Annotation.create("java.lang.Override")); //NOI18N
154
            annotations.add(MethodModel.Annotation.create("java.lang.Override")); //NOI18N
151
        } else {
152
            annotations = Collections.<MethodModel.Annotation>emptyList();
153
        }
155
        }
156
        // add 'public' modifier
154
        MethodModel methodModelCopy = MethodModel.create(
157
        MethodModel methodModelCopy = MethodModel.create(
155
                methodModel.getName(),
158
                methodModel.getName(),
156
                methodModel.getReturnType(),
159
                methodModel.getReturnType(),
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/api/codegeneration/SessionGenerator.java (-5 / +43 lines)
Lines 44-55 Link Here
44
44
45
package org.netbeans.modules.j2ee.ejbcore.api.codegeneration;
45
package org.netbeans.modules.j2ee.ejbcore.api.codegeneration;
46
46
47
import java.util.List;
48
import org.netbeans.modules.j2ee.common.method.MethodModel.Annotation;
47
import org.netbeans.modules.j2ee.core.api.support.java.GenerationUtils;
49
import org.netbeans.modules.j2ee.core.api.support.java.GenerationUtils;
48
import org.netbeans.modules.j2ee.ejbcore.EjbGenerationUtil;
50
import org.netbeans.modules.j2ee.ejbcore.EjbGenerationUtil;
49
import java.io.IOException;
51
import java.io.IOException;
52
import java.util.Collections;
50
import java.util.HashMap;
53
import java.util.HashMap;
51
import java.util.Map;
54
import java.util.Map;
55
import java.util.logging.Level;
52
import java.util.logging.Logger;
56
import java.util.logging.Logger;
57
import javax.lang.model.element.Modifier;
53
import org.netbeans.api.java.classpath.ClassPath;
58
import org.netbeans.api.java.classpath.ClassPath;
54
import org.netbeans.api.java.project.JavaProjectConstants;
59
import org.netbeans.api.java.project.JavaProjectConstants;
55
import org.netbeans.api.java.project.classpath.ProjectClassPathModifier;
60
import org.netbeans.api.java.project.classpath.ProjectClassPathModifier;
Lines 63-70 Link Here
63
import org.netbeans.api.project.libraries.Library;
68
import org.netbeans.api.project.libraries.Library;
64
import org.netbeans.api.project.libraries.LibraryManager;
69
import org.netbeans.api.project.libraries.LibraryManager;
65
import org.netbeans.modules.j2ee.common.J2eeProjectCapabilities;
70
import org.netbeans.modules.j2ee.common.J2eeProjectCapabilities;
71
import org.netbeans.modules.j2ee.common.method.MethodModel;
66
import org.netbeans.modules.j2ee.dd.api.ejb.AssemblyDescriptor;
72
import org.netbeans.modules.j2ee.dd.api.ejb.AssemblyDescriptor;
67
import org.netbeans.modules.j2ee.dd.api.ejb.ContainerTransaction;
73
import org.netbeans.modules.j2ee.dd.api.ejb.ContainerTransaction;
74
import org.netbeans.modules.j2ee.ejbcore.action.BusinessMethodGenerator;
75
import org.netbeans.modules.j2ee.ejbcore.ejb.wizard.session.TimerOptions;
68
import org.netbeans.modules.j2ee.ejbcore.naming.EJBNameOptions;
76
import org.netbeans.modules.j2ee.ejbcore.naming.EJBNameOptions;
69
import org.openide.filesystems.FileObject;
77
import org.openide.filesystems.FileObject;
70
import org.openide.filesystems.FileUtil;
78
import org.openide.filesystems.FileUtil;
Lines 103-108 Link Here
103
    private final boolean isSimplified;
111
    private final boolean isSimplified;
104
//    private final boolean hasBusinessInterface;
112
//    private final boolean hasBusinessInterface;
105
    private final boolean isXmlBased;
113
    private final boolean isXmlBased;
114
    private final TimerOptions timerOptions;
106
    
115
    
107
    // EJB naming options
116
    // EJB naming options
108
    private final EJBNameOptions ejbNameOptions;
117
    private final EJBNameOptions ejbNameOptions;
Lines 119-131 Link Here
119
128
120
    private final Map<String, String> templateParameters;
129
    private final Map<String, String> templateParameters;
121
130
122
    public static SessionGenerator create(String wizardTargetName, FileObject pkg, boolean hasRemote, boolean hasLocal, 
131
    public static SessionGenerator create(String wizardTargetName, FileObject pkg, boolean hasRemote, boolean hasLocal,
123
            String sessionType, boolean isSimplified, boolean hasBusinessInterface, boolean isXmlBased) {
132
            String sessionType, boolean isSimplified, boolean hasBusinessInterface, boolean isXmlBased, TimerOptions timerOptions) {
124
        return new SessionGenerator(wizardTargetName, pkg, hasRemote, hasLocal, sessionType, isSimplified, hasBusinessInterface, isXmlBased, false);
133
        return new SessionGenerator(wizardTargetName, pkg, hasRemote, hasLocal, sessionType, isSimplified, hasBusinessInterface, isXmlBased, timerOptions, false);
125
    } 
134
    }
126
    
135
    
127
    protected SessionGenerator(String wizardTargetName, FileObject pkg, boolean hasRemote, boolean hasLocal, 
136
    protected SessionGenerator(String wizardTargetName, FileObject pkg, boolean hasRemote, boolean hasLocal, 
128
            String sessionType, boolean isSimplified, boolean hasBusinessInterface, boolean isXmlBased, boolean isTest) {
137
            String sessionType, boolean isSimplified, boolean hasBusinessInterface, boolean isXmlBased, TimerOptions timerOptions, boolean isTest) {
129
        this.pkg = pkg;
138
        this.pkg = pkg;
130
        this.remotePkg = pkg;
139
        this.remotePkg = pkg;
131
        this.hasRemote = hasRemote;
140
        this.hasRemote = hasRemote;
Lines 149-154 Link Here
149
        this.templateParameters.put("package", packageName);
158
        this.templateParameters.put("package", packageName);
150
        this.templateParameters.put("localInterface", packageNameWithDot + localName);
159
        this.templateParameters.put("localInterface", packageNameWithDot + localName);
151
        this.templateParameters.put("remoteInterface", packageNameWithDot + remoteName);
160
        this.templateParameters.put("remoteInterface", packageNameWithDot + remoteName);
161
        // set timer options if available
162
        this.timerOptions = timerOptions;
152
        if (isTest) {
163
        if (isTest) {
153
            // set date, time and user to values used in goldenfiles
164
            // set date, time and user to values used in goldenfiles
154
            this.templateParameters.put("date", "{date}");
165
            this.templateParameters.put("date", "{date}");
Lines 260-265 Link Here
260
        if (hasLocal) {
271
        if (hasLocal) {
261
            GenerationUtils.createClass(EJB30_LOCAL, pkg, localName, null, templateParameters);
272
            GenerationUtils.createClass(EJB30_LOCAL, pkg, localName, null, templateParameters);
262
        }
273
        }
274
275
        // fill up the session bean with the timer method if needed
276
        if (timerOptions != null) {
277
            generateTimerMethodForBean(ejbClassFO, "myTimer", timerOptions);
278
        }
279
263
        return ejbClassFO;
280
        return ejbClassFO;
264
    }
281
    }
265
282
Lines 318-323 Link Here
318
    private void generateEJB30Xml() throws IOException {
335
    private void generateEJB30Xml() throws IOException {
319
        throw new UnsupportedOperationException("Method not implemented yet.");
336
        throw new UnsupportedOperationException("Method not implemented yet.");
320
    }
337
    }
338
339
    private void generateTimerMethodForBean(FileObject bean, String methodName, TimerOptions timerOptions) {
340
        try {
341
            MethodModel.Annotation annotation = MethodModel.Annotation.create(
342
                    "javax.ejb.Schedule", timerOptions.getTimerOptionsAsMap()); // NOI18N
343
            MethodModel method = MethodModel.create(
344
                    methodName,
345
                    "void", // NOI18N
346
                    "System.out.println(\"Timer event: \" + new java.util.Date());", // NOI18N
347
                    Collections.<MethodModel.Variable>emptyList(),
348
                    Collections.<String>emptyList(),
349
                    Collections.<Modifier>emptySet(), 
350
                    Collections.singletonList(annotation)
351
                    );
352
353
                BusinessMethodGenerator generator = BusinessMethodGenerator.create(packageNameWithDot + ejbClassName, bean);
354
                generator.generate(method, hasLocal, hasRemote);
355
        } catch (IOException ex) {
356
            Logger.getLogger(SessionGenerator.class.getName()).log(Level.SEVERE, null, ex);
357
        }
358
    }
321
    
359
    
322
      //TODO: RETOUCHE WS
360
      //TODO: RETOUCHE WS
323
//    /**
361
//    /**
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties (+17 lines)
Lines 56-61 Link Here
56
56
57
# wizard templates
57
# wizard templates
58
Templates/J2EE/Session=Session Bean
58
Templates/J2EE/Session=Session Bean
59
Templates/J2EE/TimerSession=Timer Session Bean
59
60
60
LBL_Remote=Remote
61
LBL_Remote=Remote
61
62
Lines 70-75 Link Here
70
LBL_Singleton=Singleton
71
LBL_Singleton=Singleton
71
72
72
LBL_SessionEJBWizardTitle=Session Bean
73
LBL_SessionEJBWizardTitle=Session Bean
74
LBL_TimerSessionEJBWizardTitle=Timer Session Bean
73
75
74
LBL_Interface=Create Interface\:
76
LBL_Interface=Create Interface\:
75
LBL_EJB_Name=EJB Name:
77
LBL_EJB_Name=EJB Name:
Lines 95-97 Link Here
95
ERR_NoRemoteInterfaceProjectMaven=<html>There is no suitable project available into which \
97
ERR_NoRemoteInterfaceProjectMaven=<html>There is no suitable project available into which \
96
    Remote interface could be stored. An open Maven based Java Class Library project is required.
98
    Remote interface could be stored. An open Maven based Java Class Library project is required.
97
LBL_In_Project=Remote in project:
99
LBL_In_Project=Remote in project:
100
LBL_Schedule=Method schedule:
101
LBL_ScheduleSecondLabel=second
102
LBL_ScheduleMinuteLabel=minute
103
LBL_ScheduleHourLabel=hour
104
LBL_ScheduleMonthLabel=month
105
LBL_ScheduleYearLabel=year
106
LBL_ScheduleDayOfWeekLabel=dayOfWeek
107
LBL_ScheduleDayOfMonthLabel=dayOfMonth
108
MN_ScheduleSecond=e
109
MN_ScheduleMinute=m
110
MN_ScheduleHour=u
111
MN_ScheduleMonth=t
112
MN_ScheduleYear=y
113
MN_ScheduleDayOfWeek=w
114
MN_ScheduleDayOfMonth=d
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/SessionEJBWizard.java (-9 / +19 lines)
Lines 58-64 Link Here
58
import org.openide.filesystems.FileObject;
58
import org.openide.filesystems.FileObject;
59
import org.netbeans.modules.j2ee.core.api.support.SourceGroups;
59
import org.netbeans.modules.j2ee.core.api.support.SourceGroups;
60
import org.netbeans.modules.j2ee.core.api.support.wizard.Wizards;
60
import org.netbeans.modules.j2ee.core.api.support.wizard.Wizards;
61
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
62
import org.netbeans.modules.j2ee.ejbcore.ejb.wizard.MultiTargetChooserPanel;
61
import org.netbeans.modules.j2ee.ejbcore.ejb.wizard.MultiTargetChooserPanel;
63
import org.openide.WizardDescriptor;
62
import org.openide.WizardDescriptor;
64
import org.openide.util.Exceptions;
63
import org.openide.util.Exceptions;
Lines 69-88 Link Here
69
 * @author Chris Webster
68
 * @author Chris Webster
70
 * @author Martin Adamek
69
 * @author Martin Adamek
71
 */
70
 */
72
public final class SessionEJBWizard implements WizardDescriptor.InstantiatingIterator{
71
public final class SessionEJBWizard implements WizardDescriptor.AsynchronousInstantiatingIterator {
73
72
74
    private WizardDescriptor.Panel[] panels;
73
    private WizardDescriptor.Panel[] panels;
75
    private int index = 0;
74
    private int index = 0;
76
    private SessionEJBWizardDescriptor ejbPanel;
75
    private SessionEJBWizardDescriptor ejbPanel;
77
    private WizardDescriptor wiz;
76
    private WizardDescriptor wiz;
77
    private TimerOptions timerOptions;
78
    private String resourceWizardName;
78
79
79
    public static SessionEJBWizard create () {
80
    public SessionEJBWizard(String resourceWizardName, TimerOptions timerOptions) {
80
        return new SessionEJBWizard ();
81
        this.resourceWizardName = resourceWizardName;
82
        this.timerOptions = timerOptions;
81
    }
83
    }
82
84
83
    public String name () {
85
    public static SessionEJBWizard createSession() {
84
    return NbBundle.getMessage (SessionEJBWizard.class,
86
        return new SessionEJBWizard("LBL_SessionEJBWizardTitle", null); //NOI18N
85
                     "LBL_SessionEJBWizardTitle");
87
    }
88
89
    public static SessionEJBWizard createTimerSession() {
90
        return new SessionEJBWizard("LBL_TimerSessionEJBWizardTitle", new TimerOptions()); //NOI18N
91
    }
92
93
    public String name() {
94
        return NbBundle.getMessage (SessionEJBWizard.class, resourceWizardName);
86
    }
95
    }
87
96
88
    public void uninitialize(WizardDescriptor wiz) {
97
    public void uninitialize(WizardDescriptor wiz) {
Lines 92-98 Link Here
92
        wiz = wizardDescriptor;
101
        wiz = wizardDescriptor;
93
        Project project = Templates.getProject(wiz);
102
        Project project = Templates.getProject(wiz);
94
        SourceGroup[] sourceGroups = SourceGroups.getJavaSourceGroups(project);
103
        SourceGroup[] sourceGroups = SourceGroups.getJavaSourceGroups(project);
95
        ejbPanel = new SessionEJBWizardDescriptor(project);
104
        ejbPanel = new SessionEJBWizardDescriptor(project, timerOptions);
96
        WizardDescriptor.Panel wizardDescriptorPanel = new MultiTargetChooserPanel(project, sourceGroups, ejbPanel, true);
105
        WizardDescriptor.Panel wizardDescriptorPanel = new MultiTargetChooserPanel(project, sourceGroups, ejbPanel, true);
97
106
98
        panels = new WizardDescriptor.Panel[] {wizardDescriptorPanel};
107
        panels = new WizardDescriptor.Panel[] {wizardDescriptorPanel};
Lines 113-119 Link Here
113
                ejbPanel.getSessionType(),
122
                ejbPanel.getSessionType(),
114
                isSimplified, 
123
                isSimplified, 
115
                true, // TODO: UI - add checkbox for creation of business interface
124
                true, // TODO: UI - add checkbox for creation of business interface
116
                !isSimplified // TODO: UI - add checkbox for option XML (not annotation) usage
125
                !isSimplified, // TODO: UI - add checkbox for option XML (not annotation) usage
126
                ejbPanel.getTimerOptions()
117
                );
127
                );
118
        FileObject result = null;
128
        FileObject result = null;
119
        try {
129
        try {
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/SessionEJBWizardDescriptor.java (-2 / +8 lines)
Lines 65-70 Link Here
65
    private SessionEJBWizardPanel wizardPanel;
65
    private SessionEJBWizardPanel wizardPanel;
66
    private final EJBNameOptions ejbNames;
66
    private final EJBNameOptions ejbNames;
67
    private final Project project;
67
    private final Project project;
68
    private final TimerOptions timerOptions;
68
    //TODO: RETOUCHE
69
    //TODO: RETOUCHE
69
//    private boolean isWaitingForScan = false;
70
//    private boolean isWaitingForScan = false;
70
    
71
    
Lines 72-79 Link Here
72
73
73
    private WizardDescriptor wizardDescriptor;
74
    private WizardDescriptor wizardDescriptor;
74
75
75
    public SessionEJBWizardDescriptor(Project project) {
76
    public SessionEJBWizardDescriptor(Project project, TimerOptions timerOptions) {
76
        this.ejbNames = new EJBNameOptions();
77
        this.ejbNames = new EJBNameOptions();
78
        this.timerOptions = timerOptions;
77
        this.project = project;
79
        this.project = project;
78
    }
80
    }
79
    
81
    
Lines 83-89 Link Here
83
    
85
    
84
    public java.awt.Component getComponent() {
86
    public java.awt.Component getComponent() {
85
        if (wizardPanel == null) {
87
        if (wizardPanel == null) {
86
            wizardPanel = new SessionEJBWizardPanel(project, this);
88
            wizardPanel = new SessionEJBWizardPanel(project, this, timerOptions);
87
            // add listener to events which could cause valid status to change
89
            // add listener to events which could cause valid status to change
88
        }
90
        }
89
        return wizardPanel;
91
        return wizardPanel;
Lines 191-196 Link Here
191
    public String getSessionType() {
193
    public String getSessionType() {
192
        return wizardPanel.getSessionType();
194
        return wizardPanel.getSessionType();
193
    }
195
    }
196
197
    public TimerOptions getTimerOptions() {
198
        return wizardPanel.getTimerOptions();
199
    }
194
    
200
    
195
    public boolean isFinishPanel() {
201
    public boolean isFinishPanel() {
196
        return isValid();
202
        return isValid();
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/SessionEJBWizardPanel.form (-35 / +250 lines)
Lines 20-63 Link Here
20
  <Layout>
20
  <Layout>
21
    <DimensionLayout dim="0">
21
    <DimensionLayout dim="0">
22
      <Group type="103" groupAlignment="0" attributes="0">
22
      <Group type="103" groupAlignment="0" attributes="0">
23
          <Component id="sessionTypeLabel" alignment="0" min="-2" max="-2" attributes="0"/>
24
          <Group type="102" alignment="0" attributes="0">
25
              <EmptySpace min="-2" max="-2" attributes="0"/>
26
              <Component id="statelessButton" min="-2" max="-2" attributes="0"/>
27
          </Group>
28
          <Group type="102" alignment="0" attributes="0">
29
              <EmptySpace min="-2" max="-2" attributes="0"/>
30
              <Component id="statefulButton" min="-2" max="-2" attributes="0"/>
31
          </Group>
32
          <Group type="102" alignment="0" attributes="0">
33
              <EmptySpace max="-2" attributes="0"/>
34
              <Component id="singletonButton" min="-2" max="-2" attributes="0"/>
35
          </Group>
36
          <Component id="interfaceLabel" alignment="0" min="-2" max="-2" attributes="0"/>
37
          <Component id="schedulePanel" alignment="0" max="32767" attributes="0"/>
23
          <Group type="102" attributes="0">
38
          <Group type="102" attributes="0">
39
              <EmptySpace max="-2" attributes="0"/>
24
              <Group type="103" groupAlignment="0" attributes="0">
40
              <Group type="103" groupAlignment="0" attributes="0">
25
                  <Component id="sessionTypeLabel" alignment="0" min="-2" max="-2" attributes="0"/>
41
                  <Component id="remoteCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
26
                  <Group type="102" alignment="0" attributes="0">
42
                  <Component id="localCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
27
                      <EmptySpace min="-2" max="-2" attributes="0"/>
28
                      <Component id="statelessButton" min="-2" max="-2" attributes="0"/>
29
                  </Group>
30
                  <Group type="102" alignment="0" attributes="0">
31
                      <EmptySpace min="-2" max="-2" attributes="0"/>
32
                      <Component id="statefulButton" min="-2" max="-2" attributes="0"/>
33
                  </Group>
34
                  <Group type="102" alignment="0" attributes="0">
35
                      <EmptySpace max="-2" attributes="0"/>
36
                      <Component id="singletonButton" min="-2" max="-2" attributes="0"/>
37
                  </Group>
38
                  <Component id="interfaceLabel" alignment="0" min="-2" max="-2" attributes="0"/>
39
                  <Group type="102" attributes="0">
40
                      <EmptySpace max="-2" attributes="0"/>
41
                      <Group type="103" groupAlignment="0" attributes="0">
42
                          <Group type="102" alignment="0" attributes="0">
43
                              <Component id="remoteCheckBox" min="-2" max="-2" attributes="0"/>
44
                              <EmptySpace min="6" pref="6" max="-2" attributes="0"/>
45
                              <Component id="inProjectCombo" pref="131" max="32767" attributes="0"/>
46
                          </Group>
47
                          <Group type="102" attributes="0">
48
                              <Component id="localCheckBox" min="-2" max="-2" attributes="0"/>
49
                              <EmptySpace pref="155" max="32767" attributes="0"/>
50
                          </Group>
51
                      </Group>
52
                  </Group>
53
              </Group>
43
              </Group>
54
              <EmptySpace max="-2" attributes="0"/>
44
              <EmptySpace max="-2" attributes="0"/>
45
              <Component id="inProjectCombo" pref="232" max="32767" attributes="0"/>
46
              <EmptySpace max="-2" attributes="0"/>
55
          </Group>
47
          </Group>
56
      </Group>
48
      </Group>
57
    </DimensionLayout>
49
    </DimensionLayout>
58
    <DimensionLayout dim="1">
50
    <DimensionLayout dim="1">
59
      <Group type="103" groupAlignment="0" attributes="0">
51
      <Group type="103" groupAlignment="0" attributes="0">
60
          <Group type="102" alignment="0" attributes="0">
52
          <Group type="102" attributes="0">
61
              <Component id="sessionTypeLabel" min="-2" max="-2" attributes="0"/>
53
              <Component id="sessionTypeLabel" min="-2" max="-2" attributes="0"/>
62
              <EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
54
              <EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
63
              <Component id="statelessButton" min="-2" max="-2" attributes="0"/>
55
              <Component id="statelessButton" min="-2" max="-2" attributes="0"/>
Lines 67-79 Link Here
67
              <Component id="singletonButton" min="-2" max="-2" attributes="0"/>
59
              <Component id="singletonButton" min="-2" max="-2" attributes="0"/>
68
              <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
60
              <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
69
              <Component id="interfaceLabel" min="-2" max="-2" attributes="0"/>
61
              <Component id="interfaceLabel" min="-2" max="-2" attributes="0"/>
70
              <EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
62
              <EmptySpace max="-2" attributes="0"/>
71
              <Component id="localCheckBox" min="-2" max="-2" attributes="0"/>
63
              <Group type="103" groupAlignment="1" attributes="0">
72
              <EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
64
                  <Group type="102" attributes="0">
73
              <Group type="103" groupAlignment="3" attributes="0">
65
                      <Component id="localCheckBox" min="-2" max="-2" attributes="0"/>
74
                  <Component id="remoteCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
66
                      <EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
75
                  <Component id="inProjectCombo" alignment="3" min="-2" max="-2" attributes="0"/>
67
                      <Component id="remoteCheckBox" min="-2" max="-2" attributes="0"/>
68
                  </Group>
69
                  <Component id="inProjectCombo" min="-2" pref="28" max="-2" attributes="0"/>
76
              </Group>
70
              </Group>
71
              <EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
72
              <Component id="schedulePanel" max="32767" attributes="0"/>
73
              <EmptySpace max="-2" attributes="0"/>
77
          </Group>
74
          </Group>
78
      </Group>
75
      </Group>
79
    </DimensionLayout>
76
    </DimensionLayout>
Lines 202-206 Link Here
202
    </Component>
199
    </Component>
203
    <Component class="javax.swing.JComboBox" name="inProjectCombo">
200
    <Component class="javax.swing.JComboBox" name="inProjectCombo">
204
    </Component>
201
    </Component>
202
    <Container class="javax.swing.JPanel" name="schedulePanel">
203
204
      <Layout>
205
        <DimensionLayout dim="0">
206
          <Group type="103" groupAlignment="0" attributes="0">
207
              <Group type="102" attributes="0">
208
                  <Group type="103" groupAlignment="0" attributes="0">
209
                      <Component id="scheduleLabel" min="-2" max="-2" attributes="0"/>
210
                      <Group type="102" alignment="0" attributes="0">
211
                          <EmptySpace max="-2" attributes="0"/>
212
                          <Group type="103" groupAlignment="0" attributes="0">
213
                              <Component id="scheduleSecondLabel" alignment="0" min="-2" max="-2" attributes="0"/>
214
                              <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
215
                                  <Group type="102" alignment="0" attributes="1">
216
                                      <Component id="scheduleHourLabel" min="-2" max="-2" attributes="0"/>
217
                                      <EmptySpace max="32767" attributes="0"/>
218
                                      <Component id="scheduleHourTextField" min="-2" pref="70" max="-2" attributes="0"/>
219
                                  </Group>
220
                                  <Group type="102" alignment="0" attributes="0">
221
                                      <Component id="scheduleMinuteLabel" min="-2" max="-2" attributes="0"/>
222
                                      <EmptySpace max="-2" attributes="0"/>
223
                                      <Group type="103" groupAlignment="0" attributes="0">
224
                                          <Component id="scheduleSecondTextField" alignment="0" min="-2" pref="70" max="-2" attributes="0"/>
225
                                          <Component id="scheduleMinuteTextField" alignment="0" min="-2" pref="70" max="-2" attributes="0"/>
226
                                      </Group>
227
                                  </Group>
228
                              </Group>
229
                          </Group>
230
                          <EmptySpace type="separate" max="-2" attributes="0"/>
231
                          <Group type="103" groupAlignment="0" attributes="0">
232
                              <Component id="scheduleMonthLabel" alignment="0" min="-2" max="-2" attributes="0"/>
233
                              <Component id="scheduleYearLabel" alignment="0" min="-2" max="-2" attributes="0"/>
234
                              <Component id="scheduleDayOfWeekLabel" alignment="0" min="-2" max="-2" attributes="0"/>
235
                              <Component id="scheduleDayOfMonthLabel" alignment="0" min="-2" max="-2" attributes="0"/>
236
                          </Group>
237
                          <EmptySpace max="-2" attributes="0"/>
238
                          <Group type="103" groupAlignment="0" attributes="0">
239
                              <Component id="scheduleYearTextField" min="-2" pref="70" max="-2" attributes="1"/>
240
                              <Component id="scheduleDayOfWeekTextField" min="-2" pref="70" max="-2" attributes="1"/>
241
                              <Component id="scheduleDayOfMonthTextField" alignment="0" min="-2" pref="70" max="-2" attributes="1"/>
242
                              <Component id="scheduleMonthTextField" alignment="0" min="-2" pref="70" max="-2" attributes="1"/>
243
                          </Group>
244
                      </Group>
245
                  </Group>
246
                  <EmptySpace pref="12" max="32767" attributes="0"/>
247
              </Group>
248
          </Group>
249
        </DimensionLayout>
250
        <DimensionLayout dim="1">
251
          <Group type="103" groupAlignment="0" attributes="0">
252
              <Group type="102" alignment="0" attributes="0">
253
                  <Component id="scheduleLabel" min="-2" max="-2" attributes="0"/>
254
                  <EmptySpace max="-2" attributes="0"/>
255
                  <Group type="103" groupAlignment="3" attributes="0">
256
                      <Component id="scheduleSecondLabel" alignment="3" min="-2" max="-2" attributes="0"/>
257
                      <Component id="scheduleSecondTextField" alignment="3" min="-2" max="-2" attributes="0"/>
258
                      <Component id="scheduleMonthLabel" alignment="3" min="-2" max="-2" attributes="0"/>
259
                      <Component id="scheduleMonthTextField" alignment="3" min="-2" max="-2" attributes="0"/>
260
                  </Group>
261
                  <EmptySpace max="-2" attributes="0"/>
262
                  <Group type="103" groupAlignment="3" attributes="0">
263
                      <Component id="scheduleMinuteLabel" alignment="3" min="-2" max="-2" attributes="0"/>
264
                      <Component id="scheduleMinuteTextField" alignment="3" min="-2" max="-2" attributes="0"/>
265
                      <Component id="scheduleYearLabel" alignment="3" min="-2" max="-2" attributes="0"/>
266
                      <Component id="scheduleYearTextField" alignment="3" min="-2" max="-2" attributes="0"/>
267
                  </Group>
268
                  <EmptySpace max="-2" attributes="0"/>
269
                  <Group type="103" groupAlignment="3" attributes="0">
270
                      <Component id="scheduleHourLabel" alignment="3" min="-2" max="-2" attributes="0"/>
271
                      <Component id="scheduleHourTextField" alignment="3" min="-2" max="-2" attributes="0"/>
272
                      <Component id="scheduleDayOfWeekLabel" alignment="3" min="-2" max="-2" attributes="0"/>
273
                      <Component id="scheduleDayOfWeekTextField" alignment="3" min="-2" max="-2" attributes="0"/>
274
                  </Group>
275
                  <EmptySpace max="-2" attributes="0"/>
276
                  <Group type="103" groupAlignment="3" attributes="0">
277
                      <Component id="scheduleDayOfMonthLabel" alignment="3" min="-2" max="-2" attributes="0"/>
278
                      <Component id="scheduleDayOfMonthTextField" alignment="3" min="-2" max="-2" attributes="0"/>
279
                  </Group>
280
              </Group>
281
          </Group>
282
        </DimensionLayout>
283
      </Layout>
284
      <SubComponents>
285
        <Component class="javax.swing.JLabel" name="scheduleLabel">
286
          <Properties>
287
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
288
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="LBL_Schedule" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
289
            </Property>
290
          </Properties>
291
        </Component>
292
        <Component class="javax.swing.JLabel" name="scheduleSecondLabel">
293
          <Properties>
294
            <Property name="displayedMnemonic" type="int" editor="org.netbeans.modules.i18n.form.FormI18nMnemonicEditor">
295
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="MN_ScheduleSecond" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
296
            </Property>
297
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
298
              <ComponentRef name="scheduleSecondTextField"/>
299
            </Property>
300
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
301
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="LBL_ScheduleSecondLabel" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
302
            </Property>
303
          </Properties>
304
        </Component>
305
        <Component class="javax.swing.JTextField" name="scheduleSecondTextField">
306
          <Properties>
307
            <Property name="text" type="java.lang.String" value="0" noResource="true"/>
308
          </Properties>
309
        </Component>
310
        <Component class="javax.swing.JLabel" name="scheduleMinuteLabel">
311
          <Properties>
312
            <Property name="displayedMnemonic" type="int" editor="org.netbeans.modules.i18n.form.FormI18nMnemonicEditor">
313
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="MN_ScheduleMinute" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
314
            </Property>
315
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
316
              <ComponentRef name="scheduleMinuteTextField"/>
317
            </Property>
318
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
319
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="LBL_ScheduleMinuteLabel" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
320
            </Property>
321
          </Properties>
322
        </Component>
323
        <Component class="javax.swing.JTextField" name="scheduleMinuteTextField">
324
          <Properties>
325
            <Property name="text" type="java.lang.String" value="*" noResource="true"/>
326
          </Properties>
327
        </Component>
328
        <Component class="javax.swing.JLabel" name="scheduleHourLabel">
329
          <Properties>
330
            <Property name="displayedMnemonic" type="int" editor="org.netbeans.modules.i18n.form.FormI18nMnemonicEditor">
331
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="MN_ScheduleHour" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
332
            </Property>
333
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
334
              <ComponentRef name="scheduleHourTextField"/>
335
            </Property>
336
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
337
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="LBL_ScheduleHourLabel" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
338
            </Property>
339
          </Properties>
340
        </Component>
341
        <Component class="javax.swing.JTextField" name="scheduleHourTextField">
342
          <Properties>
343
            <Property name="text" type="java.lang.String" value="9-17" noResource="true"/>
344
          </Properties>
345
        </Component>
346
        <Component class="javax.swing.JLabel" name="scheduleMonthLabel">
347
          <Properties>
348
            <Property name="displayedMnemonic" type="int" editor="org.netbeans.modules.i18n.form.FormI18nMnemonicEditor">
349
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="MN_ScheduleMonth" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
350
            </Property>
351
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
352
              <ComponentRef name="scheduleMonthTextField"/>
353
            </Property>
354
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
355
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="LBL_ScheduleMonthLabel" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
356
            </Property>
357
          </Properties>
358
        </Component>
359
        <Component class="javax.swing.JTextField" name="scheduleMonthTextField">
360
          <Properties>
361
            <Property name="text" type="java.lang.String" value="*" noResource="true"/>
362
          </Properties>
363
        </Component>
364
        <Component class="javax.swing.JLabel" name="scheduleYearLabel">
365
          <Properties>
366
            <Property name="displayedMnemonic" type="int" editor="org.netbeans.modules.i18n.form.FormI18nMnemonicEditor">
367
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="MN_ScheduleYear" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
368
            </Property>
369
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
370
              <ComponentRef name="scheduleYearTextField"/>
371
            </Property>
372
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
373
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="LBL_ScheduleYearLabel" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
374
            </Property>
375
          </Properties>
376
        </Component>
377
        <Component class="javax.swing.JTextField" name="scheduleYearTextField">
378
          <Properties>
379
            <Property name="text" type="java.lang.String" value="*" noResource="true"/>
380
          </Properties>
381
        </Component>
382
        <Component class="javax.swing.JLabel" name="scheduleDayOfWeekLabel">
383
          <Properties>
384
            <Property name="displayedMnemonic" type="int" editor="org.netbeans.modules.i18n.form.FormI18nMnemonicEditor">
385
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="MN_ScheduleDayOfWeek" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
386
            </Property>
387
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
388
              <ComponentRef name="scheduleDayOfWeekTextField"/>
389
            </Property>
390
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
391
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="LBL_ScheduleDayOfWeekLabel" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
392
            </Property>
393
          </Properties>
394
        </Component>
395
        <Component class="javax.swing.JTextField" name="scheduleDayOfWeekTextField">
396
          <Properties>
397
            <Property name="text" type="java.lang.String" value="Mon-Fri" noResource="true"/>
398
          </Properties>
399
        </Component>
400
        <Component class="javax.swing.JLabel" name="scheduleDayOfMonthLabel">
401
          <Properties>
402
            <Property name="displayedMnemonic" type="int" editor="org.netbeans.modules.i18n.form.FormI18nMnemonicEditor">
403
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="MN_ScheduleDayOfMonth" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
404
            </Property>
405
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
406
              <ComponentRef name="scheduleDayOfMonthTextField"/>
407
            </Property>
408
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
409
              <ResourceString bundle="org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle.properties" key="LBL_ScheduleDayOfMonthLabel" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
410
            </Property>
411
          </Properties>
412
        </Component>
413
        <Component class="javax.swing.JTextField" name="scheduleDayOfMonthTextField">
414
          <Properties>
415
            <Property name="text" type="java.lang.String" value="*" noResource="true"/>
416
          </Properties>
417
        </Component>
418
      </SubComponents>
419
    </Container>
205
  </SubComponents>
420
  </SubComponents>
206
</Form>
421
</Form>
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/SessionEJBWizardPanel.java (-28 / +198 lines)
Lines 78-89 Link Here
78
    private final ChangeListener listener;
78
    private final ChangeListener listener;
79
    private final Project project;
79
    private final Project project;
80
    private ComboBoxModel projectsList;
80
    private ComboBoxModel projectsList;
81
    private final TimerOptions timerOptions;
81
82
82
83
83
    /** Creates new form SingleEJBWizardPanel */
84
    /** Creates new form SingleEJBWizardPanel */
84
    public SessionEJBWizardPanel(Project project, ChangeListener changeListener) {
85
    public SessionEJBWizardPanel(Project project, ChangeListener changeListener, TimerOptions timerOptions) {
85
        this.listener = changeListener;
86
        this.listener = changeListener;
86
        this.project = project;
87
        this.project = project;
88
        this.timerOptions = timerOptions;
87
        initComponents();
89
        initComponents();
88
90
89
        J2eeProjectCapabilities projectCap = J2eeProjectCapabilities.forProject(project);
91
        J2eeProjectCapabilities projectCap = J2eeProjectCapabilities.forProject(project);
Lines 93-99 Link Here
93
                remoteCheckBox.setVisible(false);
95
                remoteCheckBox.setVisible(false);
94
                remoteCheckBox.setEnabled(false);
96
                remoteCheckBox.setEnabled(false);
95
            }
97
            }
98
            // enable Schedule section if Timer Session EJB, disable otherwise
99
            if (this.timerOptions == null) {
100
                schedulePanel.setVisible(false);
101
                schedulePanel.setEnabled(false);
102
            }  else {
103
                statefulButton.setEnabled(false);
104
                statefulButton.setVisible(false);
105
            }
96
        } else {
106
        } else {
107
            // hide whole Schedule section
108
            schedulePanel.setVisible(false);
109
            schedulePanel.setEnabled(false);
110
            // hide singleton radio button
97
            singletonButton.setVisible(false);
111
            singletonButton.setVisible(false);
98
            singletonButton.setEnabled(false);
112
            singletonButton.setEnabled(false);
99
            localCheckBox.setSelected(true);
113
            localCheckBox.setSelected(true);
Lines 199-204 Link Here
199
        localCheckBox = new javax.swing.JCheckBox();
213
        localCheckBox = new javax.swing.JCheckBox();
200
        singletonButton = new javax.swing.JRadioButton();
214
        singletonButton = new javax.swing.JRadioButton();
201
        inProjectCombo = new javax.swing.JComboBox();
215
        inProjectCombo = new javax.swing.JComboBox();
216
        schedulePanel = new javax.swing.JPanel();
217
        scheduleLabel = new javax.swing.JLabel();
218
        scheduleSecondLabel = new javax.swing.JLabel();
219
        scheduleSecondTextField = new javax.swing.JTextField();
220
        scheduleMinuteLabel = new javax.swing.JLabel();
221
        scheduleMinuteTextField = new javax.swing.JTextField();
222
        scheduleHourLabel = new javax.swing.JLabel();
223
        scheduleHourTextField = new javax.swing.JTextField();
224
        scheduleMonthLabel = new javax.swing.JLabel();
225
        scheduleMonthTextField = new javax.swing.JTextField();
226
        scheduleYearLabel = new javax.swing.JLabel();
227
        scheduleYearTextField = new javax.swing.JTextField();
228
        scheduleDayOfWeekLabel = new javax.swing.JLabel();
229
        scheduleDayOfWeekTextField = new javax.swing.JTextField();
230
        scheduleDayOfMonthLabel = new javax.swing.JLabel();
231
        scheduleDayOfMonthTextField = new javax.swing.JTextField();
202
232
203
        org.openide.awt.Mnemonics.setLocalizedText(sessionTypeLabel, org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_SessionType")); // NOI18N
233
        org.openide.awt.Mnemonics.setLocalizedText(sessionTypeLabel, org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_SessionType")); // NOI18N
204
234
Lines 223-255 Link Here
223
        singletonButton.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle").getString("MN_Singleton").charAt(0));
253
        singletonButton.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle").getString("MN_Singleton").charAt(0));
224
        singletonButton.setText(org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_Singleton")); // NOI18N
254
        singletonButton.setText(org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_Singleton")); // NOI18N
225
255
256
        org.openide.awt.Mnemonics.setLocalizedText(scheduleLabel, org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_Schedule")); // NOI18N
257
258
        scheduleSecondLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle").getString("MN_ScheduleSecond").charAt(0));
259
        scheduleSecondLabel.setLabelFor(scheduleSecondTextField);
260
        org.openide.awt.Mnemonics.setLocalizedText(scheduleSecondLabel, org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_ScheduleSecondLabel")); // NOI18N
261
262
        scheduleSecondTextField.setText("0"); // NOI18N
263
264
        scheduleMinuteLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle").getString("MN_ScheduleMinute").charAt(0));
265
        scheduleMinuteLabel.setLabelFor(scheduleMinuteTextField);
266
        org.openide.awt.Mnemonics.setLocalizedText(scheduleMinuteLabel, org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_ScheduleMinuteLabel")); // NOI18N
267
268
        scheduleMinuteTextField.setText("*"); // NOI18N
269
270
        scheduleHourLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle").getString("MN_ScheduleHour").charAt(0));
271
        scheduleHourLabel.setLabelFor(scheduleHourTextField);
272
        org.openide.awt.Mnemonics.setLocalizedText(scheduleHourLabel, org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_ScheduleHourLabel")); // NOI18N
273
274
        scheduleHourTextField.setText("9-17"); // NOI18N
275
276
        scheduleMonthLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle").getString("MN_ScheduleMonth").charAt(0));
277
        scheduleMonthLabel.setLabelFor(scheduleMonthTextField);
278
        org.openide.awt.Mnemonics.setLocalizedText(scheduleMonthLabel, org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_ScheduleMonthLabel")); // NOI18N
279
280
        scheduleMonthTextField.setText("*"); // NOI18N
281
282
        scheduleYearLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle").getString("MN_ScheduleYear").charAt(0));
283
        scheduleYearLabel.setLabelFor(scheduleYearTextField);
284
        org.openide.awt.Mnemonics.setLocalizedText(scheduleYearLabel, org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_ScheduleYearLabel")); // NOI18N
285
286
        scheduleYearTextField.setText("*"); // NOI18N
287
288
        scheduleDayOfWeekLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle").getString("MN_ScheduleDayOfWeek").charAt(0));
289
        scheduleDayOfWeekLabel.setLabelFor(scheduleDayOfWeekTextField);
290
        org.openide.awt.Mnemonics.setLocalizedText(scheduleDayOfWeekLabel, org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_ScheduleDayOfWeekLabel")); // NOI18N
291
292
        scheduleDayOfWeekTextField.setText("Mon-Fri"); // NOI18N
293
294
        scheduleDayOfMonthLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle").getString("MN_ScheduleDayOfMonth").charAt(0));
295
        scheduleDayOfMonthLabel.setLabelFor(scheduleDayOfMonthTextField);
296
        org.openide.awt.Mnemonics.setLocalizedText(scheduleDayOfMonthLabel, org.openide.util.NbBundle.getMessage(SessionEJBWizardPanel.class, "LBL_ScheduleDayOfMonthLabel")); // NOI18N
297
298
        scheduleDayOfMonthTextField.setText("*"); // NOI18N
299
300
        org.jdesktop.layout.GroupLayout schedulePanelLayout = new org.jdesktop.layout.GroupLayout(schedulePanel);
301
        schedulePanel.setLayout(schedulePanelLayout);
302
        schedulePanelLayout.setHorizontalGroup(
303
            schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
304
            .add(schedulePanelLayout.createSequentialGroup()
305
                .add(schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
306
                    .add(scheduleLabel)
307
                    .add(schedulePanelLayout.createSequentialGroup()
308
                        .addContainerGap()
309
                        .add(schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
310
                            .add(scheduleSecondLabel)
311
                            .add(schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
312
                                .add(org.jdesktop.layout.GroupLayout.LEADING, schedulePanelLayout.createSequentialGroup()
313
                                    .add(scheduleHourLabel)
314
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
315
                                    .add(scheduleHourTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
316
                                .add(org.jdesktop.layout.GroupLayout.LEADING, schedulePanelLayout.createSequentialGroup()
317
                                    .add(scheduleMinuteLabel)
318
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
319
                                    .add(schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
320
                                        .add(scheduleSecondTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
321
                                        .add(scheduleMinuteTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))))
322
                        .add(18, 18, 18)
323
                        .add(schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
324
                            .add(scheduleMonthLabel)
325
                            .add(scheduleYearLabel)
326
                            .add(scheduleDayOfWeekLabel)
327
                            .add(scheduleDayOfMonthLabel))
328
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
329
                        .add(schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
330
                            .add(scheduleYearTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
331
                            .add(scheduleDayOfWeekTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
332
                            .add(scheduleDayOfMonthTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
333
                            .add(scheduleMonthTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 70, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
334
                .addContainerGap(12, Short.MAX_VALUE))
335
        );
336
        schedulePanelLayout.setVerticalGroup(
337
            schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
338
            .add(schedulePanelLayout.createSequentialGroup()
339
                .add(scheduleLabel)
340
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
341
                .add(schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
342
                    .add(scheduleSecondLabel)
343
                    .add(scheduleSecondTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
344
                    .add(scheduleMonthLabel)
345
                    .add(scheduleMonthTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
346
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
347
                .add(schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
348
                    .add(scheduleMinuteLabel)
349
                    .add(scheduleMinuteTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
350
                    .add(scheduleYearLabel)
351
                    .add(scheduleYearTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
352
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
353
                .add(schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
354
                    .add(scheduleHourLabel)
355
                    .add(scheduleHourTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
356
                    .add(scheduleDayOfWeekLabel)
357
                    .add(scheduleDayOfWeekTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
358
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
359
                .add(schedulePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
360
                    .add(scheduleDayOfMonthLabel)
361
                    .add(scheduleDayOfMonthTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
362
        );
363
226
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
364
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
227
        this.setLayout(layout);
365
        this.setLayout(layout);
228
        layout.setHorizontalGroup(
366
        layout.setHorizontalGroup(
229
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
367
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
368
            .add(sessionTypeLabel)
230
            .add(layout.createSequentialGroup()
369
            .add(layout.createSequentialGroup()
370
                .addContainerGap()
371
                .add(statelessButton))
372
            .add(layout.createSequentialGroup()
373
                .addContainerGap()
374
                .add(statefulButton))
375
            .add(layout.createSequentialGroup()
376
                .addContainerGap()
377
                .add(singletonButton))
378
            .add(interfaceLabel)
379
            .add(schedulePanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
380
            .add(layout.createSequentialGroup()
381
                .addContainerGap()
231
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
382
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
232
                    .add(sessionTypeLabel)
383
                    .add(remoteCheckBox)
233
                    .add(layout.createSequentialGroup()
384
                    .add(localCheckBox))
234
                        .addContainerGap()
385
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
235
                        .add(statelessButton))
386
                .add(inProjectCombo, 0, 232, Short.MAX_VALUE)
236
                    .add(layout.createSequentialGroup()
237
                        .addContainerGap()
238
                        .add(statefulButton))
239
                    .add(layout.createSequentialGroup()
240
                        .addContainerGap()
241
                        .add(singletonButton))
242
                    .add(interfaceLabel)
243
                    .add(layout.createSequentialGroup()
244
                        .addContainerGap()
245
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
246
                            .add(layout.createSequentialGroup()
247
                                .add(remoteCheckBox)
248
                                .add(6, 6, 6)
249
                                .add(inProjectCombo, 0, 129, Short.MAX_VALUE))
250
                            .add(layout.createSequentialGroup()
251
                                .add(localCheckBox)
252
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 152, Short.MAX_VALUE)))))
253
                .addContainerGap())
387
                .addContainerGap())
254
        );
388
        );
255
        layout.setVerticalGroup(
389
        layout.setVerticalGroup(
Lines 264-275 Link Here
264
                .add(singletonButton)
398
                .add(singletonButton)
265
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
399
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
266
                .add(interfaceLabel)
400
                .add(interfaceLabel)
267
                .add(0, 0, 0)
401
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
268
                .add(localCheckBox)
402
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
269
                .add(0, 0, 0)
403
                    .add(layout.createSequentialGroup()
270
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
404
                        .add(localCheckBox)
271
                    .add(remoteCheckBox)
405
                        .add(2, 2, 2)
272
                    .add(inProjectCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
406
                        .add(remoteCheckBox))
407
                    .add(inProjectCombo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 28, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
408
                .add(24, 24, 24)
409
                .add(schedulePanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
410
                .addContainerGap())
273
        );
411
        );
274
412
275
        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle"); // NOI18N
413
        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/ejbcore/ejb/wizard/session/Bundle"); // NOI18N
Lines 289-294 Link Here
289
    private javax.swing.JLabel interfaceLabel;
427
    private javax.swing.JLabel interfaceLabel;
290
    private javax.swing.JCheckBox localCheckBox;
428
    private javax.swing.JCheckBox localCheckBox;
291
    private javax.swing.JCheckBox remoteCheckBox;
429
    private javax.swing.JCheckBox remoteCheckBox;
430
    private javax.swing.JLabel scheduleDayOfMonthLabel;
431
    private javax.swing.JTextField scheduleDayOfMonthTextField;
432
    private javax.swing.JLabel scheduleDayOfWeekLabel;
433
    private javax.swing.JTextField scheduleDayOfWeekTextField;
434
    private javax.swing.JLabel scheduleHourLabel;
435
    private javax.swing.JTextField scheduleHourTextField;
436
    private javax.swing.JLabel scheduleLabel;
437
    private javax.swing.JLabel scheduleMinuteLabel;
438
    private javax.swing.JTextField scheduleMinuteTextField;
439
    private javax.swing.JLabel scheduleMonthLabel;
440
    private javax.swing.JTextField scheduleMonthTextField;
441
    private javax.swing.JPanel schedulePanel;
442
    private javax.swing.JLabel scheduleSecondLabel;
443
    private javax.swing.JTextField scheduleSecondTextField;
444
    private javax.swing.JLabel scheduleYearLabel;
445
    private javax.swing.JTextField scheduleYearTextField;
292
    private javax.swing.ButtonGroup sessionStateButtons;
446
    private javax.swing.ButtonGroup sessionStateButtons;
293
    private javax.swing.JLabel sessionTypeLabel;
447
    private javax.swing.JLabel sessionTypeLabel;
294
    private javax.swing.JRadioButton singletonButton;
448
    private javax.swing.JRadioButton singletonButton;
Lines 316-321 Link Here
316
        return localCheckBox.isSelected();
470
        return localCheckBox.isSelected();
317
    }
471
    }
318
472
473
    public TimerOptions getTimerOptions() {
474
        if (timerOptions == null) {
475
            return null;
476
        } else {
477
            timerOptions.setTimerOptions(
478
                    scheduleSecondTextField.getText(),
479
                    scheduleMinuteTextField.getText(),
480
                    scheduleHourTextField.getText(),
481
                    scheduleMonthTextField.getText(),
482
                    scheduleYearTextField.getText(),
483
                    scheduleDayOfWeekTextField.getText(),
484
                    scheduleDayOfMonthTextField.getText());
485
            return timerOptions;
486
        }
487
    }
488
319
    public Project getRemoteInterfaceProject() {
489
    public Project getRemoteInterfaceProject() {
320
        if (projectsList == null) {
490
        if (projectsList == null) {
321
            return null;
491
            return null;
(-)7f89c86dbbb2 (+86 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2011 Sun Microsystems, Inc.
41
 */
42
43
package org.netbeans.modules.j2ee.ejbcore.ejb.wizard.session;
44
45
import java.util.HashMap;
46
import java.util.Map;
47
48
/**
49
 * Class which is holding information for creation of {@code @Schedule} annotation
50
 * 
51
 * @author Martin Fousek
52
 */
53
public final class TimerOptions {
54
55
    private Map<String, String> timerOptions = new HashMap<String, String>();
56
57
    /**
58
     * Get {@code Map} with entries of {@code @Schedule} annotation
59
     * @return {@code Map} of entries
60
     */
61
    public Map<String, String> getTimerOptionsAsMap() {
62
        return timerOptions;
63
    }
64
65
    /**
66
     * Set values into {@code Map} of {@code @Schedule} annotation entries
67
     * @param second see cron syntax for details
68
     * @param minute see cron syntax for details
69
     * @param hour see cron syntax for details
70
     * @param month see cron syntax for details
71
     * @param year see cron syntax for details
72
     * @param dayOfWeek see cron syntax for details
73
     * @param dayOfMonth see cron syntax for details
74
     */
75
    public void setTimerOptions(String second, String minute, String hour, String month,
76
            String year, String dayOfWeek, String dayOfMonth) {
77
        timerOptions.put("second", second);
78
        timerOptions.put("minute", minute);
79
        timerOptions.put("hour", hour);
80
        timerOptions.put("dayOfMonth", dayOfMonth);
81
        timerOptions.put("month", month);
82
        timerOptions.put("dayOfWeek", dayOfWeek);
83
        timerOptions.put("year", year);
84
    }
85
86
}
(-)7f89c86dbbb2 (+51 lines)
Added Link Here
1
<!--
2
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
4
Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
5
6
7
The contents of this file are subject to the terms of either the GNU
8
General Public License Version 2 only ("GPL") or the Common
9
Development and Distribution License("CDDL") (collectively, the
10
"License"). You may not use this file except in compliance with the
11
License. You can obtain a copy of the License at
12
http://www.netbeans.org/cddl-gplv2.html
13
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
14
specific language governing permissions and limitations under the
15
License.  When distributing the software, include this License Header
16
Notice in each file and include the License file at
17
nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
18
particular file as subject to the "Classpath" exception as provided
19
by Sun in the GPL Version 2 section of the License file that
20
accompanied this code. If applicable, add the following below the
21
License Header, with the fields enclosed by brackets [] replaced by
22
your own identifying information:
23
"Portions Copyrighted [year] [name of copyright owner]"
24
25
Contributor(s):
26
27
The Original Software is NetBeans. The Initial Developer of the Original
28
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
29
Microsystems, Inc. All Rights Reserved.
30
31
If you wish your version of this file to be governed by only the CDDL
32
or only the GPL Version 2, indicate your decision by adding
33
"[Contributor] elects to include this software in this distribution
34
under the [CDDL or GPL Version 2] license." If you do not indicate a
35
single choice of license, a recipient has the option to distribute
36
your version of this file under either the CDDL, the GPL Version 2 or
37
to extend the choice of license to its licensees as provided above.
38
However, if you add GPL Version 2 code and therefore, elected the GPL
39
Version 2 license, then the option applies only if the new code is
40
made subject to such option by the copyright holder.
41
-->
42
43
<html>
44
<head>
45
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
46
</head>
47
<BODY>
48
Creates a example of Session Enterprise JavaBean (EJB) component with used
49
Schedule annotation at sample method. This template creates the Java classes
50
for a single session bean and registers the bean in the EJB module's DD.
51
</BODY></HTML>
(-)a/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/resources/layer.xml (-1 / +11 lines)
Lines 270-282 Link Here
270
            <file name="Session">
270
            <file name="Session">
271
                <attr name="position" intvalue="100"/>
271
                <attr name="position" intvalue="100"/>
272
                <attr name="template" boolvalue="true"/>
272
                <attr name="template" boolvalue="true"/>
273
                <attr name="instantiatingIterator" methodvalue="org.netbeans.modules.j2ee.ejbcore.ejb.wizard.session.SessionEJBWizard.create"/>
273
                <attr name="instantiatingIterator" methodvalue="org.netbeans.modules.j2ee.ejbcore.ejb.wizard.session.SessionEJBWizard.createSession"/>
274
                <attr name="templateCategory" stringvalue="ejb-types"/>
274
                <attr name="templateCategory" stringvalue="ejb-types"/>
275
                <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/j2ee/ejbcore/resources/SessionEJB.html"/>
275
                <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/j2ee/ejbcore/resources/SessionEJB.html"/>
276
                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.j2ee.ejbcore.ejb.wizard.session.Bundle"/>
276
                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.j2ee.ejbcore.ejb.wizard.session.Bundle"/>
277
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/java/resources/class.gif"/>
277
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/java/resources/class.gif"/>
278
            </file>
278
            </file>
279
279
280
            <file name="TimerSession">
281
                <attr name="position" intvalue="120"/>
282
                <attr name="template" boolvalue="true"/>
283
                <attr name="instantiatingIterator" methodvalue="org.netbeans.modules.j2ee.ejbcore.ejb.wizard.session.SessionEJBWizard.createTimerSession"/>
284
                <attr name="templateCategory" stringvalue="ejb-types_3_1"/>
285
                <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/j2ee/ejbcore/resources/TimerSessionEJB.html"/>
286
                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.j2ee.ejbcore.ejb.wizard.session.Bundle"/>
287
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/java/resources/class.gif"/>
288
            </file>
289
280
            <file name="Message">
290
            <file name="Message">
281
                <attr name="position" intvalue="400"/>
291
                <attr name="position" intvalue="400"/>
282
                <attr name="template" boolvalue="true"/>
292
                <attr name="template" boolvalue="true"/>

Return to bug 196526