-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIPS-10909/FIPS-11520 :: Merge branch 'FIPS-10909' into main : Overri…
…ding of validation rules Change-Id: I683d7cb5dba22289eba7841dac9313db0accc74c
- Loading branch information
Showing
39 changed files
with
859 additions
and
237 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
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
63 changes: 63 additions & 0 deletions
63
...ls.core.ui/src/org/faktorips/devtools/core/ui/editors/pctype/rule/OverrideRuleDialog.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,63 @@ | ||
/******************************************************************************* | ||
* Copyright (c) Faktor Zehn GmbH - faktorzehn.org | ||
* | ||
* This source code is available under the terms of the AGPL Affero General Public License version | ||
* 3. | ||
* | ||
* Please see LICENSE.txt for full license terms, including the additional permissions and | ||
* restrictions as well as the possibility of alternative license terms. | ||
*******************************************************************************/ | ||
|
||
package org.faktorips.devtools.core.ui.editors.pctype.rule; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.swt.widgets.Shell; | ||
import org.faktorips.devtools.core.ui.editors.SelectSupertypeHierarchyPartsDialog; | ||
import org.faktorips.devtools.core.ui.editors.SupertypeHierarchyPartsContentProvider; | ||
import org.faktorips.devtools.core.ui.editors.pctype.Messages; | ||
import org.faktorips.devtools.model.ipsobject.IIpsObject; | ||
import org.faktorips.devtools.model.ipsobject.IIpsObjectPart; | ||
import org.faktorips.devtools.model.pctype.IPolicyCmptType; | ||
import org.faktorips.devtools.model.pctype.IValidationRule; | ||
|
||
/** | ||
* A dialog that enables the user to select {@link IValidationRule validation rules} to overwrite. | ||
*/ | ||
public class OverrideRuleDialog extends SelectSupertypeHierarchyPartsDialog<IValidationRule> { | ||
|
||
/** | ||
* @param policyCmptType The {@link IPolicyCmptType policy component type} to get the candidates to possibly overwrite from. | ||
* @param parent The {@link Shell} to show this dialog in. | ||
*/ | ||
public OverrideRuleDialog(IPolicyCmptType policyCmptType, Shell parent) { | ||
super(parent, new CandidatesContentProvider(policyCmptType)); | ||
setTitle(Messages.OverrideValidationRuleDialog_title); | ||
setEmptyListMessage(Messages.OverrideValidationRuleDialog_labelNoAttributes); | ||
setSelectLabelText(Messages.OverrideValidationRuleDialog_labelSelectAttribute); | ||
} | ||
|
||
/** Provides the {@link IValidationRule validation rules} available for selection. */ | ||
private static class CandidatesContentProvider extends SupertypeHierarchyPartsContentProvider { | ||
|
||
/** | ||
* @param policyCmptType The {@link IPolicyCmptType policy component type} the {@link IValidationRule validation rules} available for | ||
* selection belong to. | ||
*/ | ||
public CandidatesContentProvider(IPolicyCmptType policyCmptType) { | ||
super(policyCmptType); | ||
} | ||
|
||
@Override | ||
public List<? extends IIpsObjectPart> getAvailableParts(IIpsObject ipsObject) { | ||
IPolicyCmptType policyCmptType = (IPolicyCmptType)ipsObject; | ||
return policyCmptType.findOverrideValidationRuleCandidates(policyCmptType.getIpsProject()); | ||
} | ||
|
||
@Override | ||
protected List<? extends IIpsObject> getSupertypes(IIpsObject ipsObject) { | ||
IPolicyCmptType policyCmptType = (IPolicyCmptType)ipsObject; | ||
return policyCmptType.getSupertypeHierarchy().getAllSupertypes(policyCmptType); | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.