Dynamically change About dialog text in RCP based application - rcp

Are is possible to dynamically change About dialog text in RCP based application? I want to replace aboutText value when About dialog opens by dynamically changing some part of it's text. Problem is that I has a client/server application, where information about client can be static, but server information (at least version string) may change independently and I don't know when it will happen. aboutText itself is static text. about.mapping approach also not work, because this file is packed into application JAR and because of this is read-only too. Are there is a possibility to subclass aboutText or update it in another way before About dialog show it? I not want to rewrite the all Eclipse About dialog class from scratch.

You can use system properties in about.mappings to achieve this:
Create an about.mappings file at the root of your app plugin
Add lines such as 0=$net.dnorth.about.text$
Reference {0} in the aboutText set in plugin.properties
Now call System.setProperty("net.dnorth.about.text", "your dynamic text here") in some code at start-up.
Reference: https://bugs.eclipse.org/bugs/show_bug.cgi?id=172692

The about text of the IDE is instance specific i.e if you are running a RCP application then at that time you cant change the About text.It is only possible if you update your RCP with via Check for updates link or if you install another IDE over the present one.
I these two cases only you can change your about text.

Related

Create an application and attach it on right-click on a file

I want to make an application in C# VS12 preferably, and I want to attach it on right click menu passing the filepath as an argument, it would be great if I could do that on multiple selection too. How do I make that happen?
in the installer of your application you need to add a file extension association. (for development you can test that by registering the extension manually: right click, open with...). the file name that was clicked will be passed to your app as a command line argument (those are the args[] in the main method of you app).
multiple selection is a bit trickier but certainly doable. when your app starts you need to check if you have an instance of the app already running (using a mutex for example) and send a message to that instance with the file name you received.
If you have not worked with context menu handling, you should take a look at this tutorial.
For the file path handling, you could take a look at this image editing example.

inverse of LSGetApplicationForItem

I am writing a image viewer application, which I need to set as default application for jpeg/gif files. There is an API LSGetApplicationForItem/Info for getting information on what is the default application.
But I am not able to find an API where I can set my application as the default viewer for image files.
Can you please help
You want the LSSetDefaultRoleHandlerForContentType function. Pass kUTTypeGIF for GIF, kUTTypeJPEG for JPEG.
Please only do this when the user explicitly tells you to. Otherwise, they will hate you.
There's not a public API to do that, as far as I know. Instead, you register, using Info.plist (or the Document Types section of the Info editor in Xcode), that you are a provider of viewing and/or editing for whatever file types you are interested in. This will cause the system to choose your app if there's no other app who can open those file types, and will put you in the running if the user chooses Open With from the context menu when selecting a file in the Finder.

how to get the .tsr file in QTP

We all know that the .tsr file stores the information of the object repository, and We can load the file to an ObjectRepositoryUtil Object in VBS, then we can do a lot through this object.
But how can I capture all the widgets in a window and stores into the .tsr file using VBS?
I mean when we do the following in the QTP GUI:
Resources->Object Repository Manager->Object->Add Object->
"CLICK THE WINDOW WE WANT TO CAPTURE"->File->Save
we actually get the .tsr file of the window and all its components we want to capture.
But how can I do this in VBS, does it have any API?
I look up the document called ObjectRepositoryUtil and find the method GetAllObjects, but it is just not the same thing.
Could anyone solve my problem ? I would really appreciate it.
Thank you.
I'm not sure why you want to automate creating an object repository. Usually object repositories are created once and then used for creating tests.
Are you familiar with QTP's Navigate and Learn feature, it allows adding all objects from an application while interacting with the application.
If you are looking for a tool or code that can actually mimic the object capturing capability of QTP, outside of QTP - then no such tool/code is available as of now. However code can be written to retrieve the object properties of an application and that I assume you are aware of.

Do an Event when the application is opened by a custom file? On C# .NET

The thing is, I created a file with custom information and a unique extension, let's say (.qwas). If I modified the Registry in HKEY_CLASSES_ROOT I can change its icon and choose which program will open it. What I want to do, is that when I double click it, it opens my .NET app and in the app have an event like FileOpenApp. So I can extract information from the file and do custom methods.
The kind of behavior I want to make is similar to the project files of an aplication, like the .fla of flash.
I don't know how to start with this idea, I hope anyone knows even the name of this type of procedure.
Thanks
Can't you pass the name of the file as an argument to your .Net App. Something like
[HKEY_CLASSES_ROOT\Applications[name of APP]\shell\open\command]
#="\"[path to app]\" \"%1\" %*"

How to launch "Choose Application" dialog on Mac?

I am using LSOpenItemsWithRole() to open any file from my application. It works fine for all files which has a default application on Mac, but for the files which cannot be opened with any default application this method returns an error kLSApplicationNotFoundErr and does nothing.
For such cases, I want my application to launch the "Choose Application" dialog box, so that end users can choose any application from there to open the file. This dialog box pops up whenever any such file is directly opened by double clicking. Is there is any direct API call to do the same?
I don't want to use Objective C call, is there any way to do it using Carbon API calls?
You should use an NSOpenPanel, starting the user in the Applications folder use and the panel:shouldEnableURL: delegate method to filter out paths that don't end in .app. You can use setAccessoryView: to add any custom options to the dialog. This is what the Finder is doing when you click on the "Other..." option when selecting which application to use.
I think you can do it by using NavCreateChooseFileDialog, with NavCustomControl to set the initial location and NavDialogSetFilterTypeIdentifiers to filter out non-apps. (Why don't you want to use Objective-C? You know that you can mix Carbon and Cocoa in one app, right?)

Resources