Skip to content
GitLab
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
7c84a6d8
Commit
7c84a6d8
authored
Dec 05, 2016
by
Florian Hölzl
Browse files
Hand cursor showing on hovering of editpart's figure.
refs 2646
parent
60b1c19e
Changes
1
Hide whitespace changes
Inline
Side-by-side
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ElementEditPartBase.java
View file @
7c84a6d8
...
...
@@ -36,7 +36,9 @@ import org.eclipse.gef.RequestConstants;
import
org.eclipse.gef.SnapToHelper
;
import
org.eclipse.jface.resource.JFaceResources
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.graphics.Cursor
;
import
org.eclipse.swt.graphics.Font
;
import
org.eclipse.swt.widgets.Display
;
import
org.fortiss.tooling.base.layout.DefaultLayoutConstants
;
import
org.fortiss.tooling.base.model.layout.ILayoutedModelElement
;
import
org.fortiss.tooling.base.ui.editpart.figure.TransparentLabel
;
...
...
@@ -59,15 +61,19 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating
GREEN
Hash:
5823EF473EB92F258B289FCBFB348A73
* @ConQAT.Rating
YELLOW
Hash:
9B37C81B6D5E2B0B8BF025432FAEEF7E
*/
public
abstract
class
ElementEditPartBase
<
T
extends
ILayoutedModelElement
&
INamedCommentedElement
>
extends
PositionedEditPartBase
<
T
>
{
/** The global hand cursor resource. */
private
static
Cursor
HAND_CURSOR
=
new
Cursor
(
Display
.
getCurrent
(),
SWT
.
CURSOR_HAND
);
/** The default font for titles. */
public
static
Font
DEFAULT_TITLE_FONT
=
FontUtils
.
derive
(
JFaceResources
.
getDefaultFont
(),
0
,
SWT
.
BOLD
);
/** The cursor set before entering this edit part's figure. */
private
Cursor
cursor
;
/** Constructor. */
protected
ElementEditPartBase
(
T
modelObject
)
{
super
(
modelObject
);
...
...
@@ -169,4 +175,28 @@ public abstract class ElementEditPartBase<T extends ILayoutedModelElement & INam
}
return
super
.
getAdapter
(
adapter
);
}
/** {@inheritDoc} */
@Override
public
void
showTargetFeedback
(
Request
request
)
{
super
.
showTargetFeedback
(
request
);
if
(
getFigure
()
!=
null
)
{
cursor
=
getFigure
().
getCursor
();
getFigure
().
setCursor
(
HAND_CURSOR
);
}
}
/** {@inheritDoc} */
@Override
public
void
eraseTargetFeedback
(
Request
request
)
{
if
(
getFigure
()
!=
null
)
{
getFigure
().
setCursor
(
cursor
);
}
super
.
eraseTargetFeedback
(
request
);
}
/** Determines whether the hand cursor should be displayed on hovering the edit part's figure. */
protected
boolean
showHandCursorOnHover
()
{
return
true
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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