public class EmfInputInterpreter
extends AbstractInputInterpreter
Modifier and Type | Field and Description |
---|---|
static ViewModeDescriptor |
EMF_LIST_DESC
EMF list view mode descriptor
|
static ViewModeDescriptor |
EMF_NULL_DESC
Null view mode descriptor.
|
static ViewModeDescriptor |
EMF_PROPERTY_DESC
EMF property view mode descriptor
|
static ViewModeDescriptor |
EMF_STRUCTURE_DESC
EMF structure view mode descriptor
|
static ViewModeDescriptor |
MULTILINETEXT_DESC
Mulitiline text list view mode descriptor
|
Constructor and Description |
---|
EmfInputInterpreter(IContentViewerPane contentViewerPane)
Constructs a new EmfInputIterpreter
|
Modifier and Type | Method and Description |
---|---|
boolean |
canBrowseContext(ViewModeDescriptor sourceViewMode,
ViewModeDescriptor targetViewMode,
org.eclipse.jface.viewers.ISelection selection)
Allows the interpreter to decide if in browse mode the selections from
the specified source view mode can be set as as the input to the
specified target view mode.
|
protected boolean |
canBrowseCustomContext(ViewModeDescriptor sourceViewMode,
ViewModeDescriptor targetViewMode,
org.eclipse.jface.viewers.ISelection selection)
Allows the interpreter to decide if in browse mode the selections from
the specified source view mode can be set as as the input to the
specified target view mode.
|
boolean |
canSupportInput(IContentViewerInput input)
Checks if the specified input can be handled by the interpreter.
|
protected static boolean |
canSupportViewMode(ViewModeDescriptor viewMode)
Checks if the view mode is an EMF view mode
|
protected java.lang.Object |
createMultilineContext(Delta delta)
Creates the multi line context object
|
protected java.lang.Object |
createTextInput(java.lang.String text,
java.lang.String fileExtension) |
protected Delta |
extractDelta(IContentViewerInput input)
Will find an information about the
Delta represented by
the input . |
protected static java.lang.Object |
findPropertyEntry(java.lang.Object feature,
IViewerData viewerData)
Find the content for the property viewer
|
protected IContentDescriptor |
getAffectedDescriptor(java.util.List<?> contents,
java.lang.Object affectedObject,
java.lang.Object parentObject) |
protected java.lang.String |
getAssociatedFileType(Delta delta)
Finds and return the file type associated with the given delta.
|
java.util.List |
getBrowseViewModes(IContentViewerInput input)
Returns the list of browse view modes for the specified input.
|
protected IContentDescriptor |
getContent(IContentViewerInput input,
ViewModeDescriptor requestedViewMode)
Returns the content for the EMF viewers
|
protected java.lang.Object |
getContext(IContentViewerInput input,
ViewModeDescriptor requestedViewMode)
Returns the context for the default EMF viewers
|
java.util.List |
getCurrentViewModes(IContentViewerInput input)
Returns the list of current view modes for the specified input.
|
protected java.util.List |
getCurrentViewModes(IContentViewerInput input,
boolean showEmfViews) |
protected java.util.List |
getCustomBrowseViewModes(IContentViewerInput input,
java.util.List currentBrowseViewModes)
Returns the list of custom browse view modes for the specified input.
|
protected java.util.List |
getCustomCurrentViewModes(IContentViewerInput input,
java.util.List currentDefaultViewModes)
Returns the custom current view modes
|
protected static Delta |
getFirstLeafDelta(Delta delta)
Returns the first leaf delta by inspecting the children of the specified
delta
|
protected Location |
getLocation(Delta delta,
org.eclipse.emf.ecore.resource.Resource resource)
Return the location for the specified delta and contributor resource
|
protected EmfMergeManager |
getMergeManager()
Returns the merge manager associated with the current session
|
protected java.lang.String |
getMultilineContent(Delta delta,
boolean newValue,
ContributorType contributorType)
Retrieves the the multi line text from the given delta
|
DeleteDelta |
getParentDeleteDelta(java.lang.String objectId,
DeltaContainer deltaContainer)
Return the delta associated with the deletion of the parent of the
specified object id
|
protected org.eclipse.emf.ecore.resource.Resource |
getPrimaryResource()
Retrieves reference to the EMF Resource that is displayed in the
IContentViewerPane this interpreter is serving.
|
protected boolean |
isHandlingContributor(ContributorType contributorType)
Checks if this interpreter is associated with the contributor type
|
protected boolean |
isMultilineContent(Delta delta)
Verifies whether the delta is related to multi lines or long line text
changes
|
protected static void |
revealContent(IContentDescriptor descriptor,
IViewerData viewerData)
Reveal the content in the viewer
|
IContentDescriptor |
revealContent(IContentViewerInput input,
IViewerData viewerData)
Reveals the content associated with the current input within the context
of the specified content viewer.
|
protected IContentDescriptor |
revealCustomContent(IContentViewerInput input,
IViewerData viewerData)
Reveals the custom content for the specified input and viewer
|
boolean |
setBrowseContext(org.eclipse.jface.viewers.ISelection selection,
IViewerData viewerData)
Sets the browse context associated with the current selection within the
specified content viewer.
|
boolean |
setContext(IContentViewerInput input,
IViewerData viewerData,
boolean force)
Sets the context associated with the current input within the specified
content viewer.
|
protected boolean |
setCustomBrowseContext(org.eclipse.jface.viewers.ISelection selection,
IViewerData viewerData)
Sets the custom browse context associated with the current selection
within the specified content viewer.
|
protected boolean |
setCustomContext(IContentViewerInput input,
IViewerData viewerData,
boolean force)
Sets the custom context for the specified input and viewer
|
boolean |
setInitialBrowseContext(IContentViewerInput input,
IViewerData viewerData)
Sets the default browse context associated with the current input within
the specified content viewer.
|
protected boolean |
setInitialCustomBrowseContext(IContentViewerInput input,
IViewerData viewerData)
Sets the intial custom browse context associated with the current input
within the specified content viewer.
|
protected static void |
setInput(java.lang.Object input,
IViewerData viewerData,
boolean force)
Sets the input to the viewer
|
public static final ViewModeDescriptor EMF_STRUCTURE_DESC
public static final ViewModeDescriptor EMF_PROPERTY_DESC
public static final ViewModeDescriptor EMF_LIST_DESC
public static final ViewModeDescriptor EMF_NULL_DESC
public static final ViewModeDescriptor MULTILINETEXT_DESC
public EmfInputInterpreter(IContentViewerPane contentViewerPane)
contentViewerPane
- the content viewer paneprotected org.eclipse.emf.ecore.resource.Resource getPrimaryResource()
protected static Delta getFirstLeafDelta(Delta delta)
delta
- the input deltaprotected Delta extractDelta(IContentViewerInput input)
Delta
represented by
the input .input
- the content viewer input which stores the Delta
protected Location getLocation(Delta delta, org.eclipse.emf.ecore.resource.Resource resource)
delta
- the input deltaresource
- the contributor resourcenull
protected static boolean canSupportViewMode(ViewModeDescriptor viewMode)
viewMode
- the input view modetrue
if supported, false
otherwiseprotected final EmfMergeManager getMergeManager()
public final IContentDescriptor revealContent(IContentViewerInput input, IViewerData viewerData)
input
- the input associated, which represents the current selection
in the StructureViewerviewerData
- the associated viewer datacom.ibm.xtools.comparemerge.ui.viewers.IInputInterpreter#revealContent(com.ibm.xtools.comparemerge.ui.controller.IContentViewerInput,
com.ibm.xtools.comparemerge.ui.utils.IViewerData)
public final boolean setContext(IContentViewerInput input, IViewerData viewerData, boolean force)
input
- the input associated, which represents the current selection
in the StructureViewerviewerData
- the associated viewer dataforce
- a flag to indicate if the input needs to set irrespective of
its previous inputcom.ibm.xtools.comparemerge.ui.viewers.IInputInterpreter#setContext(com.ibm.xtools.comparemerge.ui.controller.IContentViewerInput,
com.ibm.xtools.comparemerge.ui.utils.IViewerData, boolean)
public final java.util.List getCurrentViewModes(IContentViewerInput input)
input
- the input associatedViewModeDescriptor
com.ibm.xtools.comparemerge.ui.viewers.IInputInterpreter#getCurrentViewModes(com.ibm.xtools.comparemerge.ui.controller.IContentViewerInput)
protected java.util.List getCurrentViewModes(IContentViewerInput input, boolean showEmfViews)
public final java.util.List getBrowseViewModes(IContentViewerInput input)
input
- the input associatedViewModeDescriptor
com.ibm.xtools.comparemerge.ui.viewers.IInputInterpreter#getBrowseViewModes(com.ibm.xtools.comparemerge.ui.controller.IContentViewerInput)
protected final java.lang.Object getContext(IContentViewerInput input, ViewModeDescriptor requestedViewMode)
input
- the inputrequestedViewMode
- the requested view modeprotected final IContentDescriptor getContent(IContentViewerInput input, ViewModeDescriptor requestedViewMode)
input
- the inputrequestedViewMode
- the requested view modepublic final boolean setInitialBrowseContext(IContentViewerInput input, IViewerData viewerData)
input
- the input associated, which represents the current selection
in the StructureViewerviewerData
- the associated viewer datacom.ibm.xtools.comparemerge.ui.viewers.IInputInterpreter#setInitialBrowseContext(com.ibm.xtools.comparemerge.ui.controller.IContentViewerInput,
com.ibm.xtools.comparemerge.ui.utils.IViewerData)
public final boolean canBrowseContext(ViewModeDescriptor sourceViewMode, ViewModeDescriptor targetViewMode, org.eclipse.jface.viewers.ISelection selection)
sourceViewMode
- the source view mode from where the input is usedtargetViewMode
- the target view mode where the input from the source is setselection
- the source selectioncom.ibm.xtools.comparemerge.ui.viewers.IInputInterpreter#canBrowseContext(com.ibm.xtools.comparemerge.ui.utils.ViewModeDescriptor,
com.ibm.xtools.comparemerge.ui.utils.ViewModeDescriptor,
org.eclipse.jface.viewers.ISelection)
public final boolean setBrowseContext(org.eclipse.jface.viewers.ISelection selection, IViewerData viewerData)
selection
- the selection from the source viewerviewerData
- the target viewer datacom.ibm.xtools.comparemerge.ui.viewers.IInputInterpreter#setBrowseContext(org.eclipse.jface.viewers.ISelection,
com.ibm.xtools.comparemerge.ui.utils.IViewerData)
protected static void setInput(java.lang.Object input, IViewerData viewerData, boolean force)
input
- the input to the viewerviewerData
- the viewer dataforce
- flag to indicate whether is input is set irrespective of its
its previous inputprotected final boolean isHandlingContributor(ContributorType contributorType)
contributorType
- the contributortrue
is it is, false
otherwiseprotected static void revealContent(IContentDescriptor descriptor, IViewerData viewerData)
descriptor
- the content descriptorviewerData
- the viewer dataprotected static java.lang.Object findPropertyEntry(java.lang.Object feature, IViewerData viewerData)
feature
- the feature associated with the deltaviewerData
- the viewer dataprotected IContentDescriptor revealCustomContent(IContentViewerInput input, IViewerData viewerData)
input
- the inputviewerData
- the viewer dataprotected boolean canBrowseCustomContext(ViewModeDescriptor sourceViewMode, ViewModeDescriptor targetViewMode, org.eclipse.jface.viewers.ISelection selection)
sourceViewMode
- the source view mode from where the input is usedtargetViewMode
- the target view mode where the input from the source is setselection
- the source selectionprotected boolean setCustomContext(IContentViewerInput input, IViewerData viewerData, boolean force)
input
- the inputviewerData
- the viewer dataforce
- flag to indicate whether the input is forcedtrue
if successful, false
otherwiseprotected boolean setCustomBrowseContext(org.eclipse.jface.viewers.ISelection selection, IViewerData viewerData)
selection
- the selection from the source viewerviewerData
- the target viewer dataprotected java.util.List getCustomCurrentViewModes(IContentViewerInput input, java.util.List currentDefaultViewModes)
input
- currentDefaultViewModes
- protected boolean setInitialCustomBrowseContext(IContentViewerInput input, IViewerData viewerData)
input
- the input associated, which represents the current selection
in the StructureViewerviewerData
- the associated viewer dataprotected java.util.List getCustomBrowseViewModes(IContentViewerInput input, java.util.List currentBrowseViewModes)
input
- the input associatedcurrentBrowseViewModes
- the EMF browse modesViewModeDescriptor
public final boolean canSupportInput(IContentViewerInput input)
input
- the input associatedtrue
if input can be handled, false
otherwisecom.ibm.xtools.comparemerge.ui.viewers.IInputInterpreter#canSupportInput(com.ibm.xtools.comparemerge.ui.controller.IContentViewerInput)
public DeleteDelta getParentDeleteDelta(java.lang.String objectId, DeltaContainer deltaContainer)
objectId
- the object iddeltaContainer
- the delta containerprotected boolean isMultilineContent(Delta delta)
delta
- - The delta objectprotected java.lang.String getMultilineContent(Delta delta, boolean newValue, ContributorType contributorType)
delta
- - The delta object containing the text changesnewValue
- - true if the retrieving new text value. false otherwiseprotected java.lang.Object createMultilineContext(Delta delta)
delta
- - The delta objectprotected java.lang.String getAssociatedFileType(Delta delta)
delta
- - the delta contains the text changesprotected java.lang.Object createTextInput(java.lang.String text, java.lang.String fileExtension)
protected IContentDescriptor getAffectedDescriptor(java.util.List<?> contents, java.lang.Object affectedObject, java.lang.Object parentObject)