Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
9d29ba7a
Commit
9d29ba7a
authored
Aug 01, 2012
by
Sabine Teufl
Browse files
Unnecessary sorting removed
refs 691
parent
29a2aa87
Changes
3
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.mira.ui/trunk/src/org/fortiss/af3/mira/ui/action/ConvertRequirementAction.java
View file @
9d29ba7a
...
...
@@ -19,7 +19,6 @@ package org.fortiss.af3.mira.ui.action;
import
static
org
.
eclipse
.
emf
.
ecore
.
util
.
EcoreUtil
.
delete
;
import
org.fortiss.af3.mira.command.SortRequirementCommand
;
import
org.fortiss.af3.mira.model.Requirement
;
import
org.fortiss.af3.mira.model.usecase.UseCase
;
import
org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService
;
...
...
@@ -30,7 +29,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService;
* @author wenwenchen
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating
GREEN
Hash:
412DB193A57014EAA1BAA839F1A11B38
* @ConQAT.Rating
YELLOW
Hash:
78B1BDF55DDC14001C780E4BC3A5C0C1
*/
public
class
ConvertRequirementAction
implements
Runnable
{
...
...
@@ -74,7 +73,6 @@ public class ConvertRequirementAction implements Runnable {
newReq
.
getContainedElementsList
().
addAll
(
oldReq
.
getFormalSpecifications
());
oldReq
.
getAnalysis
().
getContainedElementsList
().
add
(
newReq
);
new
SortRequirementCommand
(
oldReq
.
getAnalysis
()).
run
();
delete
(
oldReq
,
true
);
...
...
org.fortiss.af3.mira.ui/trunk/src/org/fortiss/af3/mira/ui/editor/RequirementEditor.java
View file @
9d29ba7a
...
...
@@ -48,7 +48,6 @@ import org.eclipse.core.databinding.UpdateListStrategy;
import
org.eclipse.core.databinding.observable.ChangeEvent
;
import
org.eclipse.core.databinding.observable.IChangeListener
;
import
org.eclipse.core.databinding.observable.map.IObservableMap
;
import
org.eclipse.core.databinding.observable.value.IObservableValue
;
import
org.eclipse.emf.databinding.EMFObservables
;
import
org.eclipse.jface.databinding.viewers.ObservableListContentProvider
;
import
org.eclipse.jface.fieldassist.ControlDecoration
;
...
...
@@ -87,7 +86,6 @@ import org.eclipse.ui.PartInitException;
import
org.eclipse.ui.forms.widgets.ScrolledForm
;
import
org.fortiss.af3.mira.command.CreateRelationCommand
;
import
org.fortiss.af3.mira.command.DeleteRelationCommand
;
import
org.fortiss.af3.mira.command.SortRequirementCommand
;
import
org.fortiss.af3.mira.model.Analysis
;
import
org.fortiss.af3.mira.model.Requirement
;
import
org.fortiss.af3.mira.model.RequirementPriority
;
...
...
@@ -116,7 +114,7 @@ import org.fortiss.tooling.base.ui.editor.FormsEditorBase;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating
GREEN
Hash:
D60773A24DA9CE7BEF81DAD59905C982
* @ConQAT.Rating
YELLOW
Hash:
7BDF9D593584B95D03507376F91913E1
*/
public
class
RequirementEditor
<
T
extends
Requirement
>
extends
FormsEditorBase
<
T
>
{
...
...
@@ -140,9 +138,6 @@ public class RequirementEditor<T extends Requirement> extends FormsEditorBase<T>
protected
static
GridDataFactory
fillControlFactory
=
GridDataFactory
.
swtDefaults
()
.
align
(
SWT
.
FILL
,
SWT
.
FILL
).
grab
(
true
,
true
).
hint
(
SWT
.
DEFAULT
,
200
);
/** id observable */
protected
IObservableValue
idObservable
;
/**
* Listener connected to the observable word rule of the scanner associated
* to the corresponding analysis
...
...
@@ -160,14 +155,6 @@ public class RequirementEditor<T extends Requirement> extends FormsEditorBase<T>
public
void
init
(
IEditorSite
site
,
IEditorInput
input
)
throws
PartInitException
{
super
.
init
(
site
,
input
);
idObservable
=
observeValue
(
editedObject
,
REQUIREMENT__REQ_ID
);
idObservable
.
addChangeListener
(
new
IChangeListener
()
{
@Override
public
void
handleChange
(
ChangeEvent
event
)
{
executeCommand
(
new
SortRequirementCommand
(
editedObject
.
getAnalysis
()));
}
});
registeredSourceViewers
=
new
ArrayList
<
SourceViewer
>();
createUpdateListener
();
...
...
@@ -181,9 +168,6 @@ public class RequirementEditor<T extends Requirement> extends FormsEditorBase<T>
wordRuleUpdateListener
);
wordRuleUpdateListener
=
null
;
idObservable
.
dispose
();
idObservable
=
null
;
super
.
dispose
();
}
...
...
org.fortiss.af3.mira/trunk/src/org/fortiss/af3/mira/command/SortRequirementCommand.java
deleted
100644 → 0
View file @
29a2aa87
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2011 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package
org.fortiss.af3.mira.command
;
import
static
org
.
eclipse
.
emf
.
common
.
util
.
ECollections
.
sort
;
import
org.fortiss.af3.mira.model.Analysis
;
import
org.fortiss.af3.mira.utils.MiraUtils
;
/**
* Sort the requirements according to their ID
*
* @author mou
* @author uden
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: BA1740CC20B34CFFE5AB11826CBA7B9A
*/
public
class
SortRequirementCommand
implements
Runnable
{
/** The root container analysis */
private
Analysis
analysis
;
/**
* Constructor.
*
* @param analysis
* the analysis, whose requirements will be sorted
*/
public
SortRequirementCommand
(
Analysis
analysis
)
{
super
();
this
.
analysis
=
analysis
;
}
/** {@inheritDoc} */
@Override
public
void
run
()
{
// getRequirement() can not be used here, because this list is read-only
// and not safe for writing back to the model
sort
(
analysis
.
getContainedElementsList
(),
MiraUtils
.
getComparator
());
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment