Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Open remote file (on server) in Xtext DSL editor is read only(Open remote file (on server) in Xtext DSL editor is read only)
Open remote file (on server) in Xtext DSL editor is read only [message #1785146] Tue, 10 April 2018 05:12 Go to next message
Virag Purnam is currently offline Virag PurnamFriend
Messages: 56
Registered: June 2014
Member
Hi,

I am trying to open a remote file (file is on server).
The file opens in dsl editor, grammar and outline works fine.

But the file is read only. I am not able to edit the file.
I need help in this topic. How to make file editable?

Thanks in advance.

Best regards,
Virag Purnam
Re: Open remote file (on server) in Xtext DSL editor is read only [message #1785147 is a reply to message #1785146] Tue, 10 April 2018 05:17 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12237
Registered: July 2009
Senior Member
What do you mean by open

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Open remote file (on server) in Xtext DSL editor is read only [message #1785148 is a reply to message #1785147] Tue, 10 April 2018 05:27 Go to previous messageGo to next message
Virag Purnam is currently offline Virag PurnamFriend
Messages: 56
Registered: June 2014
Member
Hello Mr. Christian Dietrich,

I have a new wizard named as Open Remote File.
This wizard has browse option to select file from remote server.
On click of Open button in wizard, file content gets displayed in editor. (Read only)
I want to update contents of file and save them directly in remote server.

I hope, I am clear to explain you the problem.

Best regards,
Virag Purnam
Re: Open remote file (on server) in Xtext DSL editor is read only [message #1785149 is a reply to message #1785148] Tue, 10 April 2018 05:34 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12237
Registered: July 2009
Senior Member
That does no answer my question. What does this open do.
Does editing work in other editors. Did you debug why it's not editable,e


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Open remote file (on server) in Xtext DSL editor is read only [message #1785151 is a reply to message #1785149] Tue, 10 April 2018 05:41 Go to previous messageGo to next message
Virag Purnam is currently offline Virag PurnamFriend
Messages: 56
Registered: June 2014
Member
URI uri = OssFileSystem.getUriFor(hostUserNamePair, remotePath);
fileStore = EFS.getStore(uri);

and OssFileSystem extends org.eclipse.core.filesystem.provider.FileSystem

We are using the above code for it.

[Updated on: Tue, 10 April 2018 05:43]

Report message to a moderator

Re: Open remote file (on server) in Xtext DSL editor is read only [message #1785153 is a reply to message #1785151] Tue, 10 April 2018 06:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12237
Registered: July 2009
Senior Member
then you should debug why the editor considers this a readonly.


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Open remote file (on server) in Xtext DSL editor is read only [message #1785160 is a reply to message #1785153] Tue, 10 April 2018 07:36 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6041
Registered: July 2009
Senior Member
Hi

What is your remote access protocol? http: and https: are often readonly. Have you checked that other tools, e.g. Notepad, are able to edit and save the edited file?

Regards

Ed Willink
Re: Open remote file (on server) in Xtext DSL editor is read only [message #1785161 is a reply to message #1785146] Tue, 10 April 2018 07:37 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 614
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Is there a read-only flag set? Open the file's properties from context menu.
Re: Open remote file (on server) in Xtext DSL editor is read only [message #1785166 is a reply to message #1785160] Tue, 10 April 2018 08:27 Go to previous messageGo to next message
Virag Purnam is currently offline Virag PurnamFriend
Messages: 56
Registered: June 2014
Member
Same approach works, if we open C file or any text file.
But the behaviour is not same with dsl files.
We are using SFTP file transfer protocol.

Thanks and regards,
Virag Purnam
Re: Open remote file (on server) in Xtext DSL editor is read only [message #1785167 is a reply to message #1785161] Tue, 10 April 2018 08:29 Go to previous messageGo to next message
Virag Purnam is currently offline Virag PurnamFriend
Messages: 56
Registered: June 2014
Member
I am not able see the file properties through context menu.

Thanks and regards,
Virag Purnam
Re: Open remote file (on server) in Xtext DSL editor is read only [message #1785169 is a reply to message #1785167] Tue, 10 April 2018 09:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12237
Registered: July 2009
Senior Member
as i said: please use the debugger e.g. at org.eclipse.ui.texteditor.AbstractTextEditor.isEditorInputReadOnly()

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Open remote file (on server) in Xtext DSL editor is read only [message #1785183 is a reply to message #1785169] Tue, 10 April 2018 11:01 Go to previous messageGo to next message
Virag Purnam is currently offline Virag PurnamFriend
Messages: 56
Registered: June 2014
Member
Thanks Mr. Christian Dietrich,

I debugged the code suggested by you and found place which is responsible for making that read only.
Currently I just returned hard coded values and it worked.
I need to add proper code in below methods.
        @Override
	public boolean isModifiable(Object element) {
		return true;
	}
	
	@Override
	public boolean isReadOnly(Object element) {
		return false;
	}


Thanks a lot.. :)
Re: Open remote file (on server) in Xtext DSL editor is read only [message #1785184 is a reply to message #1785169] Tue, 10 April 2018 11:01 Go to previous message
Virag Purnam is currently offline Virag PurnamFriend
Messages: 56
Registered: June 2014
Member
Thanks Mr. Christian Dietrich,

I debugged the code suggested by you and found place which is responsible for making that read only.
Currently I just returned hard coded values and it worked.
I need to add proper code in below methods.
        @Override
	public boolean isModifiable(Object element) {
		return true;
	}
	
	@Override
	public boolean isReadOnly(Object element) {
		return false;
	}


Thanks a lot.. :)
Previous Topic:Grammar help
Next Topic:Initialization of default values on parsing
Goto Forum:
  


Current Time: Mon Sep 24 04:06:49 GMT 2018

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

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

Back to the top