eclipse-rcp

How to resize a scroll composite to always fit its contents horizontally?

倾然丶 夕夏残阳落幕 提交于 2019-12-12 15:02:07
问题 I have a scrolled composite ,it contains a tableViewer. My requirement is that if the table is increased in width,the scroll composite should not show horizontal scroll ,but it should expand to fit table's size. The only reason I have used a scrolled composite here is I want to show vertical scroll bar. 回答1: If you want to control the scrollbars of a Table in SWT - which is a sub-class of Scrollable - simply add one or more of the following styles in the constructor. If you construct a Viewer

Scrolling canvas content

对着背影说爱祢 提交于 2019-12-12 13:21:11
问题 I have drawn some text and rectangles on canvas. package com.cavium.test.views; import org.eclipse.swt.SWT; import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.ScrollBar; import org.eclipse.swt.widgets.Shell; public class Test2

Moving an image of a TitleAreaDialog to the left

≡放荡痞女 提交于 2019-12-12 12:07:44
问题 I'm working on a SWT/Jface project based on Java SE, i want to move the image of a TitleAreaDialog to the left. is it possible ? if not is there anyway ? Thanks, 回答1: You can modify the layout data of the image label as follows: TitleAreaDialog tad = new TitleAreaDialog(getShell()) { @Override protected Control createContents(Composite parent) { Control control = super.createContents(parent); Label label = getTitleImageLabel(); FormData data = (FormData) label.getLayoutData(); data.left = new

Why is the “Source Code Locations” page missing on eclipse 3.6 (Helios)

本小妞迷上赌 提交于 2019-12-12 09:46:14
问题 I'm trying to add JFace source code on my Target Platform in Eclipse 3.6. Many help page on the internet refers to a "Source Code Locations" tab from the Target Platform preferences page. I do not have that tab on a fresh Eclipse 3.6 including RCP development (eclipse-rcp-helios-SR1-RC4-win32.zip). Here's a screenshot of my Target Platform preferences page : Any idea how add source code to my target platform ? 回答1: Many help page might refer to that tab, but the Eclipse Helios page doesn't.

MouseDown events are not delivered until MouseUp when a Drag Source is present

纵然是瞬间 提交于 2019-12-12 09:30:10
问题 I have a mouse listener. It has some code to respond to mouseUp and mouseDown events. This works correctly. However, as soon as I add a DragSource, my mouseDown event is no longer delivered -- until I release the mouse button! This is trivial to reproduce - below is a simple program which contains a plain shell with just a mouse listener and a drag listener. When I run this (on a Mac), and I press and hold the mouse button, nothing happens - but as soon as I release the mouse button, I

Enable/disable menu item in Eclipse plugin

江枫思渺然 提交于 2019-12-12 08:52:50
问题 I've made a pop-up menu with one menu item, I want to enable it only when I do a right click on a tree item of a certain class type otherwise disable it. How can I achieve this? 回答1: You can add a handler that uses activeWhen and associate it with that menu's command id. Here is a handler that makes a command active only when the current selection is not empty, and the selection is an item that can be adapted to an object of type Widget : <extension point="org.eclipse.ui.handlers"> <handler

What do the PDE icons in Eclipse mean?

被刻印的时光 ゝ 提交于 2019-12-12 06:25:26
问题 Following the question "What do the icons in Eclipse mean?" that has an excellent answer I hope to find what all the icons and icon decorations of the "Plug-ins" and "Plug-ins Dependencies" views of the PDE 回答1: I can fill in most of those: Main Icons : Plugin : Fragment Overlays : Re-exported by parent plugin : Optional import : Exists in the target platform (not the workspace) 来源: https://stackoverflow.com/questions/17277288/what-do-the-pde-icons-in-eclipse-mean

Define .eclipseproduct during build

谁都会走 提交于 2019-12-12 06:02:03
问题 When I build my product .eclipseproduct is generated. Is this file still relevant for Eclipse 3.6+? Is there a way to modify this file to reflect my product? I know I can alter this file myself, but was wondering if there is a plugin that can do this? 回答1: In the installation profile ( p2/org.eclipse.equinox.p2.engine/profileRegistry/<ProfileName>.profile/<highest number>.profile.gz ) of your product installation, you can find out where the .eclipseproduct file comes from: It is extracted

How to show SLF4J logs of an RCP application in within the application?

北战南征 提交于 2019-12-12 05:27:47
问题 Obviously it's possible to write my own appender in Logback which sends the output to an IConsole . Is there a simpler way? 回答1: Can't you just use Eclipse plugin for logback? 来源: https://stackoverflow.com/questions/8026444/how-to-show-slf4j-logs-of-an-rcp-application-in-within-the-application

Open Perspective programmatically

耗尽温柔 提交于 2019-12-12 05:25:59
问题 I am trying to provide a command/ handler to switch to a specific Perspective. I came up with the following class: public class OpenPerspectiveHandler { private static final Logger logger = Logger.getLogger(OpenPerspectiveHandler.class); @Inject private MApplication application; @Inject private EModelService modelService; @Inject private EPartService partService; private final String perspectiveId; public OpenPerspectiveHandler(String perspectiveId) { super(); this.perspectiveId =