How to refresh FileTree? - lwuit

when I delete a file from FileTree the file is deleted but it is still displayed in the tree until I close and re-open the directory containing this file is there a way to refresh the FileTree ?
another thing is that FileTree doesn't display the files or folders that there names are written in Arabic Language it just displays a file or folder with no name how to fix this ?

As a workaround you can try something like tree.setModel(tree.getModel()); but I'm guessing it will collapse the tree. The tree is a simplistic component that isn't designed to support changes to the underlying model. It can probably be enhanced via subclassing.

Related

Rename resource file does not change editor part title

In my plugin project, I have a project explorer view where I can rename a config file which in shown in another editor part. The file can be renamed in the explorer with the rename resource dialog but the corresponding the editor tab title does not change. The same problem is described here and also here. Is there a standard way to get the rename functionality working without the creating a custom listener?
Editors based on AbstractTextEditor (or one of its subclasses such as TextEditor) should handle renames through the FileDocumentProvider which listens for resource changes.
Other editors need to use an IResourceChangeListener to deal with this.

notepad++ deleted files popup

When I delete file notepad++ displays the below message:
The file "D:\xxx.txt" does not exist any more . keep file in the editor?
Can I stop this message and silently remove deleted files from the editor?
Message box with the question is displayed unconditionally. There cannot be anything done about removing it simply by chaging configuration.
If you have necessary programming and app building skills and you wish to remove it, search for Notepad_plus::doCloseOrNot in Notepad++ source file <source root>\PowerEditor\src\Notepad_plus.cpp and modify the code accordingly – for example to always return No (=do not keep file in editor) without showing a dialog. Then build Notepad++ from these modified sources so the change will be there.

How to change open with options in navigator depending upon name of the resource?

I am working on eclipse RCP application which implements CommonNavigator view to display navigator. I have few LinkedResources in navigator that link to files on the file system with custom extension. These custom extension files are opened in custom editor as well as in TextEditor.
One of the file named default.ext will be common to all the projects and I want to keep it read only. Is it possible to open file in custom editor only? For ex. Default.ext should be opened in only custom editor, however Test.ext should be opened in custom editor as well as text editor.
This way I could handle save action in my editor depending upon file name and keep the file read only.
Is there any other way to keep files read only?
Short answer: not possible in the way you describe.
Long answer: if somebody really wants to modify a file then there's no way or need to stop this. What you can do is either (1) hide the file from user or (2) set Read-only flag to discourage users from modifying the file.

How to make a project's subdirectory read-only in eclipse?

How can I make a project's subdirectory read-only in eclipse?
The reason I need to do this is that I'm currently learning how to build a child theme in wordpress. I need to be able to view the parent theme's files but sometimes I edit the parent file (e.g. functions.php, style.css) instead of the child's file with the same name.
I know I could set the filesystem attributes recursively to read-only on everything other than my child theme, but I'm wondering if there's a better way? When I do this and I try to edit a read-only file, eclipse shows me a dialog offering to clear the attribute. This is not convenient because if I accidentally press enter or space before I realise there's a dialog, the default is to clear the attribute and then I have to set it again. Ideally I'd like to tell eclipse to not let me edit any files under some specific directories that I choose.
Thanks

Maintaining Directory Structure when loading local files into UIWebview on iPhone

I'm noticing a minor annoyance when working with local files in a UIWebview and hoping there is a simple workaround. As a simplified example lets say in my xCode project I have a folder called "WebProject" that contains an html file and a subfolder called "images" where the images reside. The html file references the images as you'd expect: src="images/MYIMAGE.jpg" for example, which works just dandy if this where are normal webpage. When you load the html file in a UIWebview, however, this image would not show up because it seems that all of the files are just thrown into one big bundle folder (so the image link is actually: src"MyIMAGE.jpg"). Is there anyway to enforce the directory structure of these files in the main bundle, so that this sort of thing does not happen? Thanks!
Just create the structure you want in the filesystem (using finder or whatever) and import that whole tree into your project. Make sure you select "Create folder references for any added folders"
You'll notice these folders are blue instead of the normal yellow used for groups. This folder structure will exist in the bundle and so your relative references will work as you expect.
Hope that helps.
See this page and this tech note for how to add resources, and maintain directory structure. Make sure you select the radio button that says "Create folder references for any added folders." Then when you go to write your code, folder-relative paths to the bundle will resolve just as if they are sub-directories. Because they are, even in your app's resources.