]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/jface/FontCellEditor.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.utils.ui / src / org / simantics / utils / ui / jface / FontCellEditor.java
index c69f15a1810cbce3df73463300c190f4121f2202..25ab5fcc73d7efbb247364690c3e459f1db981ea 100644 (file)
@@ -1,83 +1,83 @@
-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-/*\r
- *\r
- * @author Toni Kalajainen\r
- */\r
-package org.simantics.utils.ui.jface;\r
-\r
-import org.eclipse.jface.viewers.DialogCellEditor;\r
-import org.eclipse.swt.SWT;\r
-import org.eclipse.swt.graphics.Color;\r
-import org.eclipse.swt.graphics.FontData;\r
-import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.swt.widgets.Control;\r
-import org.eclipse.swt.widgets.FontDialog;\r
-import org.eclipse.swt.widgets.Label;\r
-\r
-public class FontCellEditor extends DialogCellEditor {\r
-\r
-    private Label fontLabel;\r
-        \r
-    public FontCellEditor() {\r
-        super();\r
-    }\r
-\r
-    public FontCellEditor(Composite parent, int style) {\r
-        super(parent, style);\r
-    }\r
-\r
-\r
-\r
-    public FontCellEditor(Composite parent) {\r
-        super(parent);\r
-    }\r
-\r
-    @Override\r
-    protected Control createContents(Composite cell) {\r
-        fontLabel = new Label(cell, SWT.LEFT);\r
-        Color bg = cell.getBackground();\r
-        fontLabel.setBackground(bg);\r
-        return fontLabel;\r
-    }\r
-    \r
-\r
-    @Override\r
-    protected Object openDialogBox(Control cellEditorWindow) {\r
-        \r
-        FontDialog fontDialog = new FontDialog(cellEditorWindow.getShell());\r
-        FontData fontData = (FontData) getValue();\r
-        if (fontData!=null)\r
-            fontDialog.setFontList(new FontData[] {fontData});\r
-        return fontDialog.open();\r
-    }\r
-\r
-    @Override\r
-    protected void updateContents(Object value) {\r
-        FontData fontData = (FontData) value;\r
-        if (fontData==null) {\r
-            fontLabel.setText("select font...");\r
-            return;\r
-        }\r
-        \r
-        StringBuilder sb = new StringBuilder();\r
-        sb.append( fontData.getName() );\r
-        sb.append( ", "+fontData.getHeight() );\r
-        if ( (fontData.getStyle() & SWT.BOLD)>0 )\r
-            sb.append(", Bold");\r
-        if ( (fontData.getStyle() & SWT.ITALIC)>0 )\r
-            sb.append(", Italic");\r
-        fontLabel.setText(sb.toString());\r
-    }\r
-    \r
-    \r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+/*
+ *
+ * @author Toni Kalajainen
+ */
+package org.simantics.utils.ui.jface;
+
+import org.eclipse.jface.viewers.DialogCellEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.FontDialog;
+import org.eclipse.swt.widgets.Label;
+
+public class FontCellEditor extends DialogCellEditor {
+
+    private Label fontLabel;
+        
+    public FontCellEditor() {
+        super();
+    }
+
+    public FontCellEditor(Composite parent, int style) {
+        super(parent, style);
+    }
+
+
+
+    public FontCellEditor(Composite parent) {
+        super(parent);
+    }
+
+    @Override
+    protected Control createContents(Composite cell) {
+        fontLabel = new Label(cell, SWT.LEFT);
+        Color bg = cell.getBackground();
+        fontLabel.setBackground(bg);
+        return fontLabel;
+    }
+    
+
+    @Override
+    protected Object openDialogBox(Control cellEditorWindow) {
+        
+        FontDialog fontDialog = new FontDialog(cellEditorWindow.getShell());
+        FontData fontData = (FontData) getValue();
+        if (fontData!=null)
+            fontDialog.setFontList(new FontData[] {fontData});
+        return fontDialog.open();
+    }
+
+    @Override
+    protected void updateContents(Object value) {
+        FontData fontData = (FontData) value;
+        if (fontData==null) {
+            fontLabel.setText("select font...");
+            return;
+        }
+        
+        StringBuilder sb = new StringBuilder();
+        sb.append( fontData.getName() );
+        sb.append( ", "+fontData.getHeight() );
+        if ( (fontData.getStyle() & SWT.BOLD)>0 )
+            sb.append(", Bold");
+        if ( (fontData.getStyle() & SWT.ITALIC)>0 )
+            sb.append(", Italic");
+        fontLabel.setText(sb.toString());
+    }
+    
+    
+}