@@ -70,9 +70,6 @@ private enum ToolSaveStatus {
70
70
71
71
private Map <String , ToolSaveStatus > toolStatusMap = new HashMap <>();
72
72
73
- /**
74
- * creates a tool manager for the project
75
- */
76
73
public ToolManagerImpl (Project project ) {
77
74
this .project = project ;
78
75
this .toolChest = project .getLocalToolChest ();
@@ -91,8 +88,7 @@ public ToolManagerImpl(Project project) {
91
88
* Registers the new instance of the tool in the namesMap and returns the total number of
92
89
* running instances of that tool
93
90
* @param toolName the name of the tool being registers
94
- * @param tool the tool being registered.
95
- * @return the total number of running instances of the tool
91
+ * @param tool the tool being registered
96
92
*/
97
93
private void registerTool (String toolName , Tool tool ) {
98
94
List <Tool > list = namesMap .get (toolName );
@@ -124,17 +120,11 @@ private void deregisterTool(String toolName, Tool tool) {
124
120
tool .removePropertyChangeListener (this );
125
121
}
126
122
127
- /*
128
- * @see ghidra.framework.model.ToolManager#getActiveWorkspace()
129
- */
130
123
@ Override
131
124
public Workspace getActiveWorkspace () {
132
125
return activeWorkspace ;
133
126
}
134
127
135
- /*
136
- * @see ghidra.framework.model.ToolManager#getConsumerTools()
137
- */
138
128
@ Override
139
129
public Tool [] getConsumerTools () {
140
130
ArrayList <Tool > consumers = new ArrayList <>(TYPICAL_NUM_TOOLS );
@@ -149,9 +139,6 @@ public Tool[] getConsumerTools() {
149
139
return tools ;
150
140
}
151
141
152
- /*
153
- * @see ghidra.framework.model.ToolManager#getProducerTools()
154
- */
155
142
@ Override
156
143
public Tool [] getProducerTools () {
157
144
ArrayList <Tool > producers = new ArrayList <>(TYPICAL_NUM_TOOLS );
@@ -165,9 +152,6 @@ public Tool[] getProducerTools() {
165
152
return producers .toArray (tools );
166
153
}
167
154
168
- /*
169
- * @see ghidra.framework.model.ToolManager#getRunningTools()
170
- */
171
155
@ Override
172
156
public Tool [] getRunningTools () {
173
157
Workspace [] wsList = new Workspace [workspaces .size ()];
@@ -200,9 +184,6 @@ public ToolConnection getConnection(Tool producer, Tool consumer) {
200
184
return tc ;
201
185
}
202
186
203
- /*
204
- * @see ghidra.framework.model.ToolManager#createWorkspace(java.lang.String)
205
- */
206
187
@ Override
207
188
public Workspace createWorkspace (String name ) throws DuplicateNameException {
208
189
// if passed in the default "untitled" name, or no name at all,
@@ -291,17 +272,15 @@ public void removeWorkspace(Workspace ws) {
291
272
}
292
273
}
293
274
294
- /*
295
- * @see ghidra.framework.model.ToolManager#getWorkspaces()
296
- */
297
275
@ Override
298
276
public Workspace [] getWorkspaces () {
299
277
Workspace [] wsList = new Workspace [workspaces .size ()];
300
278
return workspaces .toArray (wsList );
301
279
}
302
280
303
281
/**
304
- * saves this object to an XML element.
282
+ * Saves this object to an XML element
283
+ * @return the element containing the tool XML
305
284
*/
306
285
public Element saveToXml () {
307
286
@@ -378,6 +357,7 @@ public void restoreFromXml(Element root) {
378
357
/**
379
358
* Return whether any tools have changed, or if any tools were
380
359
* added or removed from any of the workspaces.
360
+ * @return true if any tools in this workspace have changed
381
361
*/
382
362
public boolean hasChanged () {
383
363
// check the connections for changes
@@ -407,7 +387,8 @@ public void close() {
407
387
408
388
/**
409
389
* Save the tools that are opened and changed, that will be brought back up when the project
410
- * is reopened.
390
+ * is reopened
391
+ * @return true if the session was saved
411
392
*/
412
393
public boolean saveSessionTools () {
413
394
Set <String > keySet = namesMap .keySet ();
@@ -483,9 +464,6 @@ public void dumpConnectionList() {
483
464
}
484
465
}
485
466
486
- /*
487
- * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
488
- */
489
467
@ Override
490
468
public void propertyChange (PropertyChangeEvent evt ) {
491
469
@@ -514,17 +492,11 @@ public void propertyChange(PropertyChangeEvent evt) {
514
492
firePropertyChangeEvent (evt );
515
493
}
516
494
517
- /*
518
- * @see ghidra.framework.model.ToolManager#addWorkspaceChangeListener(ghidra.framework.model.WorkspaceChangeListener)
519
- */
520
495
@ Override
521
496
public void addWorkspaceChangeListener (WorkspaceChangeListener l ) {
522
497
changeListeners .add (l );
523
498
}
524
499
525
- /*
526
- * @see ghidra.framework.model.ToolManager#removeWorkspaceChangeListener(ghidra.framework.model.WorkspaceChangeListener)
527
- */
528
500
@ Override
529
501
public void removeWorkspaceChangeListener (WorkspaceChangeListener l ) {
530
502
changeListeners .remove (l );
@@ -543,18 +515,14 @@ public void clearWorkspaceChanged() {
543
515
}
544
516
545
517
/**
546
- * Get any toolservices available from this tool.
518
+ * Get any tool services available from this tool
547
519
*
548
520
* @return ToolServices list of tool services this tool can provide.
549
521
*/
550
522
public ToolServices getToolServices () {
551
523
return toolServices ;
552
524
}
553
525
554
- /*
555
- * (non-Javadoc)
556
- * @see ghidra.framework.model.ToolManager#toolChanged(ghidra.framework.model.Tool)
557
- */
558
526
@ Override
559
527
public void toolChanged (Tool tool ) {
560
528
updateConnectMap (tool );
@@ -565,6 +533,8 @@ public void toolChanged(Tool tool) {
565
533
// restoring the front end tool.
566
534
/**
567
535
* Called by WorkspaceImpl when it is restoring its state.
536
+ * @param toolName the name of the tool
537
+ * @return the tool
568
538
*/
569
539
public Tool getTool (String toolName ) {
570
540
ToolTemplate template = toolServices .getToolChest ().getToolTemplate (toolName );
@@ -663,7 +633,7 @@ void setWorkspaceChanged(WorkspaceImpl ws) {
663
633
* @param ws workspace to rename
664
634
* @param name new name of workspace
665
635
*
666
- * @throws DuplicateNameException
636
+ * @throws DuplicateNameException if there already exists a workspace by the given name
667
637
*/
668
638
void setWorkspaceName (Workspace ws , String name ) throws DuplicateNameException {
669
639
@@ -682,7 +652,7 @@ void setWorkspaceName(Workspace ws, String name) throws DuplicateNameException {
682
652
}
683
653
}
684
654
685
- /**
655
+ /*
686
656
* Get a tool from the template; set the instance name.
687
657
*/
688
658
Tool getTool (Workspace ws , ToolTemplate template ) {
@@ -693,7 +663,7 @@ Tool getTool(Workspace ws, ToolTemplate template) {
693
663
return tool ;
694
664
}
695
665
696
- /**
666
+ /*
697
667
* Called by the workspace when a tool is removed.
698
668
*/
699
669
void toolRemoved (Workspace ws , Tool tool ) {
@@ -743,25 +713,17 @@ private void addNewTool(Tool tool, String toolName) {
743
713
}
744
714
catch (PropertyVetoException e ) {
745
715
// shouldn't happen
746
- Msg .showError (this , null , "Error" , "set type name was vetoed" , e );
716
+ Msg .showError (this , null , "Error Setting Tool Name " , "Set tool name was vetoed" , e );
747
717
}
748
- Msg .debug (this , "Loaded " + tool .getName ());
749
718
}
750
719
751
- /**
752
- * Called when a tool is added.
753
- */
754
720
void fireToolAddedEvent (Workspace ws , Tool tool ) {
755
721
for (int i = 0 ; i < changeListeners .size (); i ++) {
756
722
WorkspaceChangeListener l = changeListeners .get (i );
757
723
l .toolAdded (ws , tool );
758
724
}
759
725
}
760
726
761
- /**
762
- * Remove all connection objects for the given tool.
763
- * @param tool
764
- */
765
727
@ Override
766
728
public void disconnectTool (Tool tool ) {
767
729
Iterator <String > keys = connectMap .keySet ().iterator ();
@@ -777,10 +739,6 @@ public void disconnectTool(Tool tool) {
777
739
}
778
740
}
779
741
780
- /**
781
- * Update the connection map for the given tool.
782
- * @param tool
783
- */
784
742
private void updateConnectMap (Tool tool ) {
785
743
Iterator <String > keys = connectMap .keySet ().iterator ();
786
744
Map <String , ToolConnectionImpl > map = new HashMap <>();
0 commit comments