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
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.swt.widgets.ButtonCheckbox for choosing whether pear file should be compressed.protected final org.eclipse.core.resources.IContainerFolder or Project that contains the Pear structure.protected org.eclipse.swt.widgets.TextText input for the.protected final org.eclipse.jface.preference.IPreferenceStorePlugins preference store.protected final org.eclipse.jface.viewers.IStructuredSelectionInitial selection for the TreeViewer.protected org.eclipse.ui.dialogs.ContainerCheckedTreeViewerTreeViewer that shows resources to export.protected static final StringPreference store key for the last pear file export location.Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNINGFields 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
ConstructorsConstructorDescriptionPearFileResourceExportPage(org.eclipse.jface.viewers.IStructuredSelection selection, org.eclipse.core.resources.IContainer currentContainer) constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateControl(org.eclipse.swt.widgets.Composite parent) protected voidcreateDestinationControl(org.eclipse.swt.widgets.Composite parent) Creates the Pear file export destination controls, i.e. label, input field and browse buttonprotected voidcreateOptionsGroup(org.eclipse.swt.widgets.Composite parent) Create the options group with the compression checkbox.protected voidcreateSourceControl(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.ContainerCheckedTreeViewercreateTreeViewer(org.eclipse.swt.widgets.Composite parent) Creates the tree viewer.protected StringGets the destination value.org.eclipse.jface.operation.IRunnableWithProgressGets the export runnable.protected voidOpens a file selection dialog to select a pear file as export location and sets the chosen value to the input field.protected booleanChecks if is metadata included.protected voidUpdate buttons and messages.protected voidsaveDestinationValue(String filename) Stores the Pear filename in the preference store.protected voidsetAllChecked(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, toStringMethods 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
trueif all files in the metadata folder are selected for export or the members cannot be determined,falseotherwise
-
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:
createControlin 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-trueto check all items,falseto 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
IRunnableWithProgressthat will export the files chosen in the TreeViewer to the file chosen in the destination input field when run
-