Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Plugin - mark or color or evidence a row in text editor(I need to evidence a row in the text editor coloring it in red)
Plugin - mark or color or evidence a row in text editor [message #1648057] Tue, 03 March 2015 18:56
Tomas Bortoli is currently offline Tomas BortoliFriend
Messages: 5
Registered: March 2015
Junior Member
Hi everybody. I'm new to plugin development in eclipse, and I'm trying to achieve this task. I've done a popup menu with target ID="#TextEditorContext" (in plugin.xml) so it appear into the text editor when I press the right button of the mouse. Then my problem is evidencing a row. Here is the code of my Mark class that handles the context menu interactions.


package com.slicerplugin.popup.actions;

import java.awt.Color;

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorActionDelegate;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPart;

public class Mark implements IEditorActionDelegate {

private Shell shell;

/**
* Constructor for Action1.
*/
public Mark() {
super();
}

/**
* @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
*/
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
shell = targetPart.getSite().getShell();
}

/**
* @see IActionDelegate#run(IAction)
*/
public void run(IAction action) {
MessageDialog.openInformation(
shell,
action.getActionDefinitionId(),
action.getAccelerator()+" ");


}

/**
* @see IActionDelegate#selectionChanged(IAction, ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
MessageDialog.openInformation(
shell,
action.getActionDefinitionId(),
selection.toString());

}

@Override
public void setActiveEditor(IAction action, IEditorPart targetEditor) {
// TODO Auto-generated method stub

MessageDialog.openInformation(
shell,
action.getActionDefinitionId(),
targetEditor.getTitle());

}

}



The code is actually pseudo random just for explore something.

Someone have idea of how can I achieve this task?????????????



Thanks thousand!

Previous Topic:How to make editor area always visible
Next Topic:Way to automatically rotate .metadata/.log file?
Goto Forum:
  


Current Time: Thu Mar 28 11:02:41 GMT 2024

Powered by FUDForum. Page generated in 0.03148 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top