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
35f35139
Commit
35f35139
authored
Jul 16, 2012
by
Chen Wenwen
Browse files
revert
parent
8059ce51
Changes
1
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.mira.ui/trunk/src/org/fortiss/af3/mira/ui/editor/RequirementEditor.java
View file @
35f35139
...
...
@@ -27,6 +27,7 @@ import static org.fortiss.af3.mira.model.MiraPackage.Literals.REQUIREMENT__REQ_I
import
static
org
.
fortiss
.
af3
.
mira
.
model
.
MiraPackage
.
Literals
.
REQUIREMENT__SOURCES
;
import
static
org
.
fortiss
.
af3
.
mira
.
model
.
MiraPackage
.
Literals
.
REQUIREMENT__STATUS
;
import
static
org
.
fortiss
.
af3
.
mira
.
model
.
MiraPackage
.
Literals
.
REQUIREMENT__TODO
;
import
static
org
.
fortiss
.
af3
.
mira
.
model
.
MiraPackage
.
Literals
.
REQUIREMENT__TYPE
;
import
static
org
.
fortiss
.
af3
.
mira
.
ui
.
editor
.
glossary
.
ScannerManager
.
getScanner
;
import
static
org
.
fortiss
.
tooling
.
base
.
model
.
element
.
ElementPackage
.
Literals
.
IHIERARCHIC_ELEMENT_CONTAINER__CONTAINED_ELEMENTS
;
import
static
org
.
fortiss
.
tooling
.
base
.
model
.
element
.
ElementPackage
.
Literals
.
IHIERARCHIC_ELEMENT__CONNECTIONS
;
...
...
@@ -55,11 +56,8 @@ import org.eclipse.jface.text.IRegion;
import
org.eclipse.jface.text.source.SourceViewer
;
import
org.eclipse.jface.viewers.ArrayContentProvider
;
import
org.eclipse.jface.viewers.ComboViewer
;
import
org.eclipse.jface.viewers.ISelectionChangedListener
;
import
org.eclipse.jface.viewers.IStructuredSelection
;
import
org.eclipse.jface.viewers.LabelProvider
;
import
org.eclipse.jface.viewers.SelectionChangedEvent
;
import
org.eclipse.jface.viewers.StructuredSelection
;
import
org.eclipse.jface.viewers.TableViewer
;
import
org.eclipse.jface.viewers.TableViewerColumn
;
import
org.eclipse.jface.viewers.Viewer
;
...
...
@@ -92,8 +90,6 @@ import org.fortiss.af3.mira.model.RequirementStatus;
import
org.fortiss.af3.mira.model.RequirementType
;
import
org.fortiss.af3.mira.model.glossary.Glossary
;
import
org.fortiss.af3.mira.relation.IRelationService
;
import
org.fortiss.af3.mira.ui.action.ChangeRequirementToUseCase
;
import
org.fortiss.af3.mira.ui.action.ChangeUseCaseToRequirement
;
import
org.fortiss.af3.mira.ui.action.CreateGlossaryEntryAction
;
import
org.fortiss.af3.mira.ui.action.ExportReportAction
;
import
org.fortiss.af3.mira.ui.action.ExportReportSummarizationAction
;
...
...
@@ -259,49 +255,54 @@ public class RequirementEditor<T extends Requirement> extends FormsEditorBase<T>
toolkit
.
adapt
(
typeInput
.
getCombo
());
typeInput
.
setContentProvider
(
new
ArrayContentProvider
());
typeInput
.
setLabelProvider
(
new
LabelProvider
());
char
[]
c
=
editedObject
.
eClass
().
getName
().
toCharArray
();
// zu kompliziert, aber es mir
// keine andere Wahl bleibt,
// weil
// editedObject.eClass().getName()).equals("Requirement")
// funktioniert nicht
//
char[] c = editedObject.eClass().getName().toCharArray(); // zu kompliziert, aber es mir
// keine andere Wahl bleibt,
// weil
// editedObject.eClass().getName()).equals("Requirement")
// funktioniert nicht
typeInput
.
setInput
(
RequirementType
.
VALUES
);
if
(
c
[
0
]
==
'R'
)
{
typeInput
.
setSelection
(
new
StructuredSelection
(
typeInput
.
getElementAt
(
0
)));
}
else
typeInput
.
setSelection
(
new
StructuredSelection
(
typeInput
.
getElementAt
(
1
)));
typeInput
.
addSelectionChangedListener
(
new
ISelectionChangedListener
()
{
@Override
public
void
selectionChanged
(
SelectionChangedEvent
event
)
{
char
[]
c
=
editedObject
.
eClass
().
getName
().
toCharArray
();
if
(
c
[
0
]
==
'R'
)
{
executeCommand
(
new
ChangeRequirementToUseCase
(
editedObject
));
}
else
{
/**
* int option =
* JOptionPane
* .showConfirmDialog(
* null,
* "Changing the requirements type deletes all information\n"
* + "that is not contained in the new requirements type!\n Continue?",
* "warnung", JOptionPane.YES_NO_OPTION);
*
* if(option == JOptionPane.YES_OPTION) {
* System.out.println("ich musst change to Requirement");
* } else {
* System.out.print("I don't want to change");
* typeInput.setSelection(new StructuredSelection(typeInput.getElementAt(1)));
*
* // System.out.println("r " + r.eClass().getName());
*/
executeCommand
(
new
ChangeUseCaseToRequirement
<
T
>(
editedObject
));
// System.out.println("editedObject " + editedObject.eClass().getName());
}
}
});
dbc
.
bindValue
(
observeSinglePostSelection
(
typeInput
),
observeValue
(
editedObject
,
REQUIREMENT__TYPE
));
/*
* if(c[0] == 'R') {
* typeInput.setSelection(new StructuredSelection(typeInput.getElementAt(0)));
* } else
* typeInput.setSelection(new StructuredSelection(typeInput.getElementAt(1)));
* typeInput.addSelectionChangedListener(new ISelectionChangedListener() {
*
* @Override
* public void selectionChanged(SelectionChangedEvent event) {
*
* char[] c = editedObject.eClass().getName().toCharArray();
* if(c[0] == 'R') {
* executeCommand(new ChangeRequirementToUseCase(editedObject));
* } else {
* /**
* int option =
* JOptionPane
* .showConfirmDialog(
* null,
* "Changing the requirements type deletes all information\n"
* + "that is not contained in the new requirements type!\n Continue?",
* "warnung", JOptionPane.YES_NO_OPTION);
*
* if(option == JOptionPane.YES_OPTION) {
* System.out.println("ich musst change to Requirement");
* } else {
* System.out.print("I don't want to change");
* typeInput.setSelection(new StructuredSelection(typeInput.getElementAt(1)));
*
* // System.out.println("r " + r.eClass().getName());
*/
/*
* executeCommand(new ChangeUseCaseToRequirement<T>(editedObject));
* // System.out.println("editedObject " + editedObject.eClass().getName());
* }
* }
*
* });
*/
/* edit Requirement Title */
Label
titleLabel
=
toolkit
.
createLabel
(
generalComposite
,
"Title "
,
SWT
.
READ_ONLY
);
singleLineLabelFactory
.
applyTo
(
titleLabel
);
...
...
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