Disable Installed Software & Installation History tab on Help | About | Installation Details - eclipse-rcp

Is there some way I can suppress or disable the "Installed Software" & "Installation History" tabs on Help | About | Installation Details button in a RCP?
I'm not using P2 for this particular application so there will never be any history and the installed software tab has no content.

If you do not want these do show then make sure that the following plug-ins are not deployed in your application's target platform:
org.eclipse.p2.ui
org.eclipse.p2.ui.discovery
org.eclipse.p2.ui.sdk
org.eclipse.p2.ui.updatechecker
Strictly speaking you only really need to remove the first bundle in the above list as the subsequent bundles depend on the core ui bundle. Typically, if I do not want the user to shcedule updates etc. I'll only inlcude the first bundle above. I then build a custom UI around p2 functionality whilst re-using some of the provided core p2 UI API (but without auto-scheduling UI etc. included).
If you want to remove the preference pages for the p2 sheduling/updates, then in your in your WorkbenchAdvisor you can use write the following in the postStartup() method:
PreferenceManager pm =
PlatformUI.getWorkbench(
).getPreferenceManager();
pm.remove("org.eclipse.equinox.internal.p2.ui.sdk.ProvisioningPreferencePage"); pm.remove("org.eclipse.update.internal.ui.preferences.MainPreferencePage");

I ended up deleting the org.eclipse.p2.ui plugin's & features from my built product.
Not the most elegant solution, but it works.

subclass the AboutDialog class and override the createButtonsForButtonBar(Composite) method :)
and use your own InstallationDialog subclass.
to avoid displaying the tabs you don't want you have to override the createFolderItems method.
give a look the loadElements method to understand how this part of the dialog works.

Related

Aurelia - How to do composite applications that can be loaded at runtime

