View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.client.console.wizards.resources;
20  
21  import java.io.Serializable;
22  import org.apache.syncope.client.console.topology.TopologyNode;
23  import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal.ModalEvent;
24  import org.apache.syncope.client.console.wizards.BaseAjaxWizardBuilder;
25  import org.apache.wicket.PageReference;
26  import org.apache.wicket.ajax.AjaxRequestTarget;
27  
28  /**
29   * Modal window with Resource form.
30   *
31   * @param <T> model object type
32   */
33  public abstract class AbstractResourceWizardBuilder<T extends Serializable>
34          extends BaseAjaxWizardBuilder<Serializable> {
35  
36      private static final long serialVersionUID = 1734415311027284221L;
37  
38      public AbstractResourceWizardBuilder(final T modelObject, final PageReference pageRef) {
39          super(modelObject, pageRef);
40      }
41  
42      public static class CreateEvent extends ModalEvent {
43  
44          private static final long serialVersionUID = -4488921035707289039L;
45  
46          private final String key;
47  
48          private final String displayName;
49  
50          private final Serializable parent;
51  
52          private final TopologyNode.Kind kind;
53  
54          public CreateEvent(
55                  final String key,
56                  final String displayName,
57                  final TopologyNode.Kind kind,
58                  final Serializable parent,
59                  final AjaxRequestTarget target) {
60              super(target);
61              this.key = key;
62              this.displayName = displayName;
63              this.kind = kind;
64              this.parent = parent;
65          }
66  
67          public String getKey() {
68              return key;
69          }
70  
71          public String getDisplayName() {
72              return displayName;
73          }
74  
75          public TopologyNode.Kind getKind() {
76              return kind;
77          }
78  
79          public Serializable getParent() {
80              return parent;
81          }
82      }
83  }