Skip to main content



      Home
Home » Eclipse Projects » Sirius » Is there something like a file selector in Sirius?(File Selector, Sirius)
Is there something like a file selector in Sirius? [message #1822877] Mon, 16 March 2020 05:52 Go to next message
Eclipse UserFriend
Hi,
I'm trying to load a config file to my Java Service in the Viewpoint Specification Project. I hope to put a button in the Property View and once I click on it, a File Selector Dialog comes out so I can choose from where I will load the config file. But I didn't find something like a File Selector, does Sirius support such a widget?
Thanks very much for your help.
Re: Is there something like a file selector in Sirius? [message #1822882 is a reply to message #1822877] Mon, 16 March 2020 06:44 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

Indeed, I do not think that we have a widget that prompts the File Browser. You will have to create a classic button, and in the model action of this button, call a java service that will open the File Browser. In this java service, you will need to have the following action to prompt the System file browser:
FileDialog fileDialog = new FileDialog(shell, SWT.OPEN);
fileDialog.setText("title");
String filePath = fileDialog.open();

Best regards,
Steve
Re: Is there something like a file selector in Sirius? [message #1822898 is a reply to message #1822882] Mon, 16 March 2020 09:34 Go to previous messageGo to next message
Eclipse UserFriend
That's exactly what I need. Thanks for your help so much.
Re: Is there something like a file selector in Sirius? [message #1822903 is a reply to message #1822882] Mon, 16 March 2020 10:22 Go to previous messageGo to next message
Eclipse UserFriend
Hi Steve,
I tried java swt in my project to invoke a FileDialog. However, there is an Error saying Invalid thread access. I searched for the internet and found that this is caused by java swt's display thread not created. I also found some examples telling me how to create FileDialog, but all the examples says that I have to change the Button's Listener method, which I have no idea how to configure them in Sirius. Would you please help me about how to use swt FileDialog in detail? Just an example is fine.
Thank you very much.
Re: Is there something like a file selector in Sirius? [message #1822906 is a reply to message #1822882] Mon, 16 March 2020 10:48 Go to previous messageGo to next message
Eclipse UserFriend
Sorry for bothering but I've managed to solve it by myself. Anyway, thank you so much for your help.
Re: Is there something like a file selector in Sirius? [message #1822914 is a reply to message #1822906] Mon, 16 March 2020 12:32 Go to previous message
Eclipse UserFriend
Hello,

No problem, I am glad I could help.

Best regards,
Steve
Previous Topic:Issue when adding programmatically new diagrams to a representation
Next Topic:adaptViewNodeSizeWithLabel result over written
Goto Forum:
  


Current Time: Tue Jun 24 10:19:10 EDT 2025

Powered by FUDForum. Page generated in 0.08122 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top