]>
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 * Copyright (C) 2007-2012 Argeo GmbH
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org
.argeo
.eclipse
.ui
.specific
;
18 import java
.io
.InputStream
;
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
;
31 public class ImportToServerWizardPage
extends WizardPage
{
32 private final static Log log
= LogFactory
33 .getLog(ImportToServerWizardPage
.class);
35 public final static String FILE_ITEM_TYPE
= "FILE";
36 public final static String FOLDER_ITEM_TYPE
= "FOLDER";
38 //private Upload uploadFile;
40 public ImportToServerWizardPage() {
41 super("Import from file system");
42 setDescription("Import files from the local file system to the server");
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
);
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.
65 public String
getObjectName() {
69 public String
getObjectType() {
70 return FILE_ITEM_TYPE
;
73 public void performFinish() {
74 // boolean success = uploadFile.performUpload();
76 // throw new ArgeoException("Cannot upload file named "
77 // + uploadFile.getPath());
80 // protected void handleUploadFinished(final Upload upload) {
83 public InputStream
getFileInputStream() {
87 public boolean getNeedsProgressMonitor() {