2 * NetXMS - open source network management system
3 * Copyright (C) 2003-2011 Victor Kirhenshtein
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 package org
.netxms
.ui
.eclipse
.filemanager
.dialogs
;
21 import org
.eclipse
.jface
.dialogs
.Dialog
;
22 import org
.eclipse
.swt
.SWT
;
23 import org
.eclipse
.swt
.layout
.GridData
;
24 import org
.eclipse
.swt
.layout
.GridLayout
;
25 import org
.eclipse
.swt
.widgets
.Composite
;
26 import org
.eclipse
.swt
.widgets
.Control
;
27 import org
.eclipse
.swt
.widgets
.Shell
;
28 import org
.netxms
.ui
.eclipse
.filemanager
.Messages
;
29 import org
.netxms
.ui
.eclipse
.tools
.MessageDialogHelper
;
30 import org
.netxms
.ui
.eclipse
.tools
.WidgetHelper
;
31 import org
.netxms
.ui
.eclipse
.widgets
.LabeledText
;
34 * Dialog for starting file upload
36 public class CreateFolderDialog
extends Dialog
38 private LabeledText textNewDirectoryName
;
39 private String newDirectoryName
;
45 public CreateFolderDialog(Shell parentShell
)
51 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
54 protected void configureShell(Shell newShell
)
56 super.configureShell(newShell
);
57 newShell
.setText(Messages
.get().StartClientToServerFileUploadDialog_Title
);
61 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
64 protected Control
createDialogArea(Composite parent
)
66 Composite dialogArea
= (Composite
)super.createDialogArea(parent
);
68 GridLayout layout
= new GridLayout();
69 layout
.marginHeight
= WidgetHelper
.DIALOG_HEIGHT_MARGIN
;
70 layout
.marginWidth
= WidgetHelper
.DIALOG_WIDTH_MARGIN
;
71 layout
.verticalSpacing
= WidgetHelper
.DIALOG_SPACING
;
72 dialogArea
.setLayout(layout
);
74 textNewDirectoryName
= new LabeledText(dialogArea
, SWT
.NONE
);
75 textNewDirectoryName
.setLabel("New folder name");
76 GridData gd
= new GridData();
77 gd
.horizontalAlignment
= SWT
.FILL
;
78 gd
.grabExcessHorizontalSpace
= true
;
79 textNewDirectoryName
.setLayoutData(gd
);
85 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
88 protected void okPressed()
90 newDirectoryName
= textNewDirectoryName
.getText();
96 * @return the remoteFileName
98 public String
getNewName()
100 return newDirectoryName
;