Menu
  • HOME
  • TAGS

Duplicate package name in different project causes InvalidAccessException when run as plugin test

java,eclipse,junit,eclipse-plugin

The most common way around this is to make your test bundle a Fragment rather than a Plugin and set its host plugin as the one containing the classes you are testing. This will mean the fragment uses the host plugin's ClassLoader and so should have access to those classes....

How Add jar file to eclipse plugin?

eclipse-plugin

You must add the jars to the Bundle-Classpath in the plugin MANIFEST.MF and also include them in the 'build.properties' file so they are included in the plugin build. To add to the Bundle-Classpath open the plugin.xml editor and go to the 'Runtime' tab. Add the jars to the 'Classpath' section...

Eclipse Wizard plugin executes code for all pages at once

java,eclipse,eclipse-plugin

Override the wizard page setVisible method and add the code which depends on previous pages there @Override public void setVisible(final boolean visible) { super.setVisible(visible); if (visible) { ... code to run when page becomes visible } } ...

Modify ivy classpath entry

java,eclipse,eclipse-plugin,ivy,ivyde

With the project, you can get all the class path entries. I went through and excludes the ivy entries. Then I re-added them with the correct class path and property files. Now, the paths do not include ${ivyproject_loc} and ${project_loc}. Here is the code: protected void changeIvyClasspath(IProject project, IProgressMonitor monitor)...

Eclipse Drools 6.2.0 Plugin Error: org/drools/StatefulSession

java,eclipse,eclipse-plugin,drools

Drools does not require you to add a semicolon after a statement on the right hand side if there is a line end following it. RHS code is parsed by a special (peculiar) parser, not strictly adhering to Java syntax. It's more lenient, but may not always be able to...

Get current line when some previous lines was collapsed in my own eclipse editor

java,eclipse,eclipse-plugin,swt,text-editor

If your editor is using ProjectionViewer as the source viewer you can use the ITextViewerExtension5 widgetOffset2ModelOffset method: ISourceViewer sourceViewer = getSourceViewer(); // Get your SourceViewer StyledText styledText = sourceViewer.getTextWidget(); int docOffset = 0; if (sourceViewer instanceof ITextViewerExtension5) { ITextViewerExtension5 extension = (ITextViewerExtension5)sourceViewer; docOffset = extension.widgetOffset2ModelOffset(styledText.getCaretOffset()); } else { int offset...

Starting and Stopping Host Plug-ins

java,eclipse-plugin

The extension point declarations are available from any installed plugin or fragment regardless of whether or not they have been started. Stopping the host plugin won't make that menu declaration unavailable. To achieve this you may need to register the menu contribution programmatically when the bundle starts and remove it...

Force Re-Evaluation of Command Enablement

java,eclipse-plugin

I think the IEvaluationService.requestEvaluation method may do what you want: IEvaluationService evalService = (IEvaluationService) PlatformUI.getWorkbench().getService(IEvaluationService.class); evalService.requestEvaluation("org.acme.printable"); The JavaDoc says Request that this service re-evaluate all registered core expressions that contain a property tester for the given property name. ...

How do you create a custom project type (from my plugin) without opening Eclipse?

java,eclipse,maven,eclipse-plugin

Here are my findings :- I went through the advice of Amos M. Carpenter and searched for the source code of the plugin that I have written. After that, I did a debug (Plugin Debug) and searched for the methods that are called when we create a project from the...

How do Java plug-in / extension applications work? [closed]

java,eclipse,user-interface,plugins,eclipse-plugin

In case of Eclipse, it isn't "something like OSGi", it's precisely OSGi. Eclipse just adds some specific services and Eclipse-specific notions like extension points.

Maven changing output directory for jar doesn't work

java,maven,jar,eclipse-plugin

From your packaging of eclipse-plugin I'm guessing you're using Tycho. Tycho doesn't seem to use any of the maven plugins, so configuring the maven-jar-plugin isn't going to help. Instead try configuring the tycho-packaging-plugin, specifically the buildDirectory property: <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-packaging-plugin</artifactId> <version>${tycho-version}</version> <configuration>...

A handler conflict occurred. This may disable some commands

eclipse-plugin,eclipse-rcp,eclipse-pde

You have specified the same handler in the command default handler and the handler extension point. Since they are both active you get a conflict. Don't specify the default handler....

How to use Timer and SwingWorker in an Eclipse Plugin?

java,eclipse,eclipse-plugin

