Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2016-04-01 21:52:34 +0000
committerTom Schindl2016-04-01 21:52:34 +0000
commiteb56e9a8a41d4265797ff0b87d3ea50fd7a12923 (patch)
tree9e9ef9bb2d19aa848bbd1da01b42263ab7d66534
parent2ff9d3b9e6f2c5d728551b038db81d0f5af19105 (diff)
downloadorg.eclipse.efxclipse-eb56e9a8a41d4265797ff0b87d3ea50fd7a12923.tar.gz
org.eclipse.efxclipse-eb56e9a8a41d4265797ff0b87d3ea50fd7a12923.tar.xz
org.eclipse.efxclipse-eb56e9a8a41d4265797ff0b87d3ea50fd7a12923.zip
Bug 490943 - LW TitleAreaDialog should allow to display a FontIcon
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/dialog/TitleAreaDialog.java12
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/dialog/dialog.css4
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/image/FontIconView.java10
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/image/fonticonview.cssext9
4 files changed, 26 insertions, 9 deletions
diff --git a/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/dialog/TitleAreaDialog.java b/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/dialog/TitleAreaDialog.java
index 0d54bead3..0d7acef3c 100644
--- a/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/dialog/TitleAreaDialog.java
+++ b/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/dialog/TitleAreaDialog.java
@@ -11,6 +11,7 @@
package org.eclipse.fx.ui.controls.dialog;
import org.eclipse.fx.core.Subscription;
+import org.eclipse.fx.ui.controls.image.FontIconView;
import javafx.beans.property.StringProperty;
import javafx.scene.Node;
@@ -18,6 +19,7 @@ import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
+import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
/**
@@ -92,9 +94,17 @@ public class TitleAreaDialog extends Dialog {
HBox.setHgrow(messageArea, Priority.ALWAYS);
+ StackPane container = new StackPane();
+ container.getStyleClass().add("efx-dialog-graphic-container"); //$NON-NLS-1$
+
ImageView titleImage = new ImageView();
titleImage.getStyleClass().add("efx-dialog-title-image"); //$NON-NLS-1$
- box.getChildren().addAll(messageArea, titleImage);
+
+ FontIconView v = new FontIconView();
+ v.getStyleClass().add("efx-dialog-title-font-icon"); //$NON-NLS-1$
+ container.getChildren().addAll(titleImage,v);
+
+ box.getChildren().addAll(messageArea, container);
setTop(box);
}
diff --git a/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/dialog/dialog.css b/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/dialog/dialog.css
index 3054db00e..660b2d476 100644
--- a/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/dialog/dialog.css
+++ b/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/dialog/dialog.css
@@ -68,4 +68,8 @@
.efx-dialog-title-area .efx-dialog-title-message.info-message {
-fx-graphic: url("icons/dialog-information-16.png");
+}
+
+.efx-dialog-title-font-icon {
+ visibility: hidden;
} \ No newline at end of file
diff --git a/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/image/FontIconView.java b/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/image/FontIconView.java
index b8d3595e0..9914c6de1 100644
--- a/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/image/FontIconView.java
+++ b/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/image/FontIconView.java
@@ -14,6 +14,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import org.eclipse.fx.ui.controls.image.skin.FontIconViewSkin;
+
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyObjectProperty;
@@ -26,6 +28,7 @@ import javafx.css.StyleableObjectProperty;
import javafx.css.StyleableProperty;
import javafx.geometry.Insets;
import javafx.scene.control.Control;
+import javafx.scene.control.Skin;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.scene.text.Font;
@@ -39,15 +42,14 @@ public class FontIconView extends Control {
* Create a new font icon view
*/
public FontIconView() {
- getStyleClass().setAll("fonticonview"); //$NON-NLS-1$
+ getStyleClass().setAll("font-icon-view"); //$NON-NLS-1$
setFocusTraversable(false);
setMouseTransparent(true);
}
@Override
- public String getUserAgentStylesheet() {
- String uri = FontIconView.class.getResource("fonticonview.css").toExternalForm(); //$NON-NLS-1$
- return uri;
+ protected Skin<?> createDefaultSkin() {
+ return new FontIconViewSkin(this);
}
@Deprecated
diff --git a/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/image/fonticonview.cssext b/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/image/fonticonview.cssext
index 625534390..01ced42f8 100644
--- a/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/image/fonticonview.cssext
+++ b/bundles/runtime/org.eclipse.fx.ui.controls/src/org/eclipse/fx/ui/controls/image/fonticonview.cssext
@@ -9,13 +9,14 @@ package org.eclipse.fx.ui.controls.image {
* The FontIconView allows the use of Icon Fonts
*/
FontIconView extends Control {
-
- -fx-font <font>;
+
/**
- *
+ *
*/
-fx-icon @STRING default: null;
-
+
+ -fx-icon-font-size <javafx.size> default: null;
+
-fx-icon-fill <paint> default: black;
}

Back to the top