How to remove eclipse editor's default context menu actions? - editor

I would like to remove (or make invisible) the default context menu actions from my custom GEF editor.
I have some custom actions (IAction) which I register (using createActions()) that I can see and run, however I would like to see only them on my context menu.
In other words - is there a way to remove "Run As", "Debug As", "Profile As", etc...?
In the image above, for example, I would like to display only "Delete" action.
Many thanks in advance... !

This is because you have included ide plugins in your product.

I guess you use code like this to add your context menu:
MenuManager menuManager = new MenuManager();
Menu contextMenu = menuManager.createContextMenu(table);
table.setMenu(contextMenu);
getSite().registerContextMenu(menuManager, selectionProvider);
The last line is important. Replace it with
getEditorSite().registerContextMenu(menuManager, selectionProvider, false);
and the default entries will be gone.

Related

How to avoid AppBuilder removing pieces of code

I'm working on a Progress-4GL programming environment, based on AppBuilder release 11.6.
Until now I've been changing already existing *.w and *.p files, but now I wanted to created my *.w file from scratch.
I've created a window and I've put a browse, a fill-in field and a button. Now I would like to add an event to that button. In order to do that, I add following lines to the *.w file:
ON CHOOSE OF btn-Start_Query IN FRAME DEFAULT-FRAME
DO:
MESSAGE "button is pushed" VIEW-AS ALERT-BOX.
END.
However, when I save the *.w file, re-open it in the AppBuilder and save the file there again, those lines of code get removed.
I've already understood that, in order to avoid this, I need to "wrap" those lines of code by Scoped-define or Analyze:suspend/resume lines, something like this:
&Scoped-define SELF-NAME btn-Start_Query
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn-Start_Query C-Win
ON CHOOSE OF btn-Start_Query IN FRAME DEFAULT-FRAME
DO:
MESSAGE "button is pushed" VIEW-AS ALERT-BOX.
END.
&ANALYZE-RESUME
However, this seems not to be working.
Can you explain me what exactly I have to do in order avoid my lines of code to be removed?
By the way: I know that I'm working with extremely outdated technology, but I only work here for two weeks, so I don't have the authority to force my boss to change his development environment, just for me.
The recommended approach is to use the Wizards of the AppBuilder to create the trigger block with the required AppBuilder markup for you.
Add the button to the Window
Select the button on the design canvas
Choose the "Edit code" button in the AppBuilder main window (the pencil)
This will create an empty default trigger block (in case of a button, that's the CHOOSE). To create a different event, use the "New..." button in the section editor window.

How to edit the main menu text in mantis bug tracker

I am trying to change the main menu text in the mantis bug tracker like "Report Issue" to "New Project" how can i accomplish this?
I looked at custom_strings_inc.php but I could not understand how to change the main menu text from there.
You will have to identify the correct lang variable name from the existing lang files (in lang folder) and override them in custom_strings.
For example, if you want to change Report Issue to New Project, edit custom_strings_inc.php and add the following line:
$s_report_bug_link = "New Project";

JIRA: How to add a separator to a menu plugin between two links

I do my first steps in creating a plugin with the Atlassian Plugin SDK and I tried the Adding Menu Items to JIRA tutorial.
Now, I would like to add a separator between two menu links (like it is in the dashboard menu) but I did not find a hint how to do it.
I took a look at the Web Item Plugin Module but cannot find anything helpful.
Is there anybody with a tip for me - this can't be to complicated and I am for sure just blind...
In advance, thanks!
The web-section is used to group menu items together, including adding a label above a group of collected menu options...and it also forces a line above the section. If you do not specify a label, it will simply render as a line, which is what you want.
The web-items that you want to go below the line should have a location set to "inside" the web-section you create, which you construct by setting the location to whatever your original menu location was, a slash, and the key you used for the new web section.
eg.
<web-item key="myMenuItemBeforeTheLine" ... location="YOUR_ORIGINAL_MENU_LOCATION">
... menu option goes here ...
</web-item>
<web-section key="NEW_SECTION" ... location="YOUR_ORIGINAL_MENU_LOCATION">
...
</web-section>
<web-item key="myMenuItemAfterTheLine" ... location="YOUR_ORIGINAL_MENU_LOCATION/NEW_SECTION">
... menu options goes here ...
</web-item>

TFS 2010: Change 'Work Item' type from 'Product Backlog Item' to 'Task' - how to?

I want to change the type of a 'Work Item' in TFS 2010: I entered a Work Item to the Product Backlog (we're using a Scrum template), and then I entered several 'Child' tasks, but I entered them as 'Product Backlog Items'. I should have entered them as 'Tasks'. How can I change them to appear as Tasks - children of the original 'Work Item'.
A previous question: Change TFS Work Item Type
would suggest that this is not simple. Can anyone help?
#PortageMonkey's answer to the question you quote contains pretty much what you need.
As noted you cannot directly change the work item type however there
is a nice shortcut that may save you a lot of time for these
scenarios. It will automatically copy links to change sets, test cases
etc.
Right-click on your work item and select "Create Copy of Work Item"
The following dialog window will pop up where you can then change the work item type for the new item:
Result: A new work item is
created with the new type and the old one automatically added as a
link and a comment added to the history area stating the work item ID
it was copied from.
So, use this feature to copy them and convert them to tasks at the same time by choosing "task" in the copy dialog. Once the copy is done, flag the original item to "removed".
Changing a work item's type is now possible by right-clicking the work item in the web view and choosing Change Type:
Here's the link referenced in the screenshot above.

How to display line numbers by default in SciTE?

I am using the lightweight SciTE Text editor and I like it very much.
I would like to configure it in order to see the line numbers displayed when I open it.
I don't want to check the "View\Line Number" menu every time.
I think that I can do it but I don't see the entry in my global options file. Does anybody know how to do it?
Try this in SciTEGlobal.properties:
# Sizes and visibility in edit pane
line.margin.visible=1
line.margin.width=5
# Sizes and visibility in edit pane
line.margin.visible=1
line.margin.width=2+ # + will expand if needed
Having seen the other answers i would say it is more "clean" to save to User options file, because it is a user setting and you might also transfer this setting together with your home directory f.e. when you migrate or copy it for other reason. Also in this cases your scite would still behave like YOU (and possibly other users) expect.
add this line to User options file ".SciTEUser.properties":
line.margin.visible=1
line.margin.width=0+ # + will expand if needed
additional comment:
for my taste the font of scite in linux is too small and therefore i also added these lines to .SciTEUser.properties:
magnification=1
output.magnification=1

Resources