Since Eclipse uses SWT rather than Swing it is best to avoid using Swing code. You can run code in the UI thread after a delay using UIJob, something like: UIJob job = new UIJob("Job title") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { updateView(); return Status.OK_STATUS; } }; job.schedule(3000); Alternatively...

What is the difference between jface treeviewer setComparer method and setSorter method?

java,eclipse-plugin,eclipse-rcp,jface

setSorter is an obsolete method which has been replaced by setComparator. The ViewerSorter class used by setSorter only supported the use of a Collator for sorting. The ViewerComparator class used by setComparator supports any Comparator class. The IElementComparer class set by the setComparer method is used when the viewer is...

Eclipse-PMD Configure ruleset globally

java,eclipse,eclipse-plugin,pmd

Try eclipse-pmd (available in the Eclipse marketplace or via the update site http://www.acanda.ch/eclipse-pmd/release/latest). With eclipse-pmd you can configure your projects to use a single rule set file for several projects. It also stores its path relative to the workspace. You still have to configure each project individually though (for now,...

What is difference between versions of eclipse like juno, kepler etc.? Which version to choose for web development?

eclipse,eclipse-plugin,web-deployment

Juno, indigo, Galileo are friendly names for release versions of Eclipse platform: Galileo is 3.5 Indigo is 3.7 Juno is 4.2 Luna is 4.4 Eclipse providers "prepackaged" distributions for your specific needs - http://www.eclipse.org/downloads/. For example http://www.eclipse.org/downloads/packages/eclipse-php-developers/lunasr2 is for PHP developers. I am not sure what specific web development you...

Rascal error installing artifact missing

eclipse-plugin,rascal

We were in the process of updating the stable plugin, something went wrong there. It should work now, you might have to refresh the update site. (or start with a new eclipse)....

Get highlighted variable -Eclipse

java,eclipse-plugin,syntax-highlighting,eclipse-cdt,highlight

Well after searching in some links, I achvieved that by using the ISelectionProvider and ITextSelection Interfaces. Here a code to get the name of the highlighted variable : ISelectionProvider selProvider = textEditor.getSelectionProvider(); ITextSelection txtSel = (ITextSelection) selProvider.getSelection(); String varName = txtSel.getText(); ...

How to run some code as soon as Eclipse has started?

java,eclipse-plugin,osgi,equinox,osgi-bundle

I took the JVM agent approach. Luckily P2 has ability to perform some extra actions via touchpoints -- I can use that to add the JVM agent option automatically at plugin install time and remove it when plugin is uninstalled. Sample p2.inf file (goes inside META-INF): instructions.install = \ addJvmArg(jvmArg:-javaagent:${artifact.location}/agent/my-agent.jar);...

How to use an IResourceChangeListener to detect a file rename and set the EditorPart name dynamically?

eclipse,user-interface,eclipse-plugin,eclipse-rcp

The IResourceChangeListener does fire for rename/move events using a combination of the REMOVED kind and a MOVED_TO flag). You can test for that in the IResourceDelta with @Override public void resourceChanged(final IResourceChangeEvent event) { IResourceDelta delta = event.getDelta(); // Look for change to our file delta = delta.findMember(IPath of file...

Is there any event to know if a view is moved below some other view?

java,eclipse-plugin,eclipse-rcp

You can use an org.eclipse.ui.IPartListener to listen for events about parts. In a ViewPart you can use: getSite().getPage().addPartListener(partListener); to add a listener. The listener has method for parts being opened, closed, activated and deactivated and brought to the top of stack. You can also use IPartListener2 which has some additional...

How to log starting of Eclipse plug-ins / OSGi bundles?

eclipse,eclipse-plugin,osgi,eclipse-rcp,osgi-bundle

Bundle state changes are already logged by OSGi to the Log Service. Please refer to chapter 101 of the OSGi Compendium specification. If you want to log bundle start events using some specific mechanism other than the standard Log Service, then you can write a BundleListener. The trick is to...

Missing jar files in Eclipse RCP 4.4.2 (Luna SR2) SDK, delta pack and language pack

jar,eclipse-plugin,eclipse-rcp,java-8,eclipse-luna

There is huge differences between the internals of 3.7 and 4.4 with many changes to plugins - some new, some removed. What you have downloaded covers the whole of the core Eclipse. org.eclipse.update.xxx is the old Eclipse update system which was replaced some time ago with the 'p2' install manager...

Tycho: How to bring all the eclipse test-plugins in target?

eclipse,maven,eclipse-plugin,tycho,surefire

Did you try the approaches mentioned in the below link ? https://wiki.eclipse.org/Tycho/Target_Platform I hope this will solve your issue....

Implementing a Launcher Framework - disabled Apply button on dialog

eclipse-plugin,eclipse-rcp

You must call updateLaunchConfigurationDialog() whenever anything changes that might update the Apply button - so all checkboxes and combos. You must also save everything that changes in the ILaunchConfigurationWorkingCopy in the performApply method. The Apply button state is determined by checking that the working copy is different from the original...

Set Eclipse “Refresh using native hooks or polling” to true through java code?

eclipse-plugin,refresh,workspace

Found the answer: IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode("org.eclipse.core.resources"); prefs.putBoolean(ResourcesPlugin.PREF_AUTO_REFRESH, true); prefs.flush(); Thanks all....

How to inactivate an eclipse plug-in without uninstall it?

eclipse,plugins,eclipse-plugin,kepler

You can temporarily disable a plugin simply by moving its directory out of Eclipse's plugins directory. In Eclipse, if you select Help | About | Installation Details | Plugins, the list of plugins has 2 columns 'Version' and 'Plug in Id'. The corresponding plugin subdirectory will have the format id_version....

OS X back/forward gestures in Eclipse IDE

eclipse,osx,eclipse-plugin,osx-yosemite

It works with BetterTouchTool, I forgot to restart Eclipse IDE.

File Selection from List in a Wizard page

eclipse,user-interface,eclipse-plugin,swt,jface

There is FilteredResourcesSelectionDialog that is a popup displaying any resource wanted, eventually with pre-loaded regexp, allowing to search for file, and you give him a root directory : You call getResult() to retrieve selection as Object[]. If you want to do just a wizard that does that, then I would...

show eclipse menuContribution in all perspective( not in only plugin development pespective)

java,eclipse,eclipse-plugin

Popup (context) menu contributions are not affected by the current perspective. However different perspectives may be using different views. In this case some perspectives are using the 'Package Explorer' view and others the 'Project Explorer' view. You need to use menu contributions for each view you want the popup to...

How to add buttons to the JFace ErrorDialog

java,eclipse-plugin,jface

You can extend the ErrorDialog class so that you can override the createButtonsForButtonBar method. For example this is from the Eclipse p2 install plugin: public class OkCancelErrorDialog extends ErrorDialog { public OkCancelErrorDialog(Shell parentShell, String dialogTitle, String message, IStatus status, int displayMask) { super(parentShell, dialogTitle, message, status, displayMask); } @Override protected...

Third party OSGi library dependency conflict

eclipse-plugin,osgi

Unfortunately not. You will have to change the jar to add the correct meta data. You should also report this issue at openarchitectureware. So they can produce correct artifacts for newer versions.

eclipse plugin: get notification on debug terminate

debugging,eclipse-plugin

You can call DebugPlugin.getDefault().addDebugEventListener(listener); to set up an IDebugEventSetListener. The DebugEvent passed to the handleDebugEvents method of the listener has TERMINATE as one of the event kinds. For example this handler is from the Ant plugin: @Override public void handleDebugEvents(DebugEvent[] events) { for (int i = 0; i < events.length;...

Run a thread always in eclipse

java,eclipse,multithreading,eclipse-plugin

You can still use a WorkspaceJob with the schedule(long delay) method to set your 30 second delay. Have the job reschedule itself after it has run to get it to run on a regular basis: WorkspaceJob job = new WorkspaceJob("jobname") { @Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { //...

Klocwork plugin failed to run in eclipse with error “java.lang.UnsatisfiedLinkError: no sqlite_jni in java.library.path”

eclipse,sqlite,eclipse-plugin,jni,klocwork

A little patience pays off... I read carefully the error message and it clearly says: Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true -Djava.library.path=".;C:\Program Files (x86)\myLib\win32" So I suddenly recall that I once set a environmental variable like this: _JAVA_OPTIONS = -Djava.net.preferIPv4Stack=true -Djava.library.path=".;C:\Program Files (x86)\myLib\win32" After I changed it to below, things begin to...

Update Eclipse menu radio state from code

eclipse,eclipse-plugin,eclipse-rcp

It's your responsability to call HandlerUtil.updateRadioState(event.getCommand(), scope); to make the GUI displays the new state. Without calling it, the radio state won't change. It means that in the case of user is aborting, don't call this method at all....

RCP or SWT to build eclipse plugin

java,eclipse,eclipse-plugin,swt,eclipse-rcp

Both, they aren't mutually exclusive. SWT is the widget toolkit used in Eclipse, and RCP ("Rich Client Platform") is an application platform based on SWT that is also the foundation of the Eclipse IDE. I'd suggest that you start with a project template. Get the latest "Eclipse for RCP and...

Eclipse PDE: Exclude test fragments from required plugins

eclipse,eclipse-plugin,eclipse-rcp,eclipse-pde

Add Required Plug-ins will always include fragments. Unfortunately, there is currently no way to control whether fragments are included or not. You will need to manually de-select the unwanted fragments....

Eclipse plugin development:How to open a file in external editor programmatically in eclipse plugin development

excel,eclipse-plugin

You can define an editor for xlsx in your plugin using the org.eclipse.ui.editors extension point: <extension point="org.eclipse.ui.editors"> <editor extensions="xlsx" id="myeditor.id" icon="icon path" launcher="myeditor.Launcher" name="XLSX editor"> </editor> </extension> This is using the launcher attribute to specify that a class to launch an external editor is to be used. The Launcher class...

How to hide/remove minimize button in editor?

java,eclipse-plugin,eclipse-rap

The minimize button is part of the stack presentation and cannot be removed easily. You would have to write your own presentation. The above said applies to the 3.x workbench. If you are using or can upgrade to RAP on e4, it should be easier to style certain aspects of...

NPE while testing

java,junit,eclipse-plugin,mockito

The first thing I would do is change when(provider.getPollFeedJob(Mockito.eq(feed), Mockito.eq(preferences), Mockito.eq(environment))) .thenReturn(job); to when(provider.getPollFeedJob(any(FeedDescriptor.class), any(NewsRcpPreferences.class), any(NotificationEnvironment.class))) .thenReturn(job); This is only to ensure that your provider is in fact giving you the mock job. Then I would add a doNothing().when(job).addJobChangeListener(any(JobChangeAdapter.class)); Or you can do the second one first. Either way those...

How to give PHP nature to a eclipse plugin

php,eclipse-plugin,eclipse-pde

Use the following code to add a nature to a project: IProject project = .... get the project you want to modify IProjectDescription description = project.getDescription(); String [] natures = description.getNatureIds(); String [] newNatures = new String[natures.length + 1]; System.arraycopy(natures, 0, newNatures, 0, natures.length); newNatures[natures.length] = "org.eclipse.php.core.PHPNature"; description.setNatureIds(newNatures); project.setDescription(description, null);...

How to open web.xml as tree view in eclipse?

eclipse,eclipse-plugin,web.xml

I'm afraid that's the only thing you can get, but design allows you to have a tree-like navigation

Make Command Only Visible When a Handler is Present

java,eclipse-plugin

This feels like a hack, but hooking this property tester to the command helps: public class HandlerEnabledTester extends PropertyTester { private static final String PROPERTY_HANDLER_ENABLED = "handlerEnabled"; @Override public boolean test(final Object receiver, final String property, final Object[] args, final Object expectedValue) { if (PROPERTY_HANDLER_ENABLED.equals(property)) { return isHandlerEnabled((String) expectedValue); }...

Re-set Editor Input of AbstractConfigurationEditor

eclipse,eclipse-plugin,eclipse-rcp

Added a method inside my abstract class to reset my editor input. :) public void newInput(IEditorInput i){ this.setInput(i); } ...

SWT FileDialog with java.lang.ClassNotFoundException

java,eclipse-plugin,swt

You need to add org.eclipse.swt to the Require-Bundle list in the MANIFEST.MF for your plugin. You can do this in the plugin.xml editor on the 'Dependencies' tab in the 'Required Plug-ins' table....

Add a new sub menu to compare with menu in Package explorer and project explorer

eclipse,eclipse-plugin,eclipse-rcp

The popup menu id for Project Explorer appears to be org.eclipse.ui.navigator.ProjectExplorer#PopupMenu Alternatively the PDE plugin uses: <menuContribution allPopups="false" locationURI="popup:org.eclipse.ui.popup.any?after=additions"> to add its 'Compare With > API Baseline' menu item....

Root directory of eclipse plugin project

java,eclipse-plugin,eclipse-rcp

Use Bundle bundle = Platform.getBundle("your plugin id"); URL pluginURL = FileLocator.find(bundle, new Path("TestFile.eap"), null); URL fileURL = FileLocator.toFileURL(pluginURL); File file = new File(fileURL.getPath()); If your plugin is packaged as a jar (as they usually are) this will extract the file from the jar to a temporary location so that you...

Goto method of class shortcut

java,eclipse,eclipse-plugin,keyboard-shortcuts

Eclipse jdt doesn't have it yet, but I believe an open method dialog similar to the open type dialog is in the works.. Please create a bug at bugs.eclipse.org if one doesn't exist describing what you would want in such a dialog.

Rename resource file does not change editor part title

eclipse,user-interface,eclipse-plugin,eclipse-rcp

Editors based on AbstractTextEditor (or one of its subclasses such as TextEditor) should handle renames through the FileDocumentProvider which listens for resource changes. Other editors need to use an IResourceChangeListener to deal with this....

Mac FileSync project is null when attempting filesync

eclipse,osx,eclipse-plugin

!MESSAGE Could not run FileSync builder - project is null! This means that the project was not selected. You need to select the project in Eclipse by clicking on it in the package explorer view. Then you can run the File Synchronization. ...

How to force team members to comment using eclipse plugin or something else

eclipse,jenkins,eclipse-plugin,coding-style,build-automation

You can run static code checks and their corresponding eclipse plug-ins to enforce comments being made in code. For e.g. in CheckStyle javadoc can be enforced http://checkstyle.sourceforge.net/config_javadoc.html Also checkstyle can be easily integrated with Jenkins. You can also use eclipse java compiler settings for javadoc check. Go to preferences->java->compiler->javadoc to...

IWorkspace search for file type

eclipse,user-interface,eclipse-plugin,eclipse-rcp

See this post you'll find your answer. Basically you need to recursively parse every IContainer (with members() method) and search in them the file you want...

How to contribute a context menu to a custom view in an eclipse plug-in project?

eclipse,debugging,view,eclipse-plugin,popup

You must create a context menu in your view code and register it with the view site. Something like: ISelectionProvider provider = ... a selection provider such as a TreeViewer or TableViewer Control control = control to own the menu - usually the TreeViewer or TableViewer control MenuManager menuMgr =...

SonarQube P2 repository has gone forever

eclipse-plugin,sonarqube,p2

The new update URL is: http://downloads.sonarsource.com/eclipse/eclipse/ This will be updated on the Eclipse Marketplace....

How to install JasperReports as an Eclipse plugin with no internet connection? [duplicate]

java,plugins,eclipse-plugin,jasper-reports

You can download the files from another computer and put it in a usb. I guess if you have connection for stackoverflow, you might have enough for downloading files. The procedure is shown here what I used before: open Eclipse: Help -> Install New Software... -> Add -> Archive.... Another...

How to go to the specified breakpoint in MyEclipse?

java,eclipse,eclipse-plugin,myeclipse

I don't think there is any way to do that but the eclipse debug perspective has a "drop to frame" capability which will take you back to the start of the method. This is standard eclipse functionality, not specific to MyEclipse.

Eclipse extension point for Open Resource/Open Type dialogs

eclipse,plugins,eclipse-plugin

These dialogs don't support customization. Open Resource is OpenResourceDialog (an internal class) derived from FilteredResourcesSelectionDialog. Open Type is OpenTypeSelectionDialog (again internal) derived from another internal class FilteredTypesSelectionDialog which in turn is derived from FilteredItemsSelectionDialog. ...

Cyclic Dependencies detected while creating exe from rcp plugin

java,eclipse-plugin,eclipse-rcp,rcp

It means for example : Plugin A has a dependency to plugin B and Plugin B has a dependency to plugin A You need to refactor your code so that you don't have this problem anymore. Try to determine which code/plugin is overused, and optimize the distribution, even if that...

Eclipse/OSGi: How to control the file-name created via an exported plugin (jar)

java,eclipse,eclipse-plugin,osgi

Qualifier is in the MANIFEST.MF file in the Version Tag. Remove it there.

java.lang.NoSuchMethodError: com.google.gwt.util.tools.Utility.versionCompare - Google Web Toolkit SDK 2.6.0

java,gwt,eclipse-plugin

If this is a Maven project, then M2Eclipse and the Google Plugin for Eclipse should auto-configure the project to use the GWT referenced from your POM, and not the one you could have installed in your Eclipse. So the problem is that you have GWT 2.6 on the classpath; your...

How can analyze single file in sonar eclipse plugin?

eclipse,eclipse-plugin,sonarqube

It's the other way round. Instead of specifying which file to analyse, you can exclude unwanted files/folders using various configurations available in SonarQube. Details available here: http://docs.sonarqube.org/display/SONAR/Analysis+Parameters...

Use existing perspective from a different plugin in RCP application

eclipse,eclipse-plugin,eclipse-rcp

Eclipse 3.x style plugins (anything using 'org.eclipse.ui.xxxx' plugins or extension points) won't work in a pure e4 RCP. This is because e4 leaves out a lot of the old 3.x compatibility code to make the RCP simpler. So if you are on a short timescale it is simpler to stick...

Checkstyle eclipse plugin: error cannot initialize module TreeWalker Token “WILDCARD_TYPE”

java,eclipse,eclipse-plugin,checkstyle

The error is in the xml file sun_checks_eclipse.xml, found in your plugins folder for checkstyle (e.g. .\eclipse\plugins\net.sf.eclipsecs.core_xxxxxx): <module name="WhitespaceAround"> <property name="tokens"...

How to process selections from different providers via the Eclipse Selection Service while maintaining loose coupling?

java,oop,design-patterns,eclipse-plugin,listener

You can make the objects you put in the selection implement IAdaptable which lets you query the object for class you actually want using: MyObject obj = ((IAdaptable)selectionObject).getAdapter(MyObject.class); Your selection object would have: public Object getAdapter(Class adapter) { if (adapter == MyObject.class) return .... my object instance return null; }...

How do I know if one class is superclass of another, given that I only have the fully qualified names of the classes as strings?

java,eclipse-plugin,jdt,eclipse-jdt

Since you have an IType in your question I assume you are using JDT. In this case you can query all supertypes (classes and interfaces) of an IType by creating its ITypeHierarchie. The only thing to watch out for is that java.lang.Object will not be included in the ITypeHierarchie (see...

How to structure my XText terminals? WORDS/SL_STRING/ML_STRING

java,eclipse,eclipse-plugin,dsl,xtext

You should implement a data type rule in order to achieve the desired behavior. Sebastian wrote an excellent blog post on this topic which can be found here: http://zarnekow.blogspot.de/2012/11/xtext-corner-6-data-types-terminals-why.html Here is a minimal example of a grammar: grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals generate myDsl "http://www.xtext.org/example/mydsl/MyDsl" Model: greetings+=Greeting*; Greeting: 'Example' ':' comment=Comment;...

Installing JavaFX plugin into Ecipse Kepler and getting errors

eclipse,javafx,eclipse-plugin

The error is telling you that release 3.9.0 (or later) of the org.eclipse.core.resources plugin is required. This is part of the Eclipse Luna (4.4) release, so you can't use this code with Eclipse Kepler.

Websphere Application Server 7 server adapter for Luna

eclipse,eclipse-plugin,websphere-7,eclipse-luna

Install WebSphere Developer Tools for Luna, you will have adapter for 8.5, 8.0, 7.0 and WebSphere Liberty there.

how to install shelled in eclipse luna

bash,shell,eclipse-plugin

Finally I managed to install it by deleting eclipse luna and downloading it again from scratch... I still don't understand why I got the errors in my old eclipse... It is rather annoying since I had a lot of plugins installed in my old eclipse and I had to re-install...

How to get image from plugin internal resources?

java,eclipse,eclipse-plugin,swt

Use something like: String path = "icons/imagename.png"; Bundle bundle = Platform.getBundle("plugin id"); URL url = FileLocator.find(bundle, new Path(path), null); ImageDescriptor imageDesc = ImageDescriptor.createFromURL(url); Image image = imageDesc.createImage(); Don't forget that you must dispose an image when you are done with it....

Save the selections in JFace Dialog (Java)

java,eclipse-plugin,dialog,eclipse-rcp

Use IDialogSettings for this: IDialogSettings settings = Activator.getDefault().getDialogSettings(); // Access an array of values stored in the settings String [] valuesArray = settings.getArray("key for value"); // Save array of strings in the settings settings.put("key for value", valuesArray); Activator is your plugin activator. IDialogSettings also has methods to access single strings,...

UML tool for reverse engineering a Java Project [closed]

java,eclipse,eclipse-plugin,uml,reverse-engineering

StarUML is a good open source tool, I think it have what you desire.

quickfix format using xtext

eclipse-plugin,xtext,xtend

That is rather a can that an is point public class MyDslUiModule extends org.xtext.example.mydsl1.ui.AbstractMyDslUiModule { public MyDslUiModule(AbstractUIPlugin plugin) { super(plugin); } public Class<? extends ITextEditComposer> bindITextEditComposer() { return MyDslTextEditComposer.class; } } public class MyDslTextEditComposer extends DefaultTextEditComposer { @Override protected SaveOptions getSaveOptions() { return SaveOptions.newBuilder().format().getOptions(); } } ...

Add a progress bar to a Job in RCP

java,eclipse-plugin,eclipse-rcp,rcp,jobs

Normally jobs show a progress indicator in the progress view and in the status line at the bottom of the main window. If you call setUser(true) before schedule() then the job will show a pop-up progress dialog if the job runs for more than a few seconds. To show job...

Opening an editor for a Java class that is within a jar (with source included)

eclipse-plugin

Use JavaUI.openInEditor(IJavaElement element); to open all Java elements (such as your IType)....

no acceptable features were found on the selected site

java,eclipse,eclipse-plugin,lotus-notes

In case anyone is running into a similar situation, we solved the problem as follows: We Started the client in debug mode "C:\Program Files (x86)\Notes9\framework\rcp\rcplauncher.exe" -config notes -console The console log showed us that a dependency, the jUnit plugin, was not available on the client. We moved the jUnit tests...

How to verify if a resource is of type .c, .h, .s in Eclipse?

java,eclipse,eclipse-plugin

Objects you get from the current selection often aren't instances of the underlying resource but can be 'adapted' to the resource using: IAdapterManager adapter = Platform.getAdapterManager(); IResource resource = (IResource)adapter.getAdapter(selectedObject, IResource.class); if (resource instanceof IFile) { .... } ...

Jackcess DatabaseBuilder.open fails

java,eclipse-plugin,jackcess

The .open method of DatabaseBuilder expects to open an existing well-formed Access database file. The .createTempFile method of java.io.File creates a 0-byte file. So, the code File dbFile; try { dbFile = File.createTempFile("eap-mirror", "eap"); try (Database db = DatabaseBuilder.open(dbFile)) { System.out.println(db.getFileFormat()); } catch (IOException ioe) { ioe.printStackTrace(System.out); } } catch...

RCP TT cannot record for my application

java,eclipse-plugin,eclipse-rcp,rcp

Make sure org.eclipse.rcptt.tesla.swt is in the deployed product

Eclipse plugin dev: make bundle to explode inside `plugins` folder

eclipse,eclipse-plugin,eclipse-rcp,nodeclipse

If you can change the source of the plugin you can change iconsdir = FileLocator.resolve(QuickImagePlugin.getDefault().getBundle().getEntry("/")).getFile() + "icons" + File.separator; to something like: URL dir = FileLocator.find(QuickImagePlugin.getDefault().getBundle(), new Path("icons"), null); dir = FileLocator.toFileURL(dir); String iconsdir = dir.getPath() + File.separator; This should work even when the plugin is packaged in a jar....

How does the ManifestEditor get the list of extensions of a plugin?

eclipse,eclipse-plugin

You can get the extensions used by a plugin from the extensions registry using something like: IExtensionRegistry reg = Platform.getExtensionRegistry(); Bundle bundle = Platform.getBundle("plugin id"); String id = Long.toString(bundle.getBundleId()); String name = bundle.getSymbolicName(); IContributor contributor = new RegistryContributor(id, name, null, null); IExtension [] extensions = reg.getExtensions(contributor); ...

Second overview ruler in Eclipse

eclipse,eclipse-plugin

You use the org.eclipse.ui.workbench.texteditor.rulerColumns extension point to define a column in the editor ruler. For example this is the standard definition for the annotation and line number columns: <extension point="org.eclipse.ui.workbench.texteditor.rulerColumns"> <column class="org.eclipse.ui.internal.texteditor.AnnotationColumn" enabled="true" global="true" id="org.eclipse.ui.editors.columns.annotations" includeInMenu="false" name="%AnnotationRuler.name"> <placement gravity="0.5"> <before...

Where to Find Package “org.eclipse.osgi.framework.internal.core”

java,eclipse-plugin

That package does not exist in the newer versions of Eclipse (it was in the org.eclipse.osgi plugin in 3.x versions). You can't take plugins from later versions of Eclipse and expect them to work in an earlier version. The first version of Eclipse to fully support Java 8 is Eclipse...

eclipse import gradle project download take forever

java,eclipse,eclipse-plugin,libgdx

if I understand your question, you can generate a project with libgdx setup in advance button, click on eclipse, offline mode, Gradle, download the dependencies on your computer. to import into eclipse the setup, where advanced eclipse click shows how to do it. setup libGDX advanced click click eclipse and...

How do I access general eclipse preferences in my own plugin

java,eclipse,plugins,eclipse-plugin,preferences

These preferences are in the org.eclipse.debug.ui plugin You can access the preference store using IPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.debug.ui"); The preference values are listed in the IDebugPreferenceConstants interface, but this is a internal class so should not be used. The values are public static final String CONSOLE_SYS_ERR_COLOR= "org.eclipse.debug.ui.errorColor"; public...

Retrieving arbitrary Eclipse preferences programmatically

eclipse,eclipse-plugin,jface

Use IFileEditorMapping[] mapping = PlatformUI.getWorkbench().getEditorRegistry().getFileEditorMappings(); to get the mappings between file types and their supported editors. Look at this javadoc to see everything you could ever want to know about the mappings...

synchronize modification between SWT table and TextEditor

table,eclipse-plugin,swt,text-editor,jface

The IDocument used by the TextEditor gives you access to the document contents. Get this with something like: IDocumentProvider provider = editor.getDocumentProvider(); IEditorInput input = editor.getEditorInput(); IDocument document = provider.getDocument(input); IDocument has many methods for accessing lines such as: int getLineOffset(int line); int getLineLength(int line); and methods for modify the...

org.eclipse.swt.SWTException: Invalid thread access from HandledContributionItem

eclipse,multithreading,eclipse-plugin,swt

It seems that you've hit a bug in Eclipse. The same stacktrace is described in Bug 445560. Chances are that the workaround described in this bug report (see comment 4) also helps in your case: As current local workaround for this issue I've added in our rcp code an early...

importing files as link to eclipse project using java

java,file,eclipse-plugin,swt,rcp

Read this link. http://help.eclipse.org/juno/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/resInt_linked.htm. Explained clearly on how to create Link files programmatically. If in case I understood your question wrongly, let me know. Updated based on comments received Snippet from the Link which explains how Link files shall be created programatically. IProject project = workspace.getProject("Project");//assume this exists IFolder link...

Add item above “Project” in eclipse project explorer contextmenu

eclipse,eclipse-plugin,ide,contextmenu,project-explorer

As has been mentioned in NewActionProvider.java there is no menugroupid to accomodate "My Project Wizard" in the "Project..." Group :(. /** * Adds a submenu to the given menu with the name "group.new" see * {@link ICommonMenuConstants#GROUP_NEW}). The submenu contains the following structure: * * <ul> * <li>a new generic...

Close an open IFile in editor if it is deleted in Project Explorer

eclipse-plugin,eclipse-rcp

A resource change event usually contains information about changes to all related resources. For a file change this will be the file, parent folders and the project. The getResource method of IResourceChangeEvent just returns you the top most resource that has been changed. The IResourceDelta returned by getDelta contains the...

Tycho compiler does not find classes from plugin dependecies

eclipse,maven,build,eclipse-plugin,tycho

When you enable debug output (-X), the log output of the tycho-compiler-plugin includes the exact list of JARs that Tycho compiles against. (Look for [DEBUG] Classpath:) So if you e.g. see that Tycho's dependency resolution picked the wrong version of org.eclipse.xtext.xbase, you can either change the target platform so that...

Where does maven dependency fetch packages from?

maven,java-ee,eclipse-plugin

Where are these packages fetched from and displayed? By default, Maven will download from the Maven Central Repository, which is located at this URL: http://search.maven.org/ You can also add a custom repository by using the <repository> tag. Here is an example of how you can add the JBoss repository...

How can we change default label provider of eclipse ide's project explorer view to render file with customized label

eclipse,eclipse-plugin,jface

we can extend eclipse decoration extension point to provide custom label. <extension point="org.eclipse.ui.decorators"> <decorator id="YourDecorator" label="Decorator Label" state="false" class="YourDecorator.class" objectClass="org.eclipse.core.resources.IResource" adaptable="true"> </decorator> </extension> for more info visit the following link : :https://eclipse.org/articles/Article-Decorators/decorators.html ...

Always show the file path in FilteredResourcesSelectionDialog

eclipse,eclipse-plugin,swt,eclipse-rcp,jface

The path is shown when there are multiple entries with the same name. This is to allow you to distinguish the entries. If you create a class derived from FilteredResourcesSelectionDialog (or anything based on FilteredItemsSelectionDialog) you can override the isDuplicateElement method to control this, for example: @Override public boolean isDuplicateElement(Object...

How to share common functionality between two Eclipse plugins?

java,eclipse,eclipse-plugin

The only problem I see with this latter approach is that the common plugin doesn't have any sort of functionality available to the user (i.e., no UI). That's not unusual, and you've already come up with the right approach (although it's to require the new one as a dependency,...

Filter file system file selection dialog by ContentTypeId

eclipse,eclipse-plugin

The standard SWT FileDialog can only be filtered by file extension and cannot be extended. You could write your own file selection dialog using the normal Java File or Path APIs with a tree viewer and a viewer filter. Because the files are outside of the workspace you can't use...