Hide run/debug launch configuration in eclipse run/debug dialog programmatically - eclipse

How to hide a given launch configuration type in eclipse run/debug dialog?
As asked here in this bug hiding with activities is not working for me.
Are there any other ways to hide a given launch configuration type in eclipse run/debug dialog?

The Preferences has a configuration for hiding configuration types (in 'Run/Debug > Launching > Launch Configurations').
You could set these preference values, but this is an internal API so may change without notice.
The preference store is:
IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
Filtering by launch type is enabled with
store.getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES)
and the comma separated list of types to be filtered out is in
store.getString(IInternalDebugUIConstants.PREF_FILTER_TYPE_LIST)
As I said this is all an internal API.

Related

syso shortcut isn't working in Eclipse IDE

so when I'm trying to use the shortcut syso in eclipse IDE it opens a suggestion pop up instead of just displaying System.out.println like it used to any suggestions to fix this? (I added an example to show what's happening)
You could use the Type Filters preference page for this, as you almost never want to refer to anything in the jdk.internals packages, and it will apply regardless of the JDK you're using.
See Nitin Dahyabhai's answer for the straightforward and recommended solution.
Alternatively, to avoid that the content assist proposes for syso also the type jdk.internal.misc.FileSystemOption, you can add to the system library the access rule Forbidden **/internal/** (assuming Hide forbidden references is enabled in Type Filters):
Go to Project > Properties: Java Build Path tab Libraries
Select Acceess rules which is a sub-node of the JRE System Library
Click Edit...
In the Type Access Rules dialog, click Add...
In the Add Access Rules dialog, enter **/internal/** click OK
In the Type Access Rules dialog, click OK
Click Apply and Close
Alternatively, you can change the name of the sysout template in the preferences in Java > Editor > Templates.

Automatically changing Eclipse perspective when launching an application

Is is possible to change Eclipse IDE perspective when I launch an application?
There are similar, though not identical questions around:
Eclipse automating perspective changing or Being in Debug View, and after program termination, switch back to Java View in Eclipse.
Use-case: having a single monitor here, I would like to have my console get much bigger while running an application (while still switching to Debug perspective if I am in debugging mode).
From Doc Changing the active perspective when launching
You can control which perspective becomes active when a program is launched and when it suspends. The setting is configurable for each launch configuration type, for each of the launch modes it supports.
To activate a particular perspective when a program is launched, do the following:
Open the Run/Debug -> Perspectives preference page.
Select the Always option for the Open the associated perspective when launching preference. This will cause the perspective associated with a program to become active whenever it is launched.
To activate a particular perspective when a program is suspends, do the following:
Open the Run/Debug -> Perspectives preference page.
Select the Always option for the Open the associated perspective when an application suspends preference. This will cause the perspective associated with a program to become active whenever a program suspends.
See the following image for open Run/Debug -> Perspectives preference. This will be same for kepler also.

How to make sure that the rcp application always open in specific perspective?

I am working in an rcp application which I want to always open in specific perspective .I tried mentioning -perspective id but that is not solving my issue.And suppose my workbench is closed in perspective B then when user open it for second time it is always opening from B.
Any clue on this will help.
Assign your default perspective in Windows > Preferences > General > Perspectives preference page.
Can also be done through config.ini file Check here.
Using plugin_customization.ini file. Check here Setting default perspective in Eclipse for plugin development

Setting generic launch/run configuration in eclipse

When I select a class and choose Run as,
how can have eclipse give sub menu options such as Java application, Android application?
Basically, it's up to the plugin-contributor to set those actions. They are called lanuch-configuration-shortcuts, and unless it was not added in the plugin contribution, it will not be there.
Also, lunch shortcuts appear where are configured to appear, so if your current file (content-type) does not match the configuration rule, it will not appear in the Run-As.

Export single Eclipse Perspective and Settings

I customized my Eclipse for a special Latex Perspective and saved this perspective as "MyLatex". I even added shortcuts in my texlipse preferences, so that I can type "tab"+strg+space to insert a table.
Now I would like to offer this to friends. I found out that I can use Export->General->Settings, but this exports ALL perspectives.
Is there any way to export only the perspective "myLatex" and the texlipse editor templates?
Best regards
Philipp
There exists another way to do this.
Share Eclipse perspective layouts across multiple workspaces
To save your perspective, select Window > Save Perspective As… from
the application menu. A dialog should popup (shown below), prompting
you for a perspective name. Enter a name that you’ll remember, eg. My
Java or Debug Jack. Click Ok once you’ve entered a new name.
Note: You can choose to overwrite one of the default perspectives, eg.
Java, without fear. However, I prefer to leave these intact, so always
choose a new name, but you can choose whatever works for you.
Now you can go through the normal routine of exporting the preferences
to a properties file via File > Export > General > Preferences. Then
import the same file in another workspace via File > Import > General > Preferences. All you now have to do is switch over to the perspective you saved and all your layout settings will be restored.
If you overwrote one of the default perspectives, you may have to
select Window > Reset Perspective… to restore the saved settings.
If you’ve chosen to create a new perspective, be sure to point your
Run/Debug settings to the new perspective under Window > Preferences >
Run/Debug > Perspectives. For example, if you made a new perspective
based on the Debug perspective, then you’ll need to change references
to the Debug perspective to the My Debug for launchers you use.
I don't know of a nice way to export/import one perspective from eclipse, but maybe try the following:
open this file -
workspace/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
and copy the part that relates to your new perspective to the same file for the users you want to share it to. If this doesn't work you may have to replace the entire file in their workspace with your one.
In my case I had to copy from one workspace to another
.metadata.plugins\org.eclipse.e4.workbench