0

I know you can add new buttons to the eclipse toolbar by writing a custom plugin but just how would i go about adding a simple "open file" button like most editors have?

I guess I can use this as a template to do what i want, but what's the commandId for the "open file dialog":

How to add undo / redo buttons to toolbar in Eclipse?

thank you!

Community
  • 1
  • 1
PaulK
  • 623
  • 2
  • 10
  • 22

2 Answers2

0

I don't believe there is a specific commandId for open file dialog that you can use in the toolbar or menu. You would have to create a class that implements the IHandler interface and use something like the JFileChooser to handle the selection of the file.

JRSofty
  • 1,216
  • 1
  • 24
  • 49
0

If you want to have a toolbar button which mimics the behaviour of the menu File->Open File..., then you are searching for the command id

org.eclipse.ui.edit.text.openLocalFile

which you would want to use instead of the command ids for the undo/redo in your example.

Bananeweizen
  • 21,797
  • 8
  • 68
  • 88