What I'm trying to do in Aurelia, is something like Prism is doing in WPF- Composite applications.
So lets say I have a "shell" application that defines the main application layout, then i have modules that I can plugin at run-time. Those modules can be an Aurelia application per se or Aurelia plugin (don't know what to use - need recommendation).
When loaded, the module needs to add it's menu items to the main application menu to expose it's features.
This is a mockup of the application:
Each module can have multiple menu items and can be pretty complex.
I'm using latest Typescript, Aurelia-CLI to create the application, and I'm using the built-in bundler : Aurelia's new built-in bundler.
So What I don't know is:
Those modules/features - what must they be? (Maybe Aurelia Plugins, or another Aurelia application?)
How to load those modules/features at run-time? (like deploy it in some plugins folder and tell the main shell application to load them)
How to modify the main menu and add new menu items from the loaded module?
Please help
Aurelia supports ultra dynamic applications. Also, there have been other community members who have had similar requirements and was able to resolve it. So I think the scenario is possible.
It seems the sub-application can just be a route.How/where to load the route should be determined based on the application URL
Those modules doesn't need to do anything specific, they can just be a normal, plain JS/TS class with lifecycle methods to handle activation/deactivation. I guess that main shell and all sub-applications need to share a common URL, you cannot have more than one router.
There could be a singleton/central store for new route to register information about loaded features, or it can be loaded upfront by a configuration file/metadata file or a database fetch.
Here is a similar question from another community member that I think can help you see how to glue things to https://discourse.aurelia.io/t/dynamicaly-load-routes/1906

Set workflow model id (path)

When I create a new workflow model in AEM, it gets created under /etc/workflow/models. How do I get it to be created under a different path like /etc/workflow/models/myapp ? The only way I can think of is changing the path in CRXDE after the workflow gets created. Wanted so if there is a better way to do this.
Better way to move workflow to another place would be:
go to /miscadmin#/etc/workflow/models
use button "Move..."
Unfortunately, it seems, that there is no easy way to change place, where worflows, which are created through UI, are stored. To do this you should:
override "/libs/cq/workflow/widgets/source/widget/ModelsPanel.js" in you project, where you can find action this.newAction, where you will be able to change propery parentPath to /etc/workflow/models/myapp. But you can run into troubles after upgrading to another version of AEM.
also you can be interested in service Granite Workflow Service where you can set (through /system/console/configMgr) path to your models, which should be shown in Workflow Console /libs/cq/workflow/content/console.html. (Also it's applicable to CQ 5.6.1, for some older versions, you should configure Day CQ Workflow Service).

Getting error in app porting

I am porting an app from HVGA (Bada 2.0.2 device ) to WVGA( Bada 1.2) using ecllipse( version 2.0.2 ).
For this I have done the following changes in my project
Project-> Properties/Bada build
Set Model WVGA and set AutoScaling true(480x800)
I have create a form of Resolution 480x800.
For images I have add a folder in Resouce folder
-> 480x800
->ScreenDensity-High
and place all my resources in these folder .
But my app crashes when I click the button in the app to Select more images as requirement in my app and the log show Output as Shown
Info, Installation completed.
0080.772,EXCEPTION,P32,T00,A125,Osp::Media::__Image::HasAlphaChannels (1547) > [E_UNSUPPORTED_FORMAT]
0080.774,EXCEPTION,P32,T00,A125,Osp::Media::Image::HasAlphaChannels (599) > [E_UNSUPPORTED_FORMAT] Propagated.
0080.851,EXCEPTION,P32,T00,A125,Osp::Media::__Image::HasAlphaChannels (1547) > [E_UNSUPPORTED_FORMAT]
0080.851,EXCEPTION,P32,T00,A125,Osp::Media::Image::HasAlphaChannels (599) > [E_UNSUPPORTED_FORMAT] Propagated.
I had check for this in the Bada Help but unable to find solution.Please give your suggestion to solve this problem
As I see you just moved your Images (optimized for HVGA) to a new folder to use them for WVGA.
If I understand it correctly, I suggest that you with the reference of bada development documentation in your SDK (through bada IDE help system) which specifies that what is the specific images properties for WVGA screens, change your images properties to a compatible ones (re-size them) and rebuild your project.
I think the problem will solve , we like your feedback.
best regards.
I find the reference for you mate: Using Customized and Optimized Resources

Listener on open file in Eclipse

I am currently working on a Eclipse Plugin, where I need to make an action, when a person opens a file with certain properties. However I'm not sure on how to set a listener, I have been looking into the IWorkspace and IResource API, but I can't find the simple API call saying "AddListenerToOnOpenFile".
The file is expected to be opened in the package explorer view.
Use the answer supplied by #MarttiKäärik to find out when editors are open. Then you can use the IEditorInput to see if it is an IResource you care about.
if (part instanceof IEditorPart) {
IEditorPart editor = (IEditorPart) part;
IResource resource = editor.getEditorInput().getAdapter(IResource.class);
// ...
}
Question already answered, so only to make it a bit more complete...
You don't necessarily have to implement a view or action (as described in the question linked to by Martti Käärik in a comment) to get a window for your listener. Call to PlatformUI.getWorkbench().get...() can be used as well. See the older, probably duplicate, question called just Eclipse Plugin.
BTW Eclipse Wiki FAQ page contains a good description of the ways how to obtain the current workbench window and possible "gotchas".
Moreover, you can even listen for newly opened windows if there is a need:
PlatformUI.getWorkbench().addWindowListener(listener);

Limiting contributed extension point data between plugins

I have 2 eclipse plugins that I am building; let's call them plugin A and plugin B...
Plugin A requires a license to run and Plugin B is free to the world. I have created an extension point in Plugin B to which Plugin A contributes (and in some cases overrides) data. I would like to find a way to disregard that data in plugin B if plugin A is not licensed (without have to check to see if the plugin can start).
Is there such a mechanism in eclipse that allows me to accomplish such a feat? My current workaround is to check to see if the plugin is started (via the Bundle) and if it isn't attempt to start it. If the plugin A is unlicensed I throw an exception in the start() method.
Shouldn't A check its license itself and not-override/not-contribute any data (or override with providing identical data) if it is not licensed? Why place the burden of license checking on B when essentially B doesn't care (as it's free).
I'd opt for A to start in a limited mode if the license is not found. You might also - as jamesh suggested - want to give the user the opportunity to provide the license, e.g. with an additional A-UI plugin informing the user about the missing license and offering to license.
Requirements
So, you are writing two plugins.
Plugin B has an extension point. If the user has the bundle for Plugin A, and the license, then plugin A should contribute extensions to the EP in plugin B.
Approaches
OSGi's security model is largely built atop the default Java Permissions and SecurityManager. There is a discussion in this presentation from Apache Felix. I expect it would be possible to build a licensing scheme around this.
You're workaround sounds like it could work, however, there are a couple of concerns:
stopping a bundle from starting may prevent any services being registered, but will it effect a change in the extension registry? i.e. those extensions registered using plugin.xml. I would guess that DS services would be ok, but I'd have to try it.
stopping the bundle may not be enough - can it be started again later on? I would probably want it UNINSTALLED.
an unlicensed bundle is an opportunity telling the user about licensing. So, how do you tell the user that the bundle was not licensed, and won't be able to be used, and btw, here's how you license it.
So far you haven't said anything about how the license is to be implemented. I'm guessing you'll go for a LicenseService, or even perhaps a singleton.
Do report back what you find.
One possible solution I can think of is that you contribute a class from plugin A to Plugin B. Then, when plugin B reads the contribution items, it can try to create an instance of this class.
The class, from plugin A, can then throw some exception in the constructor if it is not licensed. This will tell plugin B that the information from plugin A can be disregarded.
A possible implementation in plugin B can look like this:
IExtensionPoint extensionPoint = registry.getExtensionPoint("mypoint");
IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
for (int i = 0; i < elements.length; i++) {
try {
(License)elements[i].createExecutableExtension("class");
// ..... Read any other items you need....
}
catch(LicenceException e){
// Plugin is invalid, do not use
}
}