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
kernel
Commits
4fad41da
Commit
4fad41da
authored
Mar 13, 2018
by
Filip Reaboi
Browse files
YELLOW
parent
b81cd9f5
Changes
7
Hide whitespace changes
Inline
Side-by-side
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/gef/.ratings
View file @
4fad41da
ConnectionCompositionDropTargetListener.java
ba861adbef5ca39644386be53826a939be5110a3 RED
ElementCompositionDropTargetListener.java
ab0fd4910f84790d72ec76ad20d8
75
4
20
19ed206 RED
ConnectionCompositionDropTargetListener.java
502736cffbe766ee4df5fec44e90b6d9d49584a8 YELLOW
ElementCompositionDropTargetListener.java
1fda888c2229eab3f20ea0d32be2
7520
eeed9519 YELLOW
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/gef/ConnectionCompositionDropTargetListener.java
View file @
4fad41da
...
...
@@ -25,7 +25,6 @@ import org.fortiss.tooling.kernel.service.IConnectionCompositorService;
import
org.fortiss.tooling.kernel.ui.dnd.CompositionServiceLocalDNDTransfer
;
import
org.fortiss.tooling.kernel.ui.dnd.ConnectionCompositionSource
;
// TODO(SB,6) (x2)
/**
* This class implements a drop target listener for {@link EditPartViewer}s,
* which creates {@link CreateConnectionCompositionRequest}s. The request
...
...
@@ -34,13 +33,10 @@ import org.fortiss.tooling.kernel.ui.dnd.ConnectionCompositionSource;
* which completes the DND operation with the target information. It then relays
* the completed DND operation to the {@link IConnectionCompositorService}.
* <p>
* This class mimics the behavior of the kernel's SWT-based
*
* {@link ConnectionCompositionDropTargetAdapter}, but uses the GEF abstraction
* {@link AbstractTransferDropTargetListener} super class.
*
* @see RelayCreateCommandEditPolicyBase
* @see ConnectionCompositionDropTargetAdapter
*
* @author hoelzl
*/
...
...
@@ -68,14 +64,12 @@ public class ConnectionCompositionDropTargetListener extends AbstractTransferDro
ConnectionCompositionSource
sourceData
=
null
;
if
(
getCurrentEvent
().
data
instanceof
ConnectionCompositionSource
)
{
sourceData
=
(
ConnectionCompositionSource
)
getCurrentEvent
().
data
;
// TODO(SB,20)
}
else
if
(
CompositionServiceLocalDNDTransfer
.
getInstance
().
getObject
()
instanceof
ConnectionCompositionSource
)
{
// there have been reports about SWT platform inconsistencies:
// on OSX getCurrentEvent().data might be null during dragging
// while it is not null on other platforms. Therefore, we use this
// fallback.
sourceData
=
// TODO(SB,20)
(
ConnectionCompositionSource
)
CompositionServiceLocalDNDTransfer
.
getInstance
()
.
getObject
();
}
...
...
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/gef/ElementCompositionDropTargetListener.java
View file @
4fad41da
...
...
@@ -25,7 +25,6 @@ import org.fortiss.tooling.kernel.service.IElementCompositorService;
import
org.fortiss.tooling.kernel.ui.dnd.CompositionServiceLocalDNDTransfer
;
import
org.fortiss.tooling.kernel.ui.dnd.ElementCompositionSource
;
// TODO(SB,6) (x2)
/**
* This class implements a drop target listener for {@link EditPartViewer}s,
* which creates {@link CreateElementCompositionRequest}s. The request contains
...
...
@@ -34,16 +33,14 @@ import org.fortiss.tooling.kernel.ui.dnd.ElementCompositionSource;
* the DND operation with the target information. It then relays the completed
* DND operation to the {@link IElementCompositorService}.
* <p>
* This class mimics the behavior of the kernel's SWT-based // TODO(SB,20)
*
* {@link ElementCompositionDropTargetAdapter}, but uses the GEF abstraction
* {@link AbstractTransferDropTargetListener} super class.
*
* @see RelayCreateCommandEditPolicyBase
* @see ElementCompositionDropTargetAdapter
*
* @author hoelzl
*/
public
class
ElementCompositionDropTargetListener
extends
AbstractTransferDropTargetListener
{
/** Constructor. */
...
...
@@ -67,13 +64,11 @@ public class ElementCompositionDropTargetListener extends AbstractTransferDropTa
ElementCompositionSource
sourceData
=
null
;
if
(
getCurrentEvent
().
data
instanceof
ElementCompositionSource
)
{
sourceData
=
(
ElementCompositionSource
)
getCurrentEvent
().
data
;
// TODO(SB,20)
}
else
if
(
CompositionServiceLocalDNDTransfer
.
getInstance
().
getObject
()
instanceof
ElementCompositionSource
)
{
// there have been reports about SWT platform inconsistencies:
// on OSX getCurrentEvent().data might be null during dragging
// while it is not null on other platforms. Therefore, we use this
// fallback.
// TODO(SB,20)
sourceData
=
(
ElementCompositionSource
)
CompositionServiceLocalDNDTransfer
.
getInstance
()
.
getObject
();
...
...
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/jface/.ratings
View file @
4fad41da
ViewerElementCompositionDropAdapter.java
7f3adb61b8e7caba17e501a7260f72853f995606 RED
ViewerElementCompositionDropAdapter.java
255646545e2c72055c1c090396525f21491f70e4 YELLOW
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/jface/ViewerElementCompositionDropAdapter.java
View file @
4fad41da
...
...
@@ -24,24 +24,18 @@ import org.eclipse.jface.viewers.TreeViewer;
import
org.eclipse.jface.viewers.Viewer
;
import
org.eclipse.jface.viewers.ViewerDropAdapter
;
import
org.eclipse.swt.dnd.DND
;
import
org.eclipse.swt.dnd.DropTargetAdapter
;
import
org.eclipse.swt.dnd.DropTargetEvent
;
import
org.eclipse.swt.dnd.Transfer
;
import
org.eclipse.swt.dnd.TransferData
;
import
org.fortiss.tooling.kernel.service.IElementCompositorService
;
import
org.fortiss.tooling.kernel.ui.dnd.CompositionServiceLocalDNDTransfer
;
import
org.fortiss.tooling.kernel.ui.util.DragAndDropUtils
;
//TODO(SB,6) (x2)
/**
* {@link ViewerDropAdapter} implementation for a JFace {@link TreeViewer}. This
* implementation mimics the behavior of SWT-based {@link ElementCompositionDropTargetAdapter}, but
* uses the JFace super class {@link ViewerDropAdapter} instead of SWT's {@link DropTargetAdapter}.
*
* @see ElementCompositionDropTargetAdapter
*
* {@link ViewerDropAdapter} implementation for a JFace {@link TreeViewer}.
*
* @author hoelzl
*/
public
class
ViewerElementCompositionDropAdapter
extends
ViewerDropAdapter
{
/** Remember the last target. */
...
...
@@ -77,15 +71,14 @@ public class ViewerElementCompositionDropAdapter extends ViewerDropAdapter {
public
boolean
performDrop
(
Object
data
)
{
if
(
lastTarget
instanceof
EObject
)
{
final
EObject
target
=
(
EObject
)
lastTarget
;
// TODO(SB,25)
final
EObject
dropped
=
DragAndDropUtils
.
extractDroppedEObject
(
data
);
// TODO(SB,20)
if
(
IElementCompositorService
.
getI
nstance
()
.
canCompose
(
target
,
dropped
,
null
))
{
final
EObject
dropped
=
extractDroppedEObject
(
data
);
IElementCompositorService
instance
=
IElementCompositorService
.
getInstance
();
if
(
i
nstance
.
canCompose
(
target
,
dropped
,
null
))
{
runAsCommand
(
target
,
new
Runnable
()
{
@Override
public
void
run
()
{
// TODO(SB,20)
IElementCompositorService
.
getInstance
().
compose
(
target
,
dropped
,
null
);
instance
.
compose
(
target
,
dropped
,
null
);
}
});
return
true
;
...
...
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/.ratings
View file @
4fad41da
...
...
@@ -7,4 +7,4 @@ DiagramKeyHandler.java 9c59eca862c9f878da7cbf7c220f26b38737095c GREEN
FormsEditorBase.java 50934d36124dea9b16ac45fe3621d878afb48bc7 GREEN
GEFEditorBase.java 7cc55eaf9c9ffa351b683512832273a4b54a3830 GREEN
StyledTextCellEditor.java 3e678e4e8dbadb8463201bc62e7a67003acae8a8 GREEN
TreeViewerEditorBase.java
8cff2f2c65d61d267513a787b76d991dda7ff317 GREEN
TreeViewerEditorBase.java
5d2f159b59a1785cf118ac95cf4ad99b475efbe2 YELLOW
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/TreeViewerEditorBase.java
View file @
4fad41da
...
...
@@ -38,6 +38,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.EditorBase;
*
* @author hoelzl
*/
public
abstract
class
TreeViewerEditorBase
<
T
extends
EObject
>
extends
EditorBase
<
T
>
{
/** Stores the {@link TreeViewer}. */
...
...
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