Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vdt-plugin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
vdt-plugin
Commits
216443b3
Commit
216443b3
authored
Jan 20, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Continue with tool launch menus
parent
e52ad884
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
116 additions
and
48 deletions
+116
-48
XMLConfig.java
src/com/elphel/vdt/core/tools/config/xml/XMLConfig.java
+59
-32
Tool.java
src/com/elphel/vdt/core/tools/params/Tool.java
+6
-2
RunFor.java
src/com/elphel/vdt/core/tools/params/types/RunFor.java
+24
-2
DesignFlowView.java
src/com/elphel/vdt/ui/views/DesignFlowView.java
+25
-10
IVerilog.xml
tools/Verilog/IVerilog.xml
+2
-2
No files found.
src/com/elphel/vdt/core/tools/config/xml/XMLConfig.java
View file @
216443b3
...
...
@@ -104,6 +104,13 @@ public class XMLConfig extends Config {
static
final
String
CONTEXT_TOOL_ACTION_TAG
=
"action"
;
static
final
String
CONTEXT_TOOL_ACTION_LABEL
=
"label"
;
static
final
String
CONTEXT_TOOL_ACTION_RESOURCE
=
"resource"
;
static
final
String
CONTEXT_TOOL_ACTION_CHECK_EXTENSION
=
"check-extension"
;
static
final
String
CONTEXT_TOOL_ACTION_CHECK_EXISTENCE
=
"check-existence"
;
static
final
String
CONTEXT_TOOL_DFLT_ACTION_LABEL
=
"Run for"
;
static
final
String
CONTEXT_TOOL_DFLT_ACTION_RESOURCE
=
"%%CurrentFile"
;
static
final
String
CONTEXT_TOOL_DFLT_ACTION_CHECK_EXTENSION
=
"true"
;
static
final
String
CONTEXT_TOOL_DFLT_ACTION_CHECK_EXISTENCE
=
"false"
;
static
final
String
CONTEXT_TOOL_EXTENSION_MASK_ATTR
=
"mask"
;
static
final
String
CONTEXT_TOOL_SYNTAX_ERRORS
=
"errors"
;
...
...
@@ -957,38 +964,58 @@ public class XMLConfig extends Config {
return
extList
;
}
private
List
<
RunFor
>
readToolRunForList
(
Node
toolNode
,
String
toolName
)
throws
ConfigException
{
String
toolInfo
=
"Tool '"
+
toolName
+
"'"
;
List
<
RunFor
>
runForList
=
new
ArrayList
<
RunFor
>();
List
<
Node
>
runForNodesList
=
findChildNodes
(
toolNode
,
CONTEXT_TOOL_ACTION_LIST_TAG
);
if
(
runForNodesList
.
isEmpty
())
return
null
;
if
(
runForNodesList
.
size
()
>
1
)
throw
new
ConfigException
(
toolInfo
+
" definition cannot contain several '"
+
CONTEXT_OUTPUT_SECTION_TAG
+
"' nodes"
);
Node
runForNode
=
runForNodesList
.
get
(
0
);
List
<
Node
>
runForNodes
=
findChildNodes
(
runForNode
,
CONTEXT_TOOL_ACTION_TAG
);
for
(
Iterator
<
Node
>
n
=
runForNodes
.
iterator
();
n
.
hasNext
();)
{
Node
node
=
(
Node
)
n
.
next
();
String
label
=
getAttributeValue
(
node
,
CONTEXT_TOOL_ACTION_LABEL
);
if
(
label
==
null
)
throw
new
ConfigException
(
toolInfo
+
": Attribute '"
+
CONTEXT_TOOL_ACTION_LABEL
+
"' is absent"
);
String
resource
=
getAttributeValue
(
node
,
CONTEXT_TOOL_ACTION_RESOURCE
);
if
(
resource
==
null
)
throw
new
ConfigException
(
toolInfo
+
": Attribute '"
+
CONTEXT_TOOL_ACTION_RESOURCE
+
"' is absent"
);
runForList
.
add
(
new
RunFor
(
label
,
resource
));
}
return
runForList
;
private
List
<
RunFor
>
readToolRunForList
(
Node
toolNode
,
String
toolName
)
throws
ConfigException
{
String
toolInfo
=
"Tool '"
+
toolName
+
"'"
;
List
<
RunFor
>
runForList
=
new
ArrayList
<
RunFor
>();
List
<
Node
>
runForNodesList
=
findChildNodes
(
toolNode
,
CONTEXT_TOOL_ACTION_LIST_TAG
);
if
(
runForNodesList
.
isEmpty
())
{
runForList
.
add
(
new
RunFor
(
CONTEXT_TOOL_DFLT_ACTION_LABEL
,
CONTEXT_TOOL_DFLT_ACTION_RESOURCE
,
getBoolAttrValue
(
CONTEXT_TOOL_DFLT_ACTION_CHECK_EXTENSION
),
getBoolAttrValue
(
CONTEXT_TOOL_DFLT_ACTION_CHECK_EXISTENCE
)));
}
else
{
if
(
runForNodesList
.
size
()
>
1
)
throw
new
ConfigException
(
toolInfo
+
" definition cannot contain several '"
+
CONTEXT_TOOL_ACTION_LIST_TAG
+
"' nodes"
);
Node
runForNode
=
runForNodesList
.
get
(
0
);
List
<
Node
>
runForNodes
=
findChildNodes
(
runForNode
,
CONTEXT_TOOL_ACTION_TAG
);
for
(
Iterator
<
Node
>
n
=
runForNodes
.
iterator
();
n
.
hasNext
();)
{
Node
node
=
(
Node
)
n
.
next
();
String
label
=
getAttributeValue
(
node
,
CONTEXT_TOOL_ACTION_LABEL
);
if
(
label
==
null
)
label
=
CONTEXT_TOOL_DFLT_ACTION_LABEL
;
String
resource
=
getAttributeValue
(
node
,
CONTEXT_TOOL_ACTION_RESOURCE
);
if
(
resource
==
null
)
resource
=
CONTEXT_TOOL_DFLT_ACTION_RESOURCE
;
String
checkExtensionAttr
=
getAttributeValue
(
node
,
CONTEXT_TOOL_ACTION_CHECK_EXTENSION
);
if
(
checkExtensionAttr
==
null
){
checkExtensionAttr
=
CONTEXT_TOOL_DFLT_ACTION_CHECK_EXTENSION
;
}
checkBoolAttr
(
checkExtensionAttr
,
CONTEXT_TOOL_ACTION_CHECK_EXTENSION
);
boolean
checkExtension
=
getBoolAttrValue
(
checkExtensionAttr
);
String
checkExistenceAttr
=
getAttributeValue
(
node
,
CONTEXT_TOOL_ACTION_CHECK_EXISTENCE
);
if
(
checkExistenceAttr
==
null
){
checkExistenceAttr
=
CONTEXT_TOOL_DFLT_ACTION_CHECK_EXISTENCE
;
}
checkBoolAttr
(
checkExistenceAttr
,
CONTEXT_TOOL_ACTION_CHECK_EXISTENCE
);
boolean
checkExistence
=
getBoolAttrValue
(
checkExistenceAttr
);
runForList
.
add
(
new
RunFor
(
label
,
resource
,
checkExtension
,
checkExistence
));
}
}
return
runForList
;
}
private
List
<
Parameter
>
readParameters
(
Node
node
,
Context
context
)
...
...
src/com/elphel/vdt/core/tools/params/Tool.java
View file @
216443b3
...
...
@@ -83,7 +83,7 @@ public class Tool extends Context implements Cloneable, Inheritable {
params
,
paramGroups
,
commandLinesBlocks
);
this
.
runfor
=
runfor
;
this
.
runfor
=
runfor
;
// should it be cloned?
this
.
baseToolName
=
baseToolName
;
this
.
label
=
label
;
this
.
parentPackageName
=
parentPackageName
;
...
...
@@ -264,7 +264,11 @@ public class Tool extends Context implements Cloneable, Inheritable {
assert
((
resources
==
null
)
||
(
resources
.
size
()
==
1
));
resource
=
resources
.
get
(
0
);
}
actualActions
[
i
]
=
new
RunFor
(
labels
.
get
(
0
),
resource
);
actualActions
[
i
]
=
new
RunFor
(
labels
.
get
(
0
),
resource
,
runfor
.
get
(
i
).
getCheckExtension
(),
runfor
.
get
(
i
).
getCheckExistence
());
}
return
actualActions
;
}
...
...
src/com/elphel/vdt/core/tools/params/types/RunFor.java
View file @
216443b3
...
...
@@ -18,17 +18,39 @@
package
com
.
elphel
.
vdt
.
core
.
tools
.
params
.
types
;
public
class
RunFor
{
public
class
RunFor
implements
Cloneable
{
public
String
label
;
public
String
resource
;
public
RunFor
(
String
label
,
String
resource
){
public
boolean
checkExtension
;
public
boolean
checkExistence
;
public
RunFor
(
String
label
,
String
resource
,
boolean
checkExtension
,
boolean
checkExistence
){
this
.
label
=
label
;
this
.
resource
=
resource
;
this
.
checkExtension
=
checkExtension
;
this
.
checkExistence
=
checkExistence
;
}
public
RunFor
(
RunFor
runFor
){
this
(
runFor
.
label
,
runFor
.
resource
,
runFor
.
checkExtension
,
runFor
.
checkExistence
);
}
public
String
getLabel
(){
return
label
;
}
public
String
getResource
(){
return
resource
;
}
public
boolean
getCheckExtension
(){
return
checkExtension
;
}
public
boolean
getCheckExistence
(){
return
checkExistence
;
}
public
Object
clone
()
{
// did not clone context (intentionally)
return
new
RunFor
(
this
);
}
}
src/com/elphel/vdt/ui/views/DesignFlowView.java
View file @
216443b3
...
...
@@ -87,6 +87,8 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
private
DrillDownAdapter
drillDownAdapter
;
private
Action
showLaunchConfigAction
;
private
Action
launchAction
;
private
Action
[]
launchActions
;
private
Action
showInstallationPropertiesAction
;
private
ClearAction
clearInstallationPropertiesAction
;
...
...
@@ -176,7 +178,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
}
private
void
doLoadDesignMenu
(
String
menuName
)
{
if
(
menuName
!=
null
)
{
if
(
menuName
!=
null
)
{
// Horizontal menu bar
DesignMenu
designMenu
=
ToolsCore
.
getDesignMenuManager
().
findDesignMenu
(
menuName
);
viewer
.
setInput
(
designMenu
);
List
<
Context
>
packages
=
ToolsCore
.
getDesignMenuManager
().
getPackageContexts
(
designMenu
);
...
...
@@ -226,10 +228,16 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
}
private
void
fillContextMenu
(
IMenuManager
manager
)
{
manager
.
add
(
launchAction
);
// manager.add(new Separator());
// manager.add(new Separator()); // test
// manager.add(launchAction); // test
// manager.add(new Separator());
// drillDownAdapter.addNavigationActions(manager);
// Other plug-ins can contribute the
re
actions here
// Other plug-ins can contribute the
ir
actions here
manager
.
add
(
new
Separator
());
manager
.
add
(
showInstallationPropertiesAction
);
manager
.
add
(
showPackagePropertiesAction
);
...
...
@@ -239,8 +247,9 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
manager
.
add
(
new
Separator
(
IWorkbenchActionConstants
.
MB_ADDITIONS
));
}
private
void
fillLocalToolBar
(
IToolBarManager
manager
)
{
manager
.
add
(
launchAction
);
private
void
fillLocalToolBar
(
IToolBarManager
manager
)
{
// On Horizontal bar
manager
.
add
(
launchAction
);
// manager.add(launchAction); // test
// manager.add(new Separator());
// drillDownAdapter.addNavigationActions(manager);
manager
.
add
(
new
Separator
());
...
...
@@ -351,7 +360,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
}
};
showLaunchConfigAction
.
setText
(
"Launch configuration"
);
showLaunchConfigAction
.
setToolTipText
(
"Open launch configuration dialog for this tool"
);
showLaunchConfigAction
.
setToolTipText
(
"Open launch configuration dialog for this tool"
+
" ** DBG **"
);
showLaunchConfigAction
.
setImageDescriptor
(
VDTPluginImages
.
DESC_LAUNCH_CONFIG
);
launchAction
=
new
Action
()
{
...
...
@@ -366,7 +375,7 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
}
};
launchAction
.
setText
(
Txt
.
s
(
"Action.ToolLaunch.Caption.Default"
));
launchAction
.
setToolTipText
(
Txt
.
s
(
"Action.ToolLaunch.ToolTip.Default"
));
launchAction
.
setToolTipText
(
Txt
.
s
(
"Action.ToolLaunch.ToolTip.Default"
)
+
" **DEBUGGING**"
);
launchAction
.
setImageDescriptor
(
VDTPluginImages
.
DESC_RUN_TOOL
);
launchAction
.
setEnabled
(
false
);
// launchAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
...
...
@@ -436,7 +445,12 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
System
.
out
.
println
(
"Got Runfor["
+((
runFor
!=
null
)?
runFor
.
length
:
"null"
)+
"]"
);
if
(
runFor
!=
null
){
for
(
int
i
=
0
;
i
<
runFor
.
length
;
i
++){
System
.
out
.
println
(
" label='"
+
runFor
[
i
].
getLabel
()+
"', resource='"
+
runFor
[
i
].
getResource
()+
"'"
);
System
.
out
.
println
(
" label='"
+
runFor
[
i
].
getLabel
()+
"', resource='"
+
runFor
[
i
].
getResource
()+
"', checkExtension='"
+
runFor
[
i
].
getCheckExtension
()+
"', checkExistence='"
+
runFor
[
i
].
getCheckExistence
()+
"'"
);
}
}
}
...
...
@@ -447,9 +461,10 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
&&
(
selectedItem
.
isEnabled
(
selectedResource
));
launchAction
.
setEnabled
(
enabled
);
if
(
enabled
){
launchAction
.
setText
(
Txt
.
s
(
"Action.ToolLaunch.Caption"
,
new
String
[]{
selectedResource
.
getName
()}));
/* Andrey: Next apperas on right-click (context) menu for selected tool */
launchAction
.
setText
(
Txt
.
s
(
"Action.ToolLaunch.Caption"
,
new
String
[]{
selectedResource
.
getName
()})+
"<<<<<"
);
/* Andrey: below sets tooltip on the horizontal bar */
launchAction
.
setToolTipText
(
Txt
.
s
(
"Action.ToolLaunch.ToolTip"
,
new
String
[]{
selectedItem
.
getLabel
(),
selectedResource
.
getName
()}));
Tool
tool
=
selectedItem
.
getTool
();
if
(
tool
!=
null
){
...
...
tools/Verilog/IVerilog.xml
View file @
216443b3
...
...
@@ -177,8 +177,8 @@
</extensions-list>
<action-menu>
<action
label=
"Simulate"
resource=
"%SimulationTopFile"
/>
<action
label=
"Simulate for"
resource=
"%%CurrentFile"
/>
<action
label=
"Simulate"
resource=
"%SimulationTopFile"
check-extension=
"false"
check-existence=
"true"
/>
<action
label=
"Simulate for"
resource=
"%%CurrentFile"
check-extension=
"true"
/>
<action
label=
"Empty"
resource=
""
/>
<action
label=
"Just try for"
resource=
"%%OS"
/>
</action-menu>
...
...
Write
Preview
Markdown
is supported
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