-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#109 Add a new DiffMerge filter for ReqIf.Text attribute and document
about it Resolves #109 Change-Id: Ic0bdd193d999f007688861bd448a26d363886e6e Signed-off-by: Tu Ton <minhtutonthat@gmail.com>
- Loading branch information
1 parent
64042ee
commit 5f68ebf
Showing
9 changed files
with
116 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+29.1 KB
...ns/org.polarsys.capella.vp.requirements.doc/images/DiffMerge_Text_Filtering.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+9.43 KB
(150%)
plugins/org.polarsys.capella.vp.requirements.doc/images/diffmerge_filtering.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
...rsys/capella/vp/requirements/importer/transposer/bridge/categories/ReqIFTextCategory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 THALES GLOBAL SERVICES. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Thales - initial API and implementation | ||
*******************************************************************************/ | ||
package org.polarsys.capella.vp.requirements.importer.transposer.bridge.categories; | ||
|
||
import org.eclipse.emf.diffmerge.diffdata.EAttributeValuePresence; | ||
import org.eclipse.emf.diffmerge.diffdata.EMatch; | ||
import org.eclipse.emf.diffmerge.generic.api.diff.IDifference; | ||
import org.eclipse.emf.diffmerge.ui.viewers.EMFDiffNode; | ||
import org.eclipse.emf.diffmerge.ui.viewers.categories.AbstractDifferenceCategory; | ||
import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; | ||
import org.eclipse.swt.graphics.Image; | ||
import org.polarsys.kitalpha.vp.requirements.Requirements.Requirement; | ||
import org.polarsys.kitalpha.vp.requirements.Requirements.RequirementsPackage; | ||
import org.polarsys.kitalpha.vp.requirements.Requirements.provider.RequirementsEditPlugin; | ||
|
||
public class ReqIFTextCategory extends AbstractDifferenceCategory { | ||
|
||
/** ID of this category */ | ||
public static final String ID = "ReqVP.Text"; //$NON-NLS-1$ | ||
|
||
protected static final String REQUIREMENT_ICON_PATH = "full/obj16/Requirement.gif"; //$NON-NLS-1$ | ||
|
||
public ReqIFTextCategory() { | ||
super(); | ||
setActive(false); | ||
setInFocusMode(false); | ||
setVisible(true); | ||
setModifiable(true); | ||
} | ||
|
||
/** | ||
* @see org.eclipse.emf.diffmerge.ui.viewers.IDifferenceCategory#covers(org.eclipse.emf.diffmerge.api.diff.IDifference, | ||
* org.eclipse.emf.diffmerge.ui.viewers.EMFDiffNode) | ||
*/ | ||
public boolean covers(IDifference<?> difference_p, EMFDiffNode node_p) { | ||
boolean result = false; | ||
if (difference_p instanceof EAttributeValuePresence) { | ||
EAttributeValuePresence vp = (EAttributeValuePresence) difference_p; | ||
if (vp.getFeature() == RequirementsPackage.Literals.REQUIREMENT__REQ_IF_TEXT) { | ||
if (vp.eContainer() instanceof EMatch && ((EMatch) vp.eContainer()).getTarget() instanceof Requirement) { | ||
return true; | ||
} | ||
} | ||
} | ||
return result; | ||
} | ||
|
||
/** | ||
* @see org.eclipse.emf.diffmerge.ui.viewers.IDifferenceCategoryItem#getDescription(org.eclipse.emf.diffmerge.ui.viewers.EMFDiffNode) | ||
*/ | ||
@Override | ||
public String getDescription(EMFDiffNode node_p) { | ||
return Messages.Category_ReqIFText_Description; | ||
} | ||
|
||
/** | ||
* @see org.eclipse.emf.diffmerge.ui.viewers.IDifferenceCategory#getID() | ||
*/ | ||
@Override | ||
public String getID() { | ||
return ID; | ||
} | ||
|
||
/** | ||
* @see org.eclipse.emf.diffmerge.ui.viewers.categories.AbstractDifferenceCategoryItem#getImage(org.eclipse.emf.diffmerge.ui.viewers.EMFDiffNode) | ||
*/ | ||
@Override | ||
public Image getImage(EMFDiffNode node_p) { | ||
return ExtendedImageRegistry.getInstance() | ||
.getImage(RequirementsEditPlugin.getPlugin().getImage(REQUIREMENT_ICON_PATH)); // $NON-NLS-1$ | ||
} | ||
|
||
/** | ||
* @see org.eclipse.emf.diffmerge.ui.viewers.IDifferenceCategory#getText(org.eclipse.emf.diffmerge.ui.viewers.EMFDiffNode) | ||
*/ | ||
@Override | ||
public String getText(EMFDiffNode node_p) { | ||
return Messages.Categories_ReqIFText_Identifier; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters