Skip to main content



      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 01:12 Go to next message
Eclipse UserFriend
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 01:17 Go to previous messageGo to next message
Eclipse UserFriend
What do you mean by open
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 01:27 Go to previous messageGo to next message
Eclipse UserFriend
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 01:34 Go to previous messageGo to next message
Eclipse UserFriend
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
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 01:41 Go to previous messageGo to next message
Eclipse UserFriend
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 01:43] by 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 02:14 Go to previous messageGo to next message
Eclipse UserFriend
then you should debug why the editor considers this a readonly.
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 03:36 Go to previous messageGo to next message
Eclipse UserFriend
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 03:37 Go to previous messageGo to next message
Eclipse UserFriend
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 04:27 Go to previous messageGo to next message
Eclipse UserFriend
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 04:29 Go to previous messageGo to next message
Eclipse UserFriend
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 05:01 Go to previous messageGo to next message
Eclipse UserFriend
as i said: please use the debugger e.g. at org.eclipse.ui.texteditor.AbstractTextEditor.isEditorInputReadOnly()
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 07:01 Go to previous messageGo to next message
Eclipse UserFriend
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 07:01 Go to previous message
Eclipse UserFriend
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: Wed Jun 18 21:43:31 EDT 2025

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

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

Back to the top