changeset 7906:a3783295a258

[SCENEBUILDER] Fix DTL-6845: Add a non empty flavor of DialogPane in the Library
author yjoan
date Fri, 29 Aug 2014 09:48:22 +0200
parents f166fe3c0547
children c594508c4f54
files apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/panel/library/LibraryListCell.java apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/library/BuiltinLibrary.java apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/library/builtin/DialogPane.fxml
diffstat 3 files changed, 57 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/panel/library/LibraryListCell.java	Fri Aug 29 14:07:10 2014 +1200
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/panel/library/LibraryListCell.java	Fri Aug 29 09:48:22 2014 +0200
@@ -230,7 +230,9 @@
             final LibraryItem item = listItem.getLibItem();
             // The classname shall be space character free (it is an API name).
             // If there is a space character then it means a qualifier comes
-            // right after.
+            // right after. In the case there is several qualifiers in a row
+            // only the latest one is taken as is, others are kept with class
+            // name.
             String classname = getClassName(item.getName());
             iconImageView.setManaged(true);
             classNameLabel.setManaged(true);
@@ -274,7 +276,7 @@
         if (!input.contains(" ")) { //NOI18N
             return ""; //NOI18N
         } else {
-            return input.substring(input.indexOf(' '), input.length()); //NOI18N
+            return input.substring(input.lastIndexOf(' '), input.length()); //NOI18N
         }
     }
 }
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/library/BuiltinLibrary.java	Fri Aug 29 14:07:10 2014 +1200
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/library/BuiltinLibrary.java	Fri Aug 29 09:48:22 2014 +0200
@@ -123,6 +123,8 @@
                 "AccordionEmpty", "Accordion", EMPTY_QUALIFIER); //NOI18N
         addRegionItem200x200(javafx.scene.layout.AnchorPane.class, TAG_CONTAINERS);
         addRegionItem200x200(javafx.scene.layout.BorderPane.class, TAG_CONTAINERS);
+        addCustomizedItem(javafx.scene.control.DialogPane.class, TAG_CONTAINERS, FX8_QUALIFIER);
+        addDefaultItem(javafx.scene.control.DialogPane.class, TAG_CONTAINERS, EMPTY_QUALIFIER, FX8_QUALIFIER);
         addRegionItem200x200(javafx.scene.layout.FlowPane.class, TAG_CONTAINERS);
         addCustomizedItem(javafx.scene.layout.GridPane.class, TAG_CONTAINERS);
         addRegionItem200x100(javafx.scene.layout.HBox.class, TAG_CONTAINERS);
@@ -154,7 +156,6 @@
         addDefaultItem(javafx.scene.control.ColorPicker.class, TAG_CONTROLS);
         addCustomizedItem(javafx.scene.control.ComboBox.class, TAG_CONTROLS);
         addDefaultItem(javafx.scene.control.DatePicker.class, TAG_CONTROLS, FX8_QUALIFIER);
-        addDefaultItem(javafx.scene.control.DialogPane.class, TAG_CONTROLS, FX8_QUALIFIER);
         addCustomizedItem(javafx.scene.web.HTMLEditor.class, TAG_CONTROLS);
         addCustomizedItem(javafx.scene.control.Hyperlink.class, TAG_CONTROLS);
         addCustomizedItem(javafx.scene.image.ImageView.class, TAG_CONTROLS);
@@ -256,8 +257,8 @@
     private void addDefaultItem(Class<?> componentClass, String section, String... qualifiers) {
         final String name = componentClass.getSimpleName();
         String nameWithQualifier = name;
-        if (qualifiers.length > 0) {
-            nameWithQualifier += qualifiers[0];
+        for (String qualifier : qualifiers) {
+            nameWithQualifier += qualifier;
         }
         final String fxmlText = makeFxmlText(componentClass);
         addItem(nameWithQualifier, fxmlText, section, name);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/library/builtin/DialogPane.fxml	Fri Aug 29 09:48:22 2014 +0200
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright (c) 2012, 2014, Oracle and/or its affiliates.
+  All rights reserved. Use is subject to license terms.
+
+  This file is available and licensed under the following license:
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  - Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+  - Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the distribution.
+  - Neither the name of Oracle Corporation nor the names of its
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<?import java.lang.*?>
+<?import java.util.*?>
+<?import javafx.scene.*?>
+<?import javafx.scene.control.*?>
+<?import javafx.scene.layout.*?>
+
+<DialogPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="300.0" prefWidth="480.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
+    <header>
+      <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="200.0" prefWidth="320.0" />
+    </header>
+    <content>
+      <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="200.0" prefWidth="320.0" />
+    </content>
+    <expandableContent>
+      <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="200.0" prefWidth="320.0" />
+    </expandableContent>
+</DialogPane>