Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Docking
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Libraries
java
Docking
Commits
18ea4b8e
Commit
18ea4b8e
authored
11 years ago
by
GIRARDOT Raphael
Committed by
MADELA Patrick
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
view selection added, but does not work yet for vldocking (Jira JAVAAPI-132)
parent
81030127
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dockingvl/src/main/java/fr/soleil/docking/vl/view/VlDockView.java
+38
-11
38 additions, 11 deletions
...l/src/main/java/fr/soleil/docking/vl/view/VlDockView.java
with
38 additions
and
11 deletions
dockingvl/src/main/java/fr/soleil/docking/vl/view/VlDockView.java
+
38
−
11
View file @
18ea4b8e
...
@@ -13,7 +13,6 @@ import java.awt.Container;
...
@@ -13,7 +13,6 @@ import java.awt.Container;
import
java.awt.event.FocusEvent
;
import
java.awt.event.FocusEvent
;
import
java.awt.event.FocusListener
;
import
java.awt.event.FocusListener
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
import
javax.swing.Icon
;
import
javax.swing.Icon
;
...
@@ -39,19 +38,18 @@ public class VlDockView implements IView, Dockable, DockingActionListener, Focus
...
@@ -39,19 +38,18 @@ public class VlDockView implements IView, Dockable, DockingActionListener, Focus
protected
SoleilDockingDesktop
dockingDesktop
;
protected
SoleilDockingDesktop
dockingDesktop
;
protected
List
<
IViewListener
>
viewListeners
;
protected
List
<
IViewListener
>
viewListeners
;
public
VlDockView
(
String
title
,
Icon
icon
,
Component
component
,
Object
id
)
{
public
VlDockView
(
String
title
,
Icon
icon
,
Component
component
,
Object
id
)
{
this
.
title
=
title
;
this
.
title
=
title
;
this
.
icon
=
icon
;
this
.
icon
=
icon
;
this
.
component
=
component
;
this
.
component
=
component
;
this
.
id
=
id
;
this
.
id
=
id
;
if
(
id
instanceof
String
){
if
(
id
instanceof
String
)
{
String
stringId
=
(
String
)
id
;
String
stringId
=
(
String
)
id
;
this
.
key
=
new
DockKey
(
stringId
,
title
,
title
,
icon
);
this
.
key
=
new
DockKey
(
stringId
,
title
,
title
,
icon
);
}
else
{
}
else
{
this
.
key
=
new
DockKey
(
title
,
title
,
title
,
icon
);
this
.
key
=
new
DockKey
(
title
,
title
,
title
,
icon
);
}
}
this
.
viewListeners
=
new
ArrayList
<
IViewListener
>();
this
.
viewListeners
=
new
ArrayList
<
IViewListener
>();
this
.
component
.
addFocusListener
(
this
);
this
.
component
.
addFocusListener
(
this
);
}
}
...
@@ -91,14 +89,46 @@ public class VlDockView implements IView, Dockable, DockingActionListener, Focus
...
@@ -91,14 +89,46 @@ public class VlDockView implements IView, Dockable, DockingActionListener, Focus
this
.
visible
=
visible
;
this
.
visible
=
visible
;
if
(
visible
)
{
if
(
visible
)
{
dockingDesktop
.
showDockable
(
this
);
dockingDesktop
.
showDockable
(
this
);
}
}
else
{
else
{
dockingDesktop
.
close
(
this
);
dockingDesktop
.
close
(
this
);
}
}
component
.
setVisible
(
visible
);
component
.
setVisible
(
visible
);
component
.
setEnabled
(
visible
);
component
.
setEnabled
(
visible
);
}
}
@Override
public
void
select
()
{
setVisible
(
true
);
// TODO marche pas !!!!!!
System
.
out
.
println
(
getTitle
()
+
" requestFocus()"
);
component
.
requestFocus
();
focusGained
(
new
FocusEvent
(
component
,
FocusEvent
.
FOCUS_GAINED
));
// focus(component);
}
protected
static
boolean
focus
(
Component
comp
)
{
boolean
focused
=
false
;
if
(
comp
!=
null
)
{
if
(
comp
.
isVisible
()
&&
comp
.
isShowing
())
{
if
(
comp
.
isFocusable
())
{
comp
.
requestFocus
();
focused
=
true
;
}
else
if
(
comp
instanceof
Container
)
{
Container
container
=
(
Container
)
comp
;
for
(
Component
child
:
container
.
getComponents
())
{
if
(
focus
(
child
))
{
break
;
}
}
}
}
else
{
comp
.
setVisible
(
true
);
}
}
return
focused
;
}
@Override
@Override
public
String
getTitle
()
{
public
String
getTitle
()
{
return
title
;
return
title
;
...
@@ -204,9 +234,7 @@ public class VlDockView implements IView, Dockable, DockingActionListener, Focus
...
@@ -204,9 +234,7 @@ public class VlDockView implements IView, Dockable, DockingActionListener, Focus
if
(
event
.
getActionType
()
==
DockingActionEvent
.
ACTION_CLOSE
)
{
if
(
event
.
getActionType
()
==
DockingActionEvent
.
ACTION_CLOSE
)
{
Dockable
closedDockable
=
((
DockingActionCloseEvent
)
event
).
getDockable
();
Dockable
closedDockable
=
((
DockingActionCloseEvent
)
event
).
getDockable
();
if
(
getDockKey
().
getKey
().
equals
(
closedDockable
.
getDockKey
().
getKey
()))
{
if
(
getDockKey
().
getKey
().
equals
(
closedDockable
.
getDockKey
().
getKey
()))
{
for
(
Iterator
<
IViewListener
>
listenersIterator
=
viewListeners
.
iterator
();
listenersIterator
for
(
IViewListener
listener
:
viewListeners
)
{
.
hasNext
();)
{
IViewListener
listener
=
listenersIterator
.
next
();
listener
.
viewClosed
();
listener
.
viewClosed
();
}
}
}
}
...
@@ -225,4 +253,3 @@ public class VlDockView implements IView, Dockable, DockingActionListener, Focus
...
@@ -225,4 +253,3 @@ public class VlDockView implements IView, Dockable, DockingActionListener, Focus
// Not managed.
// Not managed.
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment