Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
af3
kernel
Commits
e4bdee5c
Commit
e4bdee5c
authored
7 years ago
by
Simon Barner
Browse files
Options
Downloads
Patches
Plain Diff
YELLOW
Use more meaningful and consistent names. refs 2983
parent
554491fc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ContextMenuService.java
+13
-15
13 additions, 15 deletions
...ortiss/tooling/kernel/ui/internal/ContextMenuService.java
with
13 additions
and
15 deletions
org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ContextMenuService.java
+
13
−
15
View file @
e4bdee5c
...
...
@@ -55,7 +55,7 @@ import org.osgi.framework.Bundle;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating
RED
Hash:
969C09685510F14D66CFB9033A1CD405
* @ConQAT.Rating
YELLOW
Hash:
0D786B30091245516387B38B30C5828E
*/
public
class
ContextMenuService
implements
IContextMenuService
,
IIntrospectiveKernelService
{
/** The singleton service instance. */
...
...
@@ -76,10 +76,8 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe
/** The model element handler class attribute name. */
private
static
final
String
HANDLER_CLASS_ATTRIBUTE_NAME
=
"contributor"
;
// TODO(VA) I think the following comment is wrong: it's not about prototypes here, see below as
// well.
/** Stores the registered prototype providers. */
private
final
List
<
IContextMenuContributor
>
providerList
=
/** Stores the registered context menu contributors. */
private
final
List
<
IContextMenuContributor
>
contextMenuContributorList
=
new
ArrayList
<
IContextMenuContributor
>();
/** Initializes the service. */
...
...
@@ -89,14 +87,14 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe
/** Starts the service. */
public
void
startService
()
{
setup
Provide
rs
();
setup
ContextMenuContributo
rs
();
IKernelIntrospectionSystemService
.
getInstance
().
registerService
(
this
);
}
/** Registers the given contributor with the service. */
/** Registers the given
context menu
contributor with the service. */
@Override
public
void
registerContextMenuContributor
(
IContextMenuContributor
contributor
)
{
provide
rList
.
add
(
contributor
);
contextMenuContributo
rList
.
add
(
contributor
);
}
/** {@inheritDoc} */
...
...
@@ -120,8 +118,8 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe
return
menuManager
;
}
/** Initializes the
prototype list
from plugin extensions. */
private
void
setup
Provide
rs
()
{
/** Initializes the
context menu contributors
from plugin extensions. */
private
void
setup
ContextMenuContributo
rs
()
{
for
(
IConfigurationElement
ce
:
ExtensionPointUtils
.
getConfigurationElements
(
EXTENSION_POINT_NAME
,
CONFIGURATION_ELEMENT_NAME
))
{
Bundle
bundle
=
ExtensionPointUtils
.
getBundle
(
ce
);
...
...
@@ -130,9 +128,9 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe
ExtensionPointUtils
.
loadClass
(
ce
.
getAttribute
(
HANDLER_CLASS_ATTRIBUTE_NAME
),
bundle
);
IContextMenuContributor
provide
r
=
IContextMenuContributor
contextMenuContributo
r
=
(
IContextMenuContributor
)
handlerClass
.
getConstructor
().
newInstance
();
providerList
.
add
(
provide
r
);
contextMenuContributorList
.
add
(
contextMenuContributo
r
);
}
catch
(
Exception
ex
)
{
LoggingUtils
.
error
(
ToolingKernelActivator
.
getDefault
(),
ex
.
getMessage
(),
ex
);
}
...
...
@@ -195,7 +193,7 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe
private
void
singleSelectionElementContributions
(
IMenuManager
menu
,
ContextMenuContextProvider
contextProvider
)
{
EObject
selectionElem
=
contextProvider
.
getSelectedModelElement
();
for
(
IContextMenuContributor
contributor
:
provide
rList
)
{
for
(
IContextMenuContributor
contributor
:
contextMenuContributo
rList
)
{
String
menuSectionID
=
contributor
.
getMenuSectionID
();
if
(
menuSectionID
==
null
)
{
menuSectionID
=
IWorkbenchActionConstants
.
MB_ADDITIONS
;
...
...
@@ -229,7 +227,7 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe
/** Populates the menu with contributions to multiple model element selection. */
private
void
addMultiSelectionContributions
(
IMenuManager
menu
,
ContextMenuContextProvider
contextProvider
,
List
<
EObject
>
selection
)
{
for
(
IContextMenuContributor
contributor
:
provide
rList
)
{
for
(
IContextMenuContributor
contributor
:
contextMenuContributo
rList
)
{
if
(
contributor
instanceof
IContextMenuMultiSelectionContributor
)
{
IContextMenuMultiSelectionContributor
multicontributor
=
(
IContextMenuMultiSelectionContributor
)
contributor
;
...
...
@@ -286,6 +284,6 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe
/** {@inheritDoc} */
@Override
public
IIntrospectionDetailsItem
getDetailsItem
()
{
return
new
ContextMenuServiceIntrospectionDetailsItem
(
provide
rList
);
return
new
ContextMenuServiceIntrospectionDetailsItem
(
contextMenuContributo
rList
);
}
}
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