|
230 | 230 | </definition>
|
231 | 231 | </extension >
|
232 | 232 | -->
|
233 |
| - |
| 233 | + |
| 234 | +<!-- Definition to know if the active perspective is Arduino --> |
| 235 | +<extension point="org.eclipse.core.expressions.definitions"> |
| 236 | + <definition id="it.baeyens.definition.isArduinoPerspective"> |
| 237 | + <with variable="activeWorkbenchWindow.activePerspective"> |
| 238 | + <equals value="org.eclipse.cdt.ui.CPerspective"/> |
| 239 | + </with> |
| 240 | + </definition> |
| 241 | +</extension> |
| 242 | + |
234 | 243 | <!-- Upload project handler
|
235 | 244 | <extension point="org.eclipse.ui.handlers">
|
236 | 245 | <handler
|
|
268 | 277 | locationURI="toolbar:org.eclipse.ui.main.toolbar">
|
269 | 278 | <toolbar
|
270 | 279 | id="it.baeyens.arduino.toolbar.main" label="Arduino">
|
| 280 | + <visibleWhen> |
| 281 | + <reference definitionId="it.baeyens.definition.isArduinoPerspective"/> |
| 282 | + </visibleWhen> |
271 | 283 | <command
|
272 | 284 | commandId="it.baeyens.arduino.actions.ArduinoBuildAction"
|
273 | 285 | disabledIcon="icons/check_disabled.png"
|
274 | 286 | icon="icons/check.png"
|
275 | 287 | label="%command.label"
|
276 | 288 | style="push">
|
| 289 | + <visibleWhen> |
| 290 | + <reference definitionId="it.baeyens.definition.isArduinoPerspective"/> |
| 291 | + </visibleWhen> |
277 | 292 | </command>
|
278 | 293 | <command
|
279 | 294 | commandId="it.baeyens.arduino.actions.UploadprojectAction"
|
280 | 295 | disabledIcon="icons/arrow_disabled.png"
|
281 | 296 | icon="icons/arrow.png"
|
282 | 297 | label="%command.label.0"
|
283 | 298 | style="push">
|
| 299 | + <visibleWhen> |
| 300 | + <reference definitionId="it.baeyens.definition.isArduinoPerspective"/> |
| 301 | + </visibleWhen> |
284 | 302 | </command>
|
285 | 303 | <command
|
286 | 304 | commandId="it.baeyens.arduino.actions.NewSketchAction"
|
287 | 305 | disabledIcon="icons/new_disabled.png"
|
288 | 306 | icon="icons/new.png"
|
289 | 307 | label="%command.label.1"
|
290 | 308 | style="push">
|
| 309 | + <visibleWhen> |
| 310 | + <reference definitionId="it.baeyens.definition.isArduinoPerspective"/> |
| 311 | + </visibleWhen> |
291 | 312 | </command>
|
292 | 313 | <command
|
293 | 314 | commandId="org.eclipse.ui.file.save"
|
294 | 315 | disabledIcon="icons/save_disabled.png"
|
295 | 316 | icon="icons/save.png"
|
296 | 317 | style="push">
|
| 318 | + <visibleWhen> |
| 319 | + <reference definitionId="it.baeyens.definition.isArduinoPerspective"/> |
| 320 | + </visibleWhen> |
297 | 321 | </command>
|
298 | 322 | <command
|
299 | 323 | commandId="it.baeyens.arduino.actions.OpenSerialMonitorAction"
|
300 | 324 | disabledIcon="icons/ser_mon_disabled.png"
|
301 | 325 | icon="icons/ser_mon.png"
|
302 | 326 | label="%command.label.2"
|
303 | 327 | style="push">
|
| 328 | + <visibleWhen> |
| 329 | + <reference definitionId="it.baeyens.definition.isArduinoPerspective"/> |
| 330 | + </visibleWhen> |
304 | 331 | </command>
|
305 | 332 | <command
|
306 | 333 | commandId="it.baeyens.arduino.actions.OpenScopeAction"
|
307 | 334 | icon="icons/scope.png"
|
308 | 335 | label="%command.label.5"
|
309 | 336 | style="push">
|
| 337 | + <visibleWhen> |
| 338 | + <reference definitionId="it.baeyens.definition.isArduinoPerspective"/> |
| 339 | + </visibleWhen> |
310 | 340 | </command>
|
311 | 341 | </toolbar>
|
312 | 342 | </menuContribution>
|
313 | 343 | <menuContribution locationURI="menu:org.eclipse.ui.main.menu??after=Run">
|
314 | 344 | <menu label="%menu.label" >
|
| 345 | + <visibleWhen> |
| 346 | + <reference definitionId="it.baeyens.definition.isArduinoPerspective"/> |
| 347 | + </visibleWhen> |
315 | 348 | <command
|
316 | 349 | commandId="it.baeyens.arduino.actions.ArduinoBuildAction"
|
317 | 350 | id="buildProject"
|
|
0 commit comments