]> git.argeo.org Git - lgpl/argeo-commons.git/blob - base/runtime/org.argeo.eclipse.ui.rap/src/main/java/org/argeo/eclipse/ui/specific/ImportToServerWizardPage.java
2.x specific - Adapt file download service to Rap 2.x
[lgpl/argeo-commons.git] / base / runtime / org.argeo.eclipse.ui.rap / src / main / java / org / argeo / eclipse / ui / specific / ImportToServerWizardPage.java
1 /*
2 * Copyright (C) 2007-2012 Argeo GmbH
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.argeo.eclipse.ui.specific;
17
18 import java.io.InputStream;
19
20 import org.apache.commons.logging.Log;
21 import org.apache.commons.logging.LogFactory;
22 import org.argeo.ArgeoException;
23 import org.eclipse.jface.wizard.WizardPage;
24 //import org.eclipse.rap.rwt.widgets.Upload;
25 import org.eclipse.swt.SWT;
26 import org.eclipse.swt.layout.GridData;
27 import org.eclipse.swt.layout.GridLayout;
28 import org.eclipse.swt.widgets.Composite;
29 import org.eclipse.swt.widgets.Label;
30
31 public class ImportToServerWizardPage extends WizardPage {
32 private final static Log log = LogFactory
33 .getLog(ImportToServerWizardPage.class);
34
35 public final static String FILE_ITEM_TYPE = "FILE";
36 public final static String FOLDER_ITEM_TYPE = "FOLDER";
37
38 //private Upload uploadFile;
39
40 public ImportToServerWizardPage() {
41 super("Import from file system");
42 setDescription("Import files from the local file system to the server");
43 }
44
45 public void createControl(Composite parent) {
46 Composite composite = new Composite(parent, SWT.NONE);
47 composite.setLayout(new GridLayout(2, false));
48 composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
49 new Label(composite, SWT.NONE).setText("Pick up a file");
50 // uploadFile = new Upload(composite, SWT.BORDER);
51 // uploadFile.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
52 // uploadFile.setBrowseButtonText("Open...");
53 setControl(composite);
54 }
55
56 public String getObjectPath() {
57 // NOTE Returns the full file name of the last uploaded file including
58 // the file path as selected by the user on his local machine.
59 // The full path including the directory and file drive are only
60 // returned, if the browser supports reading this properties. In Firefox
61 // 3, only the filename is returned.
62 return null;
63 }
64
65 public String getObjectName() {
66 return null;
67 }
68
69 public String getObjectType() {
70 return FILE_ITEM_TYPE;
71 }
72
73 public void performFinish() {
74 // boolean success = uploadFile.performUpload();
75 // if (!success)
76 // throw new ArgeoException("Cannot upload file named "
77 // + uploadFile.getPath());
78 }
79
80 // protected void handleUploadFinished(final Upload upload) {
81 // }
82
83 public InputStream getFileInputStream() {
84 return null;
85 }
86
87 public boolean getNeedsProgressMonitor() {
88 return false;
89 }
90
91 }