]> git.argeo.org Git - lgpl/argeo-commons.git/blob - ImportToServerWizardPage.java
b6a3eaa9339ef045f80700e4eddea5051cb0206e
[lgpl/argeo-commons.git] / ImportToServerWizardPage.java
1 /*
2 * Copyright (C) 2007-2012 Mathieu Baudier
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.eclipse.jface.preference.DirectoryFieldEditor;
21 import org.eclipse.jface.wizard.WizardPage;
22 import org.eclipse.swt.widgets.Composite;
23
24 public class ImportToServerWizardPage extends WizardPage {
25
26 public final static String FILE_ITEM_TYPE = "FILE";
27 public final static String FOLDER_ITEM_TYPE = "FOLDER";
28
29 private DirectoryFieldEditor dfe;
30
31 public ImportToServerWizardPage() {
32 super("Import from file system");
33 setDescription("Import files from the local file system into the JCR repository");
34 }
35
36 public void createControl(Composite parent) {
37 dfe = new DirectoryFieldEditor("directory", "From", parent);
38 setControl(dfe.getTextControl(parent));
39 }
40
41 public String getObjectPath() {
42 return dfe.getStringValue();
43 }
44
45 public String getObjectType() {
46 return FOLDER_ITEM_TYPE;
47 }
48
49 public boolean getNeedsProgressMonitor() {
50 return true;
51 }
52
53 // Dummy methods : useless in RCP context but useful for RAP
54 /** WARNING : always return null in RCP context */
55 public String getObjectName() {
56 return null;
57 }
58
59 /** WARNING : do nothing in RCP context */
60 public void performFinish() {
61 }
62
63 /** WARNING : always return null in RCP context */
64 public InputStream getFileInputStream() {
65 return null;
66 }
67 }