P
- the supported IOProvider
typepublic abstract class AbstractProviderSource<P extends ImportProvider> extends AbstractSource<P>
ImportSource
implementation offering provider selection.ImportSource.SourceConfiguration<P extends ImportProvider>
Constructor and Description |
---|
AbstractProviderSource() |
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.jface.viewers.ComboViewer |
createProviders(org.eclipse.swt.widgets.Composite parent)
Create the provider selector combo viewer.
|
protected org.eclipse.jface.viewers.ComboViewer |
getProviders()
Get the provider selector combo viewer.
|
protected abstract LocatableInputSupplier<? extends InputStream> |
getSource()
Get the source to configure the import provider with.
|
protected abstract boolean |
isValidSource()
Determines if the current page state will result in a valid source for
the import provider.
|
protected void |
onProviderSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
Called when the provider selection changes.
|
boolean |
updateConfiguration(P provider)
Configures the provider with the input supplier obtained using
getSource() as source. |
protected void |
updateContentType()
|
protected void |
updateProvider()
Update the provider selector when the content type has changed.
|
protected void |
updateState(boolean updateContentType)
Update the page state.
|
dispose, getConfiguration, getPage, onActivate, setConfiguration, setPage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createControls
protected org.eclipse.jface.viewers.ComboViewer createProviders(org.eclipse.swt.widgets.Composite parent)
getProviders()
. This should be called in
ImportSource.createControls(Composite)
.parent
- the parent compositeprotected void onProviderSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
event
- the selection changed eventprotected org.eclipse.jface.viewers.ComboViewer getProviders()
protected void updateProvider()
protected void updateState(boolean updateContentType)
ImportSource.createControls(Composite)
to initialize
the page state.updateContentType
- if true
the content type and the
supported providers will be updated before updating the page
stateprotected void updateContentType()
updateProvider()
.
Subclasses may add logic to change the content type in the source
configuration.public boolean updateConfiguration(P provider)
getSource()
as source.updateConfiguration
in interface ImportSource<P extends ImportProvider>
updateConfiguration
in class AbstractSource<P extends ImportProvider>
provider
- the I/O provider to updateAbstractSource.updateConfiguration(ImportProvider)
,
getSource()
protected abstract LocatableInputSupplier<? extends InputStream> getSource()
null
if no valid source can be createdisValidSource()
protected abstract boolean isValidSource()
getSource()
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a