Package org.apache.uima.pear.generate
Class PearFileResourceExportPage
java.lang.Object
org.eclipse.jface.dialogs.DialogPage
org.eclipse.jface.wizard.WizardPage
org.apache.uima.pear.generate.PearFileResourceExportPage
- All Implemented Interfaces:
InsdConstants
,org.eclipse.jface.dialogs.IDialogPage
,org.eclipse.jface.dialogs.IMessageProvider
,org.eclipse.jface.wizard.IWizardPage
public class PearFileResourceExportPage
extends org.eclipse.jface.wizard.WizardPage
implements InsdConstants
Wizard page for exporting resource to a PEAR file.
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.eclipse.swt.widgets.Button
Checkbox for choosing whether pear file should be compressed.protected final org.eclipse.core.resources.IContainer
Folder or Project that contains the Pear structure.protected org.eclipse.swt.widgets.Text
Text input for the.protected final org.eclipse.jface.preference.IPreferenceStore
Plugins preference store.protected final org.eclipse.jface.viewers.IStructuredSelection
Initial selection for the TreeViewer.protected org.eclipse.ui.dialogs.ContainerCheckedTreeViewer
TreeViewer that shows resources to export.protected static final String
Preference store key for the last pear file export location.Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
Fields inherited from interface org.apache.uima.pear.insd.edit.InsdConstants
CAS_CONSUMER_DESCRIPTOR_PATH, CAS_INITIALIZER_DESCRIPTOR_PATH, COLLECTION_ITERATOR_DESCRIPTOR_PATH, COMP_DESCRIPTOR_PATH, COMP_ID, COMP_NAME, COMP_TYPE_ANALYSIS_ENGINE, COMP_TYPE_CAS_CONSUMER, COMP_TYPE_CAS_INITIALIZER, COMP_TYPE_COLLECTION_READER, COMP_TYPE_CPE
-
Constructor Summary
ConstructorDescriptionPearFileResourceExportPage
(org.eclipse.jface.viewers.IStructuredSelection selection, org.eclipse.core.resources.IContainer currentContainer) constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
createControl
(org.eclipse.swt.widgets.Composite parent) protected void
createDestinationControl
(org.eclipse.swt.widgets.Composite parent) Creates the Pear file export destination controls, i.e. label, input field and browse buttonprotected void
createOptionsGroup
(org.eclipse.swt.widgets.Composite parent) Create the options group with the compression checkbox.protected void
createSourceControl
(org.eclipse.swt.widgets.Composite parent) Create the TreeViewer for selection of files to export in the Pear file and select/deselect all buttons.protected org.eclipse.ui.dialogs.ContainerCheckedTreeViewer
createTreeViewer
(org.eclipse.swt.widgets.Composite parent) Creates the tree viewer.protected String
Gets the destination value.org.eclipse.jface.operation.IRunnableWithProgress
Gets the export runnable.protected void
Opens a file selection dialog to select a pear file as export location and sets the chosen value to the input field.protected boolean
Checks if is metadata included.protected void
Update buttons and messages.protected void
saveDestinationValue
(String filename) Stores the Pear filename in the preference store.protected void
setAllChecked
(org.eclipse.swt.widgets.TreeItem[] items, boolean checked) Sets the all checked.Methods inherited from class org.eclipse.jface.wizard.WizardPage
canFlipToNextPage, getContainer, getDialogSettings, getImage, getName, getNextPage, getPreviousPage, getShell, getWizard, isCurrentPage, isPageComplete, setDescription, setErrorMessage, setImageDescriptor, setMessage, setPageComplete, setPreviousPage, setTitle, setWizard, toString
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getMessage, getMessageType, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, performHelp, setButtonLayoutData, setControl, setMessage, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
dispose, getControl, getDescription, getErrorMessage, getMessage, getTitle, performHelp, setVisible
-
Field Details
-
PEAR_FILE
Preference store key for the last pear file export location.- See Also:
-
fPreferenceStore
protected final org.eclipse.jface.preference.IPreferenceStore fPreferenceStorePlugins preference store. -
fCurrentContainer
protected final org.eclipse.core.resources.IContainer fCurrentContainerFolder or Project that contains the Pear structure. -
fSelection
protected final org.eclipse.jface.viewers.IStructuredSelection fSelectionInitial selection for the TreeViewer. -
fTreeViewer
protected org.eclipse.ui.dialogs.ContainerCheckedTreeViewer fTreeViewerTreeViewer that shows resources to export. -
fDestinationFileInput
protected org.eclipse.swt.widgets.Text fDestinationFileInputText input for the. -
fCompressCheckbox
protected org.eclipse.swt.widgets.Button fCompressCheckboxCheckbox for choosing whether pear file should be compressed.
-
-
Constructor Details
-
PearFileResourceExportPage
public PearFileResourceExportPage(org.eclipse.jface.viewers.IStructuredSelection selection, org.eclipse.core.resources.IContainer currentContainer) constructor.- Parameters:
selection
- Initial selection for the export TreeViewercurrentContainer
- Container (project or folder) with Pear structure
-
-
Method Details
-
pageStateChanged
protected void pageStateChanged()Update buttons and messages. -
isMetadataIncluded
protected boolean isMetadataIncluded()Checks if is metadata included.- Returns:
true
if all files in the metadata folder are selected for export or the members cannot be determined,false
otherwise
-
handleDestinationBrowseButtonPressed
protected void handleDestinationBrowseButtonPressed()Opens a file selection dialog to select a pear file as export location and sets the chosen value to the input field. -
saveDestinationValue
Stores the Pear filename in the preference store.- Parameters:
filename
- the filename
-
getDestinationValue
Gets the destination value.- Returns:
- The value of the Pear file export destination as chosen by the user, or the last used one if the widget was not created yet
-
createControl
public void createControl(org.eclipse.swt.widgets.Composite parent) - Specified by:
createControl
in interfaceorg.eclipse.jface.dialogs.IDialogPage
-
createOptionsGroup
protected void createOptionsGroup(org.eclipse.swt.widgets.Composite parent) Create the options group with the compression checkbox.- Parameters:
parent
- the parent composite
-
createSourceControl
protected void createSourceControl(org.eclipse.swt.widgets.Composite parent) Create the TreeViewer for selection of files to export in the Pear file and select/deselect all buttons.- Parameters:
parent
- the parent composite
-
setAllChecked
protected void setAllChecked(org.eclipse.swt.widgets.TreeItem[] items, boolean checked) Sets the all checked.- Parameters:
items
- A set of TreeItems that should be (un)checked, including their childrenchecked
-true
to check all items,false
to uncheck all items
-
createDestinationControl
protected void createDestinationControl(org.eclipse.swt.widgets.Composite parent) Creates the Pear file export destination controls, i.e. label, input field and browse button- Parameters:
parent
- the parent composite
-
createTreeViewer
protected org.eclipse.ui.dialogs.ContainerCheckedTreeViewer createTreeViewer(org.eclipse.swt.widgets.Composite parent) Creates the tree viewer.- Parameters:
parent
- the parent composite- Returns:
- TreeViewer that shows uses Workbench Content- and LabelProvider
-
getExportRunnable
public org.eclipse.jface.operation.IRunnableWithProgress getExportRunnable()Gets the export runnable.- Returns:
- An
IRunnableWithProgress
that will export the files chosen in the TreeViewer to the file chosen in the destination input field when run
-