]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.document.ui/src/org/simantics/document/ui/wizard/FileSelectionPage.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.document.ui / src / org / simantics / document / ui / wizard / FileSelectionPage.java
index 89bbb5301c647e3c70d2802637289388b4777c45..eb43ee79471af3d0da638e45bb426fdcb5a131b7 100644 (file)
@@ -1,77 +1,77 @@
-package org.simantics.document.ui.wizard;\r
-\r
-import org.eclipse.jface.wizard.WizardPage;\r
-import org.eclipse.swt.SWT;\r
-import org.eclipse.swt.events.KeyAdapter;\r
-import org.eclipse.swt.events.KeyEvent;\r
-import org.eclipse.swt.events.SelectionAdapter;\r
-import org.eclipse.swt.events.SelectionEvent;\r
-import org.eclipse.swt.layout.GridData;\r
-import org.eclipse.swt.layout.GridLayout;\r
-import org.eclipse.swt.widgets.Button;\r
-import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.swt.widgets.Display;\r
-import org.eclipse.swt.widgets.FileDialog;\r
-import org.eclipse.swt.widgets.Text;\r
-\r
-public class FileSelectionPage extends WizardPage {\r
-       \r
-       Text fileText;\r
-       Button browseButton;\r
-       \r
-       String fileName;\r
-\r
-       public FileSelectionPage() {\r
-               super("FileSelction","Select a file",null);\r
-       }\r
-\r
-       @Override\r
-       public void createControl(Composite parent) {\r
-               parent.setLayout(new GridLayout(3,false));\r
-               fileText = new Text(parent,SWT.BORDER|SWT.SINGLE);\r
-               browseButton = new Button(parent, SWT.PUSH);\r
-               browseButton.setText("Browse");\r
-               \r
-               GridData data;\r
-               data = new GridData();\r
-               data.grabExcessHorizontalSpace = true;\r
-               data.horizontalAlignment = SWT.FILL;\r
-               data.horizontalSpan = 2;\r
-               fileText.setLayoutData(data);\r
-               \r
-               data = new GridData();\r
-               data.horizontalAlignment = SWT.FILL;\r
-               browseButton.setLayoutData(data);\r
-               \r
-               browseButton.addSelectionListener(new SelectionAdapter() {\r
-                       @Override\r
-                       public void widgetSelected(SelectionEvent e) {\r
-                               FileDialog dialog = new FileDialog(Display.getCurrent().getActiveShell(),SWT.OPEN);\r
-                               // TODO : is there any way to read file/executable bindings from OS?\r
-                               //        if is, use those extensions to filter this list.\r
-                               //        note: in windows using "reg query ..." to read bindings form registry would work.\r
-                               dialog.setFilterExtensions(new String[]{"*.*"});\r
-                               String name = dialog.open();\r
-                               if (name != null) {\r
-                                       fileText.setText(name);\r
-                                       fileName = name;\r
-                               }\r
-                       }\r
-               });\r
-               \r
-               fileText.addKeyListener(new KeyAdapter() {\r
-                       @Override\r
-                       public void keyReleased(KeyEvent e) {\r
-                               fileName = fileText.getText();\r
-                       }\r
-               });\r
-               \r
-       }\r
-       \r
-       public String getFileName() {\r
-               return fileName;\r
-       }\r
-       \r
-       \r
-\r
-}\r
+package org.simantics.document.ui.wizard;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Text;
+
+public class FileSelectionPage extends WizardPage {
+       
+       Text fileText;
+       Button browseButton;
+       
+       String fileName;
+
+       public FileSelectionPage() {
+               super("FileSelction","Select a file",null);
+       }
+
+       @Override
+       public void createControl(Composite parent) {
+               parent.setLayout(new GridLayout(3,false));
+               fileText = new Text(parent,SWT.BORDER|SWT.SINGLE);
+               browseButton = new Button(parent, SWT.PUSH);
+               browseButton.setText("Browse");
+               
+               GridData data;
+               data = new GridData();
+               data.grabExcessHorizontalSpace = true;
+               data.horizontalAlignment = SWT.FILL;
+               data.horizontalSpan = 2;
+               fileText.setLayoutData(data);
+               
+               data = new GridData();
+               data.horizontalAlignment = SWT.FILL;
+               browseButton.setLayoutData(data);
+               
+               browseButton.addSelectionListener(new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               FileDialog dialog = new FileDialog(Display.getCurrent().getActiveShell(),SWT.OPEN);
+                               // TODO : is there any way to read file/executable bindings from OS?
+                               //        if is, use those extensions to filter this list.
+                               //        note: in windows using "reg query ..." to read bindings form registry would work.
+                               dialog.setFilterExtensions(new String[]{"*.*"});
+                               String name = dialog.open();
+                               if (name != null) {
+                                       fileText.setText(name);
+                                       fileName = name;
+                               }
+                       }
+               });
+               
+               fileText.addKeyListener(new KeyAdapter() {
+                       @Override
+                       public void keyReleased(KeyEvent e) {
+                               fileName = fileText.getText();
+                       }
+               });
+               
+       }
+       
+       public String getFileName() {
+               return fileName;
+       }
+       
+       
+
+}