You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2015/03/27 16:27:30 UTC
svn commit: r1669604 [9/14] - in
/directory/studio/trunk/plugins/templateeditor: ./ resources/
resources/icons/ resources/templates/ src/ src/main/ src/main/java/
src/main/java/org/ src/main/java/org/apache/
src/main/java/org/apache/directory/ src/main...
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/TemplateIOException.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/TemplateIOException.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/TemplateIOException.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/TemplateIOException.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.parser;
+
+
+/**
+ * This exception can be raised when loading template file.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateIOException extends Exception
+{
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * Creates a new instance of TemplateIOException.
+ *
+ * @param message
+ * the message
+ */
+ public TemplateIOException( String message )
+ {
+ super( message );
+ }
+}
\ No newline at end of file
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/messages.properties?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/messages.properties (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/messages.properties Fri Mar 27 15:27:27 2015
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+TemplateIO.AttributeNotFoundOrEmpty=Unable to find attribute or attribute empty: ''{0}''.
+TemplateIO.ElementNotAllowedAtThisLevel=Element ''{0}'' is not allowed at this level in the document, only ''{1}'' or ''{2}'' elements are allowed.
+TemplateIO.FileIsNotAValidTemplateFile=The file does not seem to be a valid Template file.
+TemplateIO.InvalidIdAttribute=Invalid ID attribute: ''{0}''.
+TemplateIO.UnableToConvertStringToBoolean=Unable to convert this string to a boolean (''{0}'' or ''{1}''): ''{2}''.
+TemplateIO.UnableToConvertStringToInteger=Unable to convert this string to an integer: ''{0}''.
+TemplateIO.UnableToConvertStringToWidgetAlignmentValue=Unable to convert this string to a widget alignment value (''{0}'', ''{1}'', ''{2}'', ''{3}'', or ''{4}''): ''{5}''.
+TemplateIO.UnableToFindAnyElement=Unable to find any ''{0}'' element.
+TemplateIO.UnableToFindAnyXOrYElement=Unable to find any ''{0}'' or ''{1}'' element.
+TemplateIO.UnableToFindElement=Unable to find element: ''{0}''.
+TemplateIO.UnableToFindMandatoryAttribute=Unable to find mandatory attribute ''{0}'' in the widget ''{1}''.
+TemplateIO.UnknownWidget=Unknown widget: ''{0}''.
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/messages_de.properties?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/messages_de.properties (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/messages_de.properties Fri Mar 27 15:27:27 2015
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+TemplateIO.AttributeNotFoundOrEmpty=Attribut wurde nicht gefunden oder ist leer. ''{0}''.
+TemplateIO.ElementNotAllowedAtThisLevel=Element ''{0}'' ist nicht erlaubt an dieser Stelle im Dokument, nur ''{1}'' oder ''{2}'' Elemente sind erlaubt.
+TemplateIO.FileIsNotAValidTemplateFile=Die Datei scheint keine g\u00FCltige Template Datei zu sein.
+TemplateIO.InvalidIdAttribute =Ung\u00FCltiges ID Attribut: ''{0}''.
+TemplateIO.UnableToConvertStringToBoolean=Der String konnte nicht zu einem Wahrheitswert (Boolean) konvertiert werden (''{0}'' oder ''{1}''): ''{2}''
+TemplateIO.UnableToConvertStringToInteger=Der String konnte nicht zu einer Zahl (Integer) konvertiert werden: ''{0}''.
+TemplateIO.UnableToConvertStringToWidgetAlignmentValue=Der String konnte nicht in einen Ausrichtwert konvertiert werden (''{0}'', ''{1}'', ''{2}'', ''{3}'', oder ''{4}''): ''{5}''.
+TemplateIO.UnableToFindAnyElement =Kein ''{0}'' Element konnte gefunden werden.
+TemplateIO.UnableToFindAnyXOrYElement=Kein ''{0}'' or ''{1}'' Element konnte gefunden werden.
+TemplateIO.UnableToFindElement =Element ''{0}'' konnte nicht gefunden werden.
+TemplateIO.UnableToFindMandatoryAttribute=Pflichtattribute ''{0}'' in der Komponente ''{1}'' konnte nicht gefunden werden.
+TemplateIO.UnknownWidget =Unbekannte Komponente: ''{0}''.
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/messages_fr.properties?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/messages_fr.properties (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/parser/messages_fr.properties Fri Mar 27 15:27:27 2015
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+TemplateIO.AttributeNotFoundOrEmpty=Impossible de trouver l''attribut ou l''attribut est vide : ''{0}''.
+TemplateIO.ElementNotAllowedAtThisLevel=L''\u00E9lement ''{0}'' n'est pas autoris\u00E9 \u00E8 ce niveau dans le document, seuls les \u00E9l\u00E9ments ''{1}'' ou ''{2}'' sont autoris\u00E9s.
+TemplateIO.FileIsNotAValidTemplateFile=Le fichier ne semble pas \u00EAtre un fichier de mod\u00E8le valide.
+TemplateIO.InvalidIdAttribute=Attribute ID invalide : ''{0}''.
+TemplateIO.UnableToConvertStringToBoolean=Impossible de convertir cette cha\u00EEne de caract\u00E8res en un bool\u00E9en : (''{0}'' ou ''{1}''): ''{2}''.
+TemplateIO.UnableToConvertStringToInteger=Impossible de convertir cette cha\u00EEne de caract\u00E8res en un entier : ''{0}''.
+TemplateIO.UnableToConvertStringToWidgetAlignmentValue=Impossible de convertir cette cha\u00EEne de caract\u00E8res en une valeur d'alignement d'\u00E9l\u00E9ment graphique (''{0}'', ''{1}'', ''{2}'', ''{3}'', or ''{4}''): ''{5}''.
+TemplateIO.UnableToFindAnyElement=Impossible de trouver un \u00E9lement ''{0}''.
+TemplateIO.UnableToFindAnyXOrYElement=Impossible de trouver un \u00E9l\u00E9ment''{0}'' ou ''{1}''.
+TemplateIO.UnableToFindElement=Impossible de trouver l''\u00E9l\u00E9ment: ''{0}''.
+TemplateIO.UnableToFindMandatoryAttribute=Impossible de trouver l''attribut obligatoire ''{0}'' dans l''\u00E9lement graphique ''{1}''.
+TemplateIO.UnknownWidget=El\u00E9ment graphique inconnu: ''{0}''.
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/AbstractTemplateWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/AbstractTemplateWidget.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/AbstractTemplateWidget.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/AbstractTemplateWidget.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,288 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * This class implements an abstract widget for templates.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public abstract class AbstractTemplateWidget implements TemplateWidget
+{
+ /** The parent element*/
+ private TemplateWidget parent;
+
+ /** The children list */
+ private List<TemplateWidget> children;
+
+ /** The attribute type the widget is associated with */
+ private String attributeType;
+
+ /** How the widget is positioned horizontally */
+ private WidgetAlignment horizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;
+
+ /** How the widget is positioned vertically */
+ private WidgetAlignment verticalAlignment = DEFAULT_VERTICAL_ALIGNMENT;
+
+ /**
+ * The flag to know whether the widget will be made wide
+ * enough to fit the remaining horizontal space.
+ */
+ private boolean grabExcessHorizontalSpace = DEFAULT_GRAB_EXCESS_HORIZONTAL_SPACE;
+
+ /**
+ * The flag to know whether the widget will be made wide
+ * enough to fit the remaining vertical space.
+ */
+ private boolean grabExcessVerticalSpace = DEFAULT_GRAB_EXCESS_VERTICAL_SPACE;
+
+ /** The number of columns that the widget will take up */
+ private int horizontalSpan = DEFAULT_HORIZONTAL_SPAN;
+
+ /** The number of rows that the widget will take up */
+ private int verticalSpan = DEFAULT_VERTICAL_SPAN;
+
+ /** The preferred width */
+ private int width = DEFAULT_SIZE;
+
+ /** The preferred height*/
+ private int height = DEFAULT_SIZE;
+
+
+ /**
+ * Creates a new instance of AbstractTemplateWidget.
+ *
+ * @param parent
+ * the parent element
+ */
+ public AbstractTemplateWidget( TemplateWidget parent )
+ {
+ this.parent = parent;
+ children = new ArrayList<TemplateWidget>();
+
+ if ( parent != null )
+ {
+ parent.addChild( this );
+ }
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean addChild( TemplateWidget widget )
+ {
+ return children.add( widget );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getAttributeType()
+ {
+ return attributeType;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<TemplateWidget> getChildren()
+ {
+ return children;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getImageHeight()
+ {
+ return height;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public WidgetAlignment getHorizontalAlignment()
+ {
+ return horizontalAlignment;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getHorizontalSpan()
+ {
+ return horizontalSpan;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public TemplateWidget getParent()
+ {
+ return parent;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public WidgetAlignment getVerticalAlignment()
+ {
+ return verticalAlignment;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getVerticalSpan()
+ {
+ return verticalSpan;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getImageWidth()
+ {
+ return width;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean hasChildren()
+ {
+ return children.size() > 0;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isGrabExcessHorizontalSpace()
+ {
+ return grabExcessHorizontalSpace;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isGrabExcessVerticalSpace()
+ {
+ return grabExcessVerticalSpace;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAttributeType( String attributeType )
+ {
+ this.attributeType = attributeType;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setGrabExcessHorizontalSpace( boolean grabExcessHorizontalSpace )
+ {
+ this.grabExcessHorizontalSpace = grabExcessHorizontalSpace;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setGrabExcessVerticalSpace( boolean grabExcessVerticalSpace )
+ {
+ this.grabExcessVerticalSpace = grabExcessVerticalSpace;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setImageHeight( int height )
+ {
+ this.height = height;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setHorizontalAlignment( WidgetAlignment horizontalAlignment )
+ {
+ this.horizontalAlignment = horizontalAlignment;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setHorizontalSpan( int horizontalSpan )
+ {
+ this.horizontalSpan = horizontalSpan;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setVerticalAlignment( WidgetAlignment verticalAlignment )
+ {
+ this.verticalAlignment = verticalAlignment;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setVerticalSpan( int verticalSpan )
+ {
+ this.verticalSpan = verticalSpan;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setImageWidth( int width )
+ {
+ this.width = width;
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateCheckbox.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateCheckbox.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateCheckbox.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateCheckbox.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,163 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+/**
+ * This class implements a template checkbox.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateCheckbox extends AbstractTemplateWidget
+{
+ /** The default enabled value */
+ public static boolean DEFAULT_ENABLED = true;
+
+ /** The default enabled value */
+ public static String DEFAULT_LABEL = ""; //$NON-NLS-1$
+
+ /** The default checked value value */
+ public static String DEFAULT_CHECKED_VALUE = null;
+
+ /** The default unchecked value value */
+ public static String DEFAULT_UNCHECKED_VALUE = null;
+
+ /** The label associated with the checkbox */
+ private String label = DEFAULT_LABEL;
+
+ /** The enabled flag */
+ private boolean enabled = DEFAULT_ENABLED;
+
+ /** The value when the checkbox is checked */
+ private String checkedValue = DEFAULT_CHECKED_VALUE;
+
+ /** The value when the checkbox is unchecked */
+ private String uncheckedValue = DEFAULT_UNCHECKED_VALUE;
+
+
+ /**
+ * Creates a new instance of TemplateCheckbox.
+ *
+ * @param parent
+ * the parent element
+ */
+ public TemplateCheckbox( TemplateWidget parent )
+ {
+ super( parent );
+ }
+
+
+ /**
+ * Get the value when the checkbox is checked.
+ *
+ * @return
+ * the value when the checkbox is checked
+ */
+ public String getCheckedValue()
+ {
+ return checkedValue;
+ }
+
+
+ /**
+ * Gets the label.
+ *
+ * @return
+ * the label
+ */
+ public String getLabel()
+ {
+ return label;
+ }
+
+
+ /**
+ * Gets the value when the checkbox is not checked.
+ *
+ * @return
+ * the value when the checkbox is not checked
+ */
+ public String getUncheckedValue()
+ {
+ return uncheckedValue;
+ }
+
+
+ /**
+ * Indicates if the the checkbox is enabled.
+ *
+ * @return
+ * <code>true</code> if the checkbox is enabled,
+ * <code>false</code> if the checkbox is disabled
+ */
+ public boolean isEnabled()
+ {
+ return enabled;
+ }
+
+
+ /**
+ * Sets the value when the checkbox is checked.
+ *
+ * @param checkedValue
+ * the value
+ */
+ public void setCheckedValue( String checkedValue )
+ {
+ this.checkedValue = checkedValue;
+ }
+
+
+ /**
+ * Enables or disables the checkbox.
+ *
+ * @param enabled
+ * <code>true</code> if the checkbox is enabled,
+ * <code>false</code> if the checkbox is disabled
+ */
+ public void setEnabled( boolean enabled )
+ {
+ this.enabled = enabled;
+ }
+
+
+ /**
+ * Sets the label.
+ *
+ * @param label
+ * the label
+ */
+ public void setLabel( String label )
+ {
+ this.label = label;
+ }
+
+
+ /**
+ * Sets the value when the checkbox is not checked.
+ *
+ * @param uncheckedValue
+ * the value
+ */
+ public void setUncheckedValue( String uncheckedValue )
+ {
+ this.uncheckedValue = uncheckedValue;
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateComposite.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateComposite.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateComposite.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateComposite.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+/**
+ * This class implements a template composite.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateComposite extends AbstractTemplateWidget
+{
+ /** The default number of columns value */
+ public static int DEFAULT_NUMBER_OF_COLUMNS = 1;
+
+ /** The default equal columns value */
+ public static boolean DEFAULT_EQUAL_COLUMNS = false;
+
+ /** The number of columns of the layout */
+ private int numberOfColumns = DEFAULT_NUMBER_OF_COLUMNS;
+
+ /** The flag indicating if all columns are equal in width size */
+ private boolean equalColumns = DEFAULT_EQUAL_COLUMNS;
+
+
+ /**
+ * Creates a new instance of TemplateComposite.
+ *
+ * @param parent
+ * the parent element
+ */
+ public TemplateComposite( TemplateWidget parent )
+ {
+ super( parent );
+ }
+
+
+ /**
+ * Gets the number of columns.
+ *
+ * @return
+ * the number of columns
+ */
+ public int getNumberOfColumns()
+ {
+ return numberOfColumns;
+ }
+
+
+ /**
+ * Indicates if the columns are equals in width.
+ *
+ * @return
+ * <code>true</code> if the columns are equals in width,
+ * <code>false</code> if not
+ */
+ public boolean isEqualColumns()
+ {
+ return equalColumns;
+ }
+
+
+ /**
+ * Sets the flag that indicates if the columns are equals in width.
+ *
+ * @param equalColumns
+ * the flag that indicates if the columns are equals in width
+ */
+ public void setEqualColumns( boolean equalColumns )
+ {
+ this.equalColumns = equalColumns;
+ }
+
+
+ /**
+ * Sets the number of columns.
+ *
+ * @param numberOfColumns
+ * the number of columns
+ */
+ public void setNumberOfColumns( int numberOfColumns )
+ {
+ this.numberOfColumns = numberOfColumns;
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateDate.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateDate.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateDate.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateDate.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+/**
+ * This class implements a template link.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateDate extends AbstractTemplateWidget
+{
+ /** The default format value */
+ public static String DEFAULT_FORMAT = null;
+
+ /** The default show edit button value */
+ public static boolean DEFAULT_SHOW_EDIT_BUTTON = true;
+
+ /** The format value */
+ private String format = DEFAULT_FORMAT;
+
+ /** The flag which indicates if an "<em>Edit...</em>" button should be shown */
+ private boolean showEditButton = DEFAULT_SHOW_EDIT_BUTTON;
+
+
+ /**
+ * Creates a new instance of TemplateLink.
+ *
+ * @param parent
+ * the parent element
+ */
+ public TemplateDate( TemplateWidget parent )
+ {
+ super( parent );
+ }
+
+
+ /**
+ * Gets the format.
+ *
+ * @return
+ * the format
+ */
+ public String getFormat()
+ {
+ return format;
+ }
+
+
+ /**
+ * Indicates if an "<em>Edit...</em>" button should be shown.
+ *
+ * @return
+ * <code>true</code> if an "<em>Edit...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public boolean isShowEditButton()
+ {
+ return showEditButton;
+ }
+
+
+ /**
+ * Sets the format.
+ *
+ * @param format
+ * the format
+ */
+ public void setFormat( String format )
+ {
+ this.format = format;
+ }
+
+
+ /**
+ * Sets the flag which indicates if an "<em>Edit...</em>" button should
+ * be shown.
+ *
+ * @param showEditButton
+ * <code>true</code> if a "<em>Edit...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public void setShowEditButton( boolean showEditButton )
+ {
+ this.showEditButton = showEditButton;
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateFileChooser.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateFileChooser.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateFileChooser.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateFileChooser.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,248 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+import java.util.HashSet;
+import java.util.Set;
+
+
+/**
+ * This class implements a template file chooser.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateFileChooser extends AbstractTemplateWidget
+{
+ /** The default icon value */
+ public static String DEFAULT_ICON = null;
+
+ /** The default show save icon value */
+ public static boolean DEFAULT_SHOW_ICON = true;
+
+ /** The default show save as button value */
+ public static boolean DEFAULT_SHOW_SAVE_AS_BUTTON = true;
+
+ /** The default show clear button value */
+ public static boolean DEFAULT_SHOW_CLEAR_BUTTON = true;
+
+ /** The default show browse button value */
+ public static boolean DEFAULT_SHOW_BROWSE_BUTTON = true;
+
+ /** The icon */
+ private String icon = DEFAULT_ICON;
+
+ /** The set of extensions for the file */
+ private Set<String> extensions = new HashSet<String>();
+
+ /** The flag which indicates if an should be shown */
+ private boolean showIcon = DEFAULT_SHOW_ICON;
+
+ /** The flag which indicates if a "<em>Save As...</em>" button should be shown */
+ private boolean showSaveAsButton = DEFAULT_SHOW_SAVE_AS_BUTTON;
+
+ /** The flag which indicates if a "<em>Clear</em>" button should be shown */
+ private boolean showClearButton = DEFAULT_SHOW_CLEAR_BUTTON;
+
+ /** The flag which indicates if a "<em>Browse...</em>" button should be shown */
+ private boolean showBrowseButton = DEFAULT_SHOW_BROWSE_BUTTON;
+
+
+ /**
+ * Creates a new instance of TemplateFileChooser.
+ *
+ * @param parent
+ * the parent element
+ */
+ public TemplateFileChooser( TemplateWidget parent )
+ {
+ super( parent );
+ }
+
+
+ /**
+ * Adds an extension.
+ *
+ * @param extension
+ * the extension
+ * @return
+ * <code>true</code> if the template file chooser did not already
+ * contain the specified element.
+ */
+ public boolean addExtension( String extension )
+ {
+ return extensions.add( extension );
+ }
+
+
+ /**
+ * Gets the extensions.
+ *
+ * @return
+ * the extensions
+ */
+ public Set<String> getExtensions()
+ {
+ return extensions;
+ }
+
+
+ /**
+ * Gets the icon.
+ *
+ * @return
+ * the icon
+ */
+ public String getIcon()
+ {
+ return icon;
+ }
+
+
+ /**
+ * Indicates if a "<em>Browse...</em>" button should be shown.
+ *
+ * @return
+ * <code>true</code> if a "<em>Browse...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public boolean isShowBrowseButton()
+ {
+ return showBrowseButton;
+ }
+
+
+ /**
+ * Indicates if a "<em>Clear</em>" button should be shown.
+ *
+ * @return
+ * <code>true</code> if a "<em>Clear</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public boolean isShowClearButton()
+ {
+ return showClearButton;
+ }
+
+
+ /**
+ * Indicates if an icon should be shown.
+ *
+ * @return
+ * <code>true</code> if an icon should be shown,
+ * <code>false</code> if not.
+ */
+ public boolean isShowIcon()
+ {
+ return showIcon;
+ }
+
+
+ /**
+ * Indicates if a "<em>Save As...</em>" button should be shown.
+ *
+ * @return
+ * <code>true</code> if a "<em>Save As...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public boolean isShowSaveAsButton()
+ {
+ return showSaveAsButton;
+ }
+
+
+ /**
+ * Set the extensions.
+ *
+ * @param extensions
+ * the extensions
+ */
+ public void setExtensions( Set<String> extensions )
+ {
+ this.extensions = extensions;
+ }
+
+
+ /**
+ * Sets the icon.
+ *
+ * @param icon
+ * the icon
+ */
+ public void setIcon( String icon )
+ {
+ this.icon = icon;
+ }
+
+
+ /**
+ * Sets the flag which indicates if a "<em>Browse...</em>" button should
+ * be shown.
+ *
+ * @param showBrowseButton
+ * <code>true</code> if a "<em>Browse...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public void setShowBrowseButton( boolean showBrowseButton )
+ {
+ this.showBrowseButton = showBrowseButton;
+ }
+
+
+ /**
+ * Sets the flag which indicates if a "<em>Clear</em>" button should
+ * be shown.
+ *
+ * @param showClearButton
+ * <code>true</code> if a "<em>Clear</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public void setShowClearButton( boolean showClearButton )
+ {
+ this.showClearButton = showClearButton;
+ }
+
+
+ /**
+ * Sets the flag which indicates if an icon should be shown.
+ *
+ * @param showIcon
+ * <code>true</code> if an icon should be shown,
+ * <code>false</code> if not.
+ */
+ public void setShowIcon( boolean showIcon )
+ {
+ this.showIcon = showIcon;
+ }
+
+
+ /**
+ * Sets the flag which indicates if a "<em>Save As...</em>" button should
+ * be shown.
+ *
+ * @param showSaveAsButton
+ * <code>true</code> if a "<em>Save As...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public void setShowSaveAsButton( boolean showSaveAsButton )
+ {
+ this.showSaveAsButton = showSaveAsButton;
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateForm.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateForm.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateForm.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateForm.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+/**
+ * This class implements a template form.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateForm extends AbstractTemplateWidget
+{
+ /**
+ * Creates a new instance of TemplateForm.
+ */
+ public TemplateForm()
+ {
+ // A template form has no parent
+ super( null );
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateImage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateImage.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateImage.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateImage.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,224 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+/**
+ * This class implements a template image.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateImage extends AbstractTemplateWidget
+{
+ /** The default show save as button value */
+ public static String DEFAULT_IMAGE_DATA = null;
+
+ /** The default show save as button value */
+ public static boolean DEFAULT_SHOW_SAVE_AS_BUTTON = true;
+
+ /** The default show clear button value */
+ public static boolean DEFAULT_SHOW_CLEAR_BUTTON = true;
+
+ /** The default show browse button value */
+ public static boolean DEFAULT_SHOW_BROWSE_BUTTON = true;
+
+ /** The image data */
+ private String imageData = DEFAULT_IMAGE_DATA;
+
+ /** The flag which indicates if a "<em>Save As...</em>" button should be shown */
+ private boolean showSaveAsButton = DEFAULT_SHOW_SAVE_AS_BUTTON;
+
+ /** The flag which indicates if a "<em>Clear</em>" button should be shown */
+ private boolean showClearButton = DEFAULT_SHOW_CLEAR_BUTTON;
+
+ /** The flag which indicates if a "<em>Browse...</em>" button should be shown */
+ private boolean showBrowseButton = DEFAULT_SHOW_BROWSE_BUTTON;
+
+ /** The width of the image */
+ private int imageWidth = TemplateWidget.DEFAULT_SIZE;
+
+ /** The height of the image */
+ private int imageHeight = TemplateWidget.DEFAULT_SIZE;
+
+
+ /**
+ * Creates a new instance of TemplateImage.
+ *
+ * @param parent
+ * the parent element
+ */
+ public TemplateImage( TemplateWidget parent )
+ {
+ super( parent );
+ }
+
+
+ /**
+ * Gets the height of the image.
+ *
+ * @return
+ * the height of the image
+ */
+ public int getImageHeight()
+ {
+ return imageHeight;
+ }
+
+
+ /**
+ * Gets the image data.
+ *
+ * @return
+ * the image data
+ */
+ public String getImageData()
+ {
+ return imageData;
+ }
+
+
+ /**
+ * Gets the width of the image.
+ *
+ * @return
+ * the width of the image
+ */
+ public int getImageWidth()
+ {
+ return imageWidth;
+ }
+
+
+ /**
+ * Indicates if a "<em>Browse...</em>" button should be shown.
+ *
+ * @return
+ * <code>true</code> if a "<em>Browse...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public boolean isShowBrowseButton()
+ {
+ return showBrowseButton;
+ }
+
+
+ /**
+ * Indicates if a "<em>Clear</em>" button should be shown.
+ *
+ * @return
+ * <code>true</code> if a "<em>Clear</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public boolean isShowClearButton()
+ {
+ return showClearButton;
+ }
+
+
+ /**
+ * Indicates if a "<em>Save As...</em>" button should be shown.
+ *
+ * @return
+ * <code>true</code> if a "<em>Save As...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public boolean isShowSaveAsButton()
+ {
+ return showSaveAsButton;
+ }
+
+
+ /**
+ * Sets the height of the image.
+ *
+ * @param imageHeight
+ * height of the image
+ */
+ public void setImageHeight( int imageHeight )
+ {
+ this.imageHeight = imageHeight;
+ }
+
+
+ /**
+ * Sets the image data.
+ *
+ * @param imageData
+ * the image data
+ */
+ public void setImageData( String imageData )
+ {
+ this.imageData = imageData;
+ }
+
+
+ /**
+ * Sets the flag which indicates if a "<em>Browse...</em>" button should
+ * be shown.
+ *
+ * @param showBrowseButton
+ * <code>true</code> if a "<em>Browse...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public void setShowBrowseButton( boolean showBrowseButton )
+ {
+ this.showBrowseButton = showBrowseButton;
+ }
+
+
+ /**
+ * Sets the flag which indicates if a "<em>Clear</em>" button should
+ * be shown.
+ *
+ * @param showClearButton
+ * <code>true</code> if a "<em>Clear</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public void setShowClearButton( boolean showClearButton )
+ {
+ this.showClearButton = showClearButton;
+ }
+
+
+ /**
+ * Sets the flag which indicates if a "<em>Save As...</em>" button should
+ * be shown.
+ *
+ * @param showSaveAsButton
+ * <code>true</code> if a "<em>Save As...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public void setShowSaveAsButton( boolean showSaveAsButton )
+ {
+ this.showSaveAsButton = showSaveAsButton;
+ }
+
+
+ /**
+ * Sets the width of the image.
+ *
+ * @param imageWidth
+ * the width of the image
+ */
+ public void setImageWidth( int imageWidth )
+ {
+ this.imageWidth = imageWidth;
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateLabel.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateLabel.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateLabel.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateLabel.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+/**
+ * This class implements a template checkbox.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateLabel extends AbstractTemplateWidget
+{
+ /** The default value value */
+ public static String DEFAULT_VALUE = null;
+
+ /** The default show browse button value */
+ public static int DEFAULT_NUMBER_OF_ROWS = 1;
+
+ /** The default dollar sign is new line value */
+ public static boolean DEFAULT_DOLLAR_SIGN_IS_NEW_LINE = false;
+
+ /** The label value */
+ private String value = DEFAULT_VALUE;
+
+ /** The number of rows */
+ private int numberOfRows = DEFAULT_NUMBER_OF_ROWS;
+
+ /** The flag which indicates if dollar sign ('$') is to be interpreted as a new line */
+ private boolean dollarSignIsNewLine = DEFAULT_DOLLAR_SIGN_IS_NEW_LINE;
+
+
+ /**
+ * Creates a new instance of TemplateLabel.
+ *
+ * @param parent
+ * the parent element
+ */
+ public TemplateLabel( TemplateWidget parent )
+ {
+ super( parent );
+ }
+
+
+ /**
+ * Gets the number of rows.
+ *
+ * @return
+ * the number of rows
+ */
+ public int getNumberOfRows()
+ {
+ return numberOfRows;
+ }
+
+
+ /**
+ * Gets the value.
+ *
+ * @return
+ * the value
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+
+ /**
+ * Indicates if dollar sign ('$') is to be interpreted as a new line.
+ *
+ * @return
+ * <code>true</code> if dollar sign ('$') is to be interpreted as a new line,
+ * <code>false</code> if not
+ */
+ public boolean isDollarSignIsNewLine()
+ {
+ return dollarSignIsNewLine;
+ }
+
+
+ /**
+ * Sets the flag which indicates if dollar sign ('$') is to be interpreted as a new line.
+ *
+ * @param dollarSignIsNewLine
+ * <code>true</code> if dollar sign ('$') is to be interpreted as a new line,
+ * <code>false</code> if not
+ */
+ public void setDollarSignIsNewLine( boolean dollarSignIsNewLine )
+ {
+ this.dollarSignIsNewLine = dollarSignIsNewLine;
+ }
+
+
+ /**
+ * Sets the number of rows.
+ *
+ * @param numberOfRows
+ * the number of rows
+ */
+ public void setNumberOfRows( int numberOfRows )
+ {
+ this.numberOfRows = numberOfRows;
+ }
+
+
+ /**
+ * Sets the value.
+ *
+ * @param value
+ * the value
+ */
+ public void setValue( String value )
+ {
+ this.value = value;
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateLink.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateLink.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateLink.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateLink.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+/**
+ * This class implements a template link.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateLink extends AbstractTemplateWidget
+{
+ /** The default value value */
+ public static String DEFAULT_VALUE = null;
+
+ /** The label value */
+ private String value = DEFAULT_VALUE;
+
+
+ /**
+ * Creates a new instance of TemplateLink.
+ *
+ * @param parent
+ * the parent element
+ */
+ public TemplateLink( TemplateWidget parent )
+ {
+ super( parent );
+ }
+
+
+ /**
+ * Gets the value.
+ *
+ * @return
+ * the value
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+
+ /**
+ * Sets the value.
+ *
+ * @param value
+ * the value
+ */
+ public void setValue( String value )
+ {
+ this.value = value;
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateListbox.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateListbox.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateListbox.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateListbox.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * This class implements a template checkbox.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateListbox extends AbstractTemplateWidget
+{
+ /** The default show browse button value */
+ public static boolean DEFAULT_MULTIPLE_SELECTION = true;
+
+ /** The default enabled value */
+ public static boolean DEFAULT_ENABLED = true;
+
+ /** The enabled flag */
+ private boolean enabled = DEFAULT_ENABLED;
+
+ /** The flag which indicates if the listbox allows multiple selection */
+ private boolean multipleSelection = DEFAULT_MULTIPLE_SELECTION;
+
+ /** The list of value items */
+ private List<ValueItem> items = new ArrayList<ValueItem>();
+
+
+ /**
+ * Creates a new instance of TemplateListbox.
+ *
+ * @param parent
+ * the parent element
+ */
+ public TemplateListbox( TemplateWidget parent )
+ {
+ super( parent );
+ }
+
+
+ /**
+ * Adds a value.
+ *
+ * @param value
+ * the value
+ * @return
+ * <code>true</code> if the listbox did not already
+ * contain the specified element.
+ */
+ public boolean addValue( ValueItem value )
+ {
+ return items.add( value );
+ }
+
+
+ /**
+ * Gets the items.
+ *
+ * @return
+ * the items
+ */
+ public List<ValueItem> getItems()
+ {
+ return items;
+ }
+
+
+ /**
+ * Indicates if the the listbox is enabled.
+ *
+ * @return
+ * <code>true</code> if the listbox is enabled,
+ * <code>false</code> if the listbox is disabled
+ */
+ public boolean isEnabled()
+ {
+ return enabled;
+ }
+
+
+ /**
+ * Indicates if the listbox allows multiple selection.
+ *
+ * @return
+ * <code>true</code> if the listbox allows multiple selection,
+ * <code>false</code> if not.
+ */
+ public boolean isMultipleSelection()
+ {
+ return multipleSelection;
+ }
+
+
+ /**
+ * Enables or disables the listbox.
+ *
+ * @param enabled
+ * <code>true</code> if the listbox is enabled,
+ * <code>false</code> if the listbox is disabled
+ */
+ public void setEnabled( boolean enabled )
+ {
+ this.enabled = enabled;
+ }
+
+
+ /**
+ * Sets the items.
+ *
+ * @param items
+ * the items
+ */
+ public void setItems( List<ValueItem> items )
+ {
+ this.items = items;
+ }
+
+
+ /**
+ * Sets the flag which indicates if the listbox allows multiple selection.
+ *
+ * @param multipleSelection
+ * <code>true</code> if the listbox allows multiple selection,
+ * <code>false</code> if not.
+ */
+ public void setMultipleSelection( boolean multipleSelection )
+ {
+ this.multipleSelection = multipleSelection;
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplatePassword.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplatePassword.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplatePassword.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplatePassword.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+/**
+ * This class implements a template checkbox.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplatePassword extends AbstractTemplateWidget
+{
+ /** The default hidden value */
+ public static boolean DEFAULT_HIDDEN = true;
+
+ /** The default show edit button value */
+ public static boolean DEFAULT_SHOW_EDIT_BUTTON = true;
+
+ /** The default show password checkbox value */
+ public static boolean DEFAULT_SHOW_PASSWORD_CHECKBOX = true;
+
+ /** The flag which indicated if the password should be hidden */
+ private boolean hidden = DEFAULT_HIDDEN;
+
+ /** The flag which indicated if a "<em>Edit...</em>" button should be shown */
+ private boolean showEditButton = DEFAULT_SHOW_EDIT_BUTTON;
+
+ /** The flag which indicated if a "<em>Show Password</em>" checkbox should be shown */
+ private boolean showShowPasswordCheckbox = DEFAULT_SHOW_PASSWORD_CHECKBOX;
+
+
+ /**
+ * Creates a new instance of TemplatePassword.
+ *
+ * @param parent
+ * the parent element
+ */
+ public TemplatePassword( TemplateWidget parent )
+ {
+ super( parent );
+ }
+
+
+ /**
+ * Indicates if the password should be displayed hidden
+ * ("••••") or not.
+ *
+ * @return
+ * <code>true</code> if should be displayed hidden
+ * ("••••"), <code>false</code> if not.
+ */
+ public boolean isHidden()
+ {
+ return hidden;
+ }
+
+
+ /**
+ * Indicates if a "<em>Edit...</em>" button should be shown.
+ *
+ * @return
+ * <code>true</code> if a "<em>Edit...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public boolean isShowEditButton()
+ {
+ return showEditButton;
+ }
+
+
+ /**
+ * Indicates if a "<em>Show Password</em>" checkbox should be shown.
+ *
+ * @return
+ * <code>true</code> if a "<em>Show Password</em>" checkbox should be
+ * shown, <code>false</code> if not.
+ */
+ public boolean isShowShowPasswordCheckbox()
+ {
+ return showShowPasswordCheckbox;
+ }
+
+
+ /**
+ * Sets the flag which indicates if the password should be displayed hidden
+ * ("••••") or not.
+ *
+ * @param showBrowseButton
+ * <code>true</code> if a "<em>Change...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public void setHidden( boolean hidden )
+ {
+ this.hidden = hidden;
+ }
+
+
+ /**
+ * Sets the flag which indicates if a "<em>Edit...</em>" button should
+ * be shown.
+ *
+ * @param showEditButton
+ * <code>true</code> if a "<em>Edit...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public void setShowEditButton( boolean showEditButton )
+ {
+ this.showEditButton = showEditButton;
+ }
+
+
+ /**
+ * Sets the flag which indicated if a "<em>Show Password</em>" checkbox
+ * should be shown.
+ *
+ * @param showShowPasswordCheckbox
+ * <code>true</code> if a "<em>Show Password</em>" checkbox should
+ * be shown,
+ * <code>false</code> if not.
+ */
+ public void setShowShowPasswordCheckbox( boolean showShowPasswordCheckbox )
+ {
+ this.showShowPasswordCheckbox = showShowPasswordCheckbox;
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateRadioButtons.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateRadioButtons.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateRadioButtons.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateRadioButtons.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * This class implements templates radio buttons.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateRadioButtons extends AbstractTemplateWidget
+{
+ /** The default enabled value */
+ public static boolean DEFAULT_ENABLED = true;
+
+ /** The enable flag */
+ private boolean enabled = DEFAULT_ENABLED;
+
+ /** The list of buttons */
+ private List<ValueItem> buttons = new ArrayList<ValueItem>();
+
+
+ /**
+ * Creates a new instance of TemplateRadioButtons.
+ *
+ * @param parent
+ * the parent element
+ */
+ public TemplateRadioButtons( TemplateWidget parent )
+ {
+ super( parent );
+ }
+
+
+ /**
+ * Adds a button.
+ *
+ * @param button
+ * the button
+ * @return
+ * <code>true</code> if the radio buttons did not already
+ * contain the specified element.
+ */
+ public boolean addButton( ValueItem button )
+ {
+ return buttons.add( button );
+ }
+
+
+ /**
+ * Gets the buttons.
+ *
+ * @return
+ * the buttons
+ */
+ public List<ValueItem> getButtons()
+ {
+ return buttons;
+ }
+
+
+ /**
+ * Indicates if the the checkbox is enabled.
+ *
+ * @return
+ * <code>true</code> if the checkbox is enabled,
+ * <code>false</code> if the checkbox is disabled
+ */
+ public boolean isEnabled()
+ {
+ return enabled;
+ }
+
+
+ /**
+ * Sets the buttons.
+ *
+ * @param buttons
+ * the buttons
+ */
+ public void setButtons( List<ValueItem> buttons )
+ {
+ this.buttons = buttons;
+ }
+
+
+ /**
+ * Enables or disables the checkbox.
+ *
+ * @param enabled
+ * <code>true</code> if the checkbox is enabled,
+ * <code>false</code> if the checkbox is disabled
+ */
+ public void setEnabled( boolean enabled )
+ {
+ this.enabled = enabled;
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateSection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateSection.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateSection.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateSection.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,224 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+/**
+ * This class implements a template section.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateSection extends AbstractTemplateWidget
+{
+ /** The default number of columns value */
+ public static int DEFAULT_NUMBER_OF_COLUMNS = 1;
+
+ /** The default equals columns value */
+ public static boolean DEFAULT_EQUAL_COLUMNS = false;
+
+ /** The default expandable value */
+ public static boolean DEFAULT_EXPANDABLE = false;
+
+ /** The default expanded value */
+ public static boolean DEFAULT_EXPANDED = true;
+
+ /** The default title value */
+ public static String DEFAULT_TITLE = null;
+
+ /** The default description value */
+ public static String DEFAULT_DESCRIPTION = null;
+
+ /** The number of columns of the layout */
+ private int numberOfColumns = DEFAULT_NUMBER_OF_COLUMNS;
+
+ /** The flag indicating if all columns are equal in width size */
+ private boolean equalColumns = DEFAULT_EQUAL_COLUMNS;
+
+ /** The flag indicating if the section is expandable */
+ private boolean expandable = DEFAULT_EXPANDABLE;
+
+ /** The flag indicating if the section is expanded */
+ private boolean expanded = DEFAULT_EXPANDED;
+
+ /** The title */
+ private String title = DEFAULT_TITLE;
+
+ /** The description */
+ private String description = DEFAULT_DESCRIPTION;
+
+
+ /**
+ * Creates a new instance of TemplateSection.
+ *
+ * @param parent
+ * the parent element
+ */
+ public TemplateSection( TemplateWidget parent )
+ {
+ super( parent );
+ }
+
+
+ /**
+ * Gets the description.
+ *
+ * @return
+ * the description
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+
+ /**
+ * Gets the number of columns.
+ *
+ * @return
+ * the number of columns
+ */
+ public int getNumberOfColumns()
+ {
+ return numberOfColumns;
+ }
+
+
+ /**
+ * Gets the title.
+ *
+ * @return
+ * the title
+ */
+ public String getTitle()
+ {
+ return title;
+ }
+
+
+ /**
+ * Indicates if the columns are equals in width.
+ *
+ * @return
+ * <code>true</code> if the columns are equals in width,
+ * <code>false</code> if not
+ */
+ public boolean isEqualColumns()
+ {
+ return equalColumns;
+ }
+
+
+ /**
+ * Indicates if the section is expandable.
+ *
+ * @return
+ * <code>true</code> if the section is expandable,
+ * <code>false</code> if not
+ */
+ public boolean isExpandable()
+ {
+ return expandable;
+ }
+
+
+ /**
+ * Indicates if the section is expanded.
+ *
+ * @return
+ * <code>true</code> if the section is expanded,
+ * <code>false</code> if not
+ */
+ public boolean isExpanded()
+ {
+ return expanded;
+ }
+
+
+ /**
+ * Sets the description.
+ *
+ * @param description
+ * the description
+ */
+ public void setDescription( String description )
+ {
+ this.description = description;
+ }
+
+
+ /**
+ * Sets the flag that indicates if the columns are equals in width.
+ *
+ * @param equalColumns
+ * the flag that indicates if the columns are equals in width
+ */
+ public void setEqualColumns( boolean equalColumns )
+ {
+ this.equalColumns = equalColumns;
+ }
+
+
+ /**
+ * Sets the flag that indicates if the section is expandable.
+ *
+ * @param expandable
+ * the flag that indicates if the section is expandable
+ */
+ public void setExpandable( boolean expandable )
+ {
+ this.expandable = expandable;
+ }
+
+
+ /**
+ * Sets the flag that indicates if the section is expanded.
+ *
+ * @param expanded
+ * the flag that indicates if the section is expanded
+ */
+ public void setExpanded( boolean expanded )
+ {
+ this.expanded = expanded;
+ }
+
+
+ /**
+ * Sets the number of columns.
+ *
+ * @param numberOfColumns
+ * the number of columns
+ */
+ public void setNumberOfColumns( int numberOfColumns )
+ {
+ this.numberOfColumns = numberOfColumns;
+ }
+
+
+ /**
+ * Sets the title.
+ *
+ * @param title
+ * the title
+ */
+ public void setTitle( String title )
+ {
+ this.title = title;
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateSpinner.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateSpinner.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateSpinner.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateSpinner.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,191 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+/**
+ * This class implements a template spinner.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateSpinner extends AbstractTemplateWidget
+{
+ /** The default minimum value */
+ public static int DEFAULT_MINIMUM = Integer.MIN_VALUE;
+
+ /** The default maximum value */
+ public static int DEFAULT_MAXIMUM = Integer.MAX_VALUE;
+
+ /** The default increment value */
+ public static int DEFAULT_INCREMENT = 1;
+
+ /** The default page increment value */
+ public static int DEFAULT_PAGE_INCREMENT = 10;
+
+ /** The default digits value */
+ public static int DEFAULT_DIGITS = 0;
+
+ /** The minimum value */
+ private int minimum = DEFAULT_MINIMUM;
+
+ /** The maximum value */
+ private int maximum = DEFAULT_MAXIMUM;
+
+ /** The increment */
+ private int increment = DEFAULT_INCREMENT;
+
+ /** The page increment */
+ private int pageIncrement = DEFAULT_PAGE_INCREMENT;
+
+ /** The number of decimal places */
+ private int digits = DEFAULT_DIGITS;
+
+
+ /**
+ * Creates a new instance of TemplateSpinner.
+ *
+ * @param parent
+ * the parent element
+ */
+ public TemplateSpinner( TemplateWidget parent )
+ {
+ super( parent );
+ }
+
+
+ /**
+ * Gets the increment.
+ *
+ * @return
+ * the increment
+ */
+ public int getIncrement()
+ {
+ return increment;
+ }
+
+
+ /**
+ * Gets the maximum.
+ *
+ * @return
+ * the maximum
+ */
+ public int getMaximum()
+ {
+ return maximum;
+ }
+
+
+ /**
+ * Gets the minimum.
+ *
+ * @return
+ * the minimum
+ */
+ public int getMinimum()
+ {
+ return minimum;
+ }
+
+
+ /**
+ * Gets the page increment.
+ *
+ * @return
+ * the page increment
+ */
+ public int getPageIncrement()
+ {
+ return pageIncrement;
+ }
+
+
+ /**
+ * Sets the increment.
+ *
+ * @param increment
+ * the increment
+ */
+ public void setIncrement( int increment )
+ {
+ this.increment = increment;
+ }
+
+
+ /**
+ * Sets the maximum.
+ *
+ * @param maximum
+ * the maximum
+ */
+ public void setMaximum( int maximum )
+ {
+ this.maximum = maximum;
+ }
+
+
+ /**
+ * Sets the minimum.
+ *
+ * @param minimum
+ * the minimum
+ */
+ public void setMinimum( int minimum )
+ {
+ this.minimum = minimum;
+ }
+
+
+ /**
+ * Sets the page increment.
+ *
+ * @param pageIncrement
+ * the page increment
+ */
+ public void setPageIncrement( int pageIncrement )
+ {
+ this.pageIncrement = pageIncrement;
+ }
+
+
+ /**
+ * Sets the number of decimal places.
+ *
+ * @param digits
+ * the number of decimal places
+ */
+ public void setDigits( int digits )
+ {
+ this.digits = digits;
+ }
+
+
+ /**
+ * Gets the number of decimal places.
+ *
+ * @return
+ * the number of decimal places
+ */
+ public int getDigits()
+ {
+ return digits;
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateTable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateTable.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateTable.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateTable.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+/**
+ * This class implements a template checkbox.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateTable extends AbstractTemplateWidget
+{
+ /** The default show add button value */
+ public static boolean DEFAULT_SHOW_ADD_BUTTON = true;
+
+ /** The default show edit button value */
+ public static boolean DEFAULT_SHOW_EDIT_BUTTON = true;
+
+ /** The default show delete button value */
+ public static boolean DEFAULT_SHOW_DELETE_BUTTON = true;
+
+ /** The flag which indicated if a "<em>Add...</em>" button should be shown */
+ private boolean showAddButton = DEFAULT_SHOW_ADD_BUTTON;
+
+ /** The flag which indicated if a "<em>Edit...</em>" button should be shown */
+ private boolean showEditButton = DEFAULT_SHOW_EDIT_BUTTON;
+
+ /** The flag which indicated if a "<em>Delete...</em>" button should be shown */
+ private boolean showDeleteButton = DEFAULT_SHOW_DELETE_BUTTON;
+
+
+ /**
+ * Creates a new instance of TemplateTable.
+ *
+ * @param parent
+ * the parent element
+ */
+ public TemplateTable( TemplateWidget parent )
+ {
+ super( parent );
+ }
+
+
+ /**
+ * Indicates if a "<em>Add...</em>" button should be shown.
+ *
+ * @return
+ * <code>true</code> if a "<em>Add...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public boolean isShowAddButton()
+ {
+ return showAddButton;
+ }
+
+
+ /**
+ * Indicates if a "<em>Delete...</em>" button should be shown.
+ *
+ * @return
+ * <code>true</code> if a "<em>Delete...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public boolean isShowDeleteButton()
+ {
+ return showDeleteButton;
+ }
+
+
+ /**
+ * Indicates if a "<em>Edit...</em>" button should be shown.
+ *
+ * @return
+ * <code>true</code> if a "<em>Edit...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public boolean isShowEditButton()
+ {
+ return showEditButton;
+ }
+
+
+ /**
+ * Sets the flag which indicates if a "<em>Add...</em>" button should
+ * be shown.
+ *
+ * @param showAddButton
+ * <code>true</code> if a "<em>Add...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public void setShowAddButton( boolean showAddButton )
+ {
+ this.showAddButton = showAddButton;
+ }
+
+
+ /**
+ * Sets the flag which indicates if a "<em>Delete...</em>" button should
+ * be shown.
+ *
+ * @param showDeleteButton
+ * <code>true</code> if a "<em>Delete...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public void setShowDeleteButton( boolean showDeleteButton )
+ {
+ this.showDeleteButton = showDeleteButton;
+ }
+
+
+ /**
+ * Sets the flag which indicates if a "<em>Edit...</em>" button should
+ * be shown.
+ *
+ * @param showEditButton
+ * <code>true</code> if a "<em>Edit...</em>" button should be
+ * shown, <code>false</code> if not.
+ */
+ public void setShowEditButton( boolean showEditButton )
+ {
+ this.showEditButton = showEditButton;
+ }
+}
Added: directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateTextField.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateTextField.java?rev=1669604&view=auto
==============================================================================
--- directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateTextField.java (added)
+++ directory/studio/trunk/plugins/templateeditor/src/main/java/org/apache/directory/studio/templateeditor/model/widgets/TemplateTextField.java Fri Mar 27 15:27:27 2015
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.studio.templateeditor.model.widgets;
+
+
+/**
+ * This class implements a template text field.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class TemplateTextField extends AbstractTemplateWidget
+{
+ /** The default number of rows value */
+ public static int DEFAULT_NUMBER_OF_ROWS = 1;
+
+ /** The default characters limit value */
+ public static int DEFAULT_CHARACTERS_LIMIT = -1;
+
+ /** The default dollar sign is new line value */
+ public static boolean DEFAULT_DOLLAR_SIGN_IS_NEW_LINE = false;
+
+ /** The number of rows */
+ private int numberOfRows = DEFAULT_NUMBER_OF_ROWS;
+
+ /** The characters limit */
+ private int charactersLimit = DEFAULT_CHARACTERS_LIMIT;
+
+ /** The flag which indicates if dollar sign ('$') is to be interpreted as a new line */
+ private boolean dollarSignIsNewLine = DEFAULT_DOLLAR_SIGN_IS_NEW_LINE;
+
+
+ /**
+ * Creates a new instance of TemplateTextField.
+ *
+ * @param parent
+ * the parent element
+ */
+ public TemplateTextField( TemplateWidget parent )
+ {
+ super( parent );
+ }
+
+
+ /**
+ * Gets the characters limit.
+ *
+ * @return
+ * the characters limit
+ */
+ public int getCharactersLimit()
+ {
+ return charactersLimit;
+ }
+
+
+ /**
+ * Gets the number of rows.
+ *
+ * @return
+ * the number of rows
+ */
+ public int getNumberOfRows()
+ {
+ return numberOfRows;
+ }
+
+
+ /**
+ * Indicates if dollar sign ('$') is to be interpreted as a new line.
+ *
+ * @return
+ * <code>true</code> if dollar sign ('$') is to be interpreted as a new line,
+ * <code>false</code> if not
+ */
+ public boolean isDollarSignIsNewLine()
+ {
+ return dollarSignIsNewLine;
+ }
+
+
+ /**
+ * Sets the characters limit.
+ *
+ * @param charactersLimit
+ * the characters limit
+ */
+ public void setCharactersLimit( int charactersLimit )
+ {
+ this.charactersLimit = charactersLimit;
+ }
+
+
+ /**
+ * Sets the flag which indicates if dollar sign ('$') is to be interpreted as a new line.
+ *
+ * @param dollarSignIsNewLine
+ * <code>true</code> if dollar sign ('$') is to be interpreted as a new line,
+ * <code>false</code> if not
+ */
+ public void setDollarSignIsNewLine( boolean dollarSignIsNewLine )
+ {
+ this.dollarSignIsNewLine = dollarSignIsNewLine;
+ }
+
+
+ /**
+ * Sets the number of rows.
+ *
+ * @param numberOfRows
+ * the number of rows
+ */
+ public void setNumberOfRows( int numberOfRows )
+ {
+ this.numberOfRows = numberOfRows;
+ }
+}