swt

Scroll chart with mouse wheel in TeeChart

假如想象 提交于 2019-12-11 14:15:46
问题 Default way to scroll chart is to drag mouse holding right button. I need to scroll with mouse wheel. I haven't found any API to enable/disable mouse wheel scrolling. I also tried to add MouseWheelListener to the chart itself, but it never gets called. Is it possible to use mouse wheel in TeeChart lib? My application is Eclipse RCP using SWT. 回答1: The following code works fine for me with TeeChart Java SWT in Eclipse: Bar bar1 = new Bar(tChart1.getChart()); bar1.fillSampleValues(); tChart1

SWT-Browser: How to load a resource using HTTPS if the certificate is untrusted?

让人想犯罪 __ 提交于 2019-12-11 14:12:11
问题 I am using the SWT Browser Widget to load the image of a webcam-server via HTTPS. Sadly the webcam-server certificate is untrusted. I tried to 2 variants to load the image: Browser.setHTML(String) Load the image using HTML+JavaScript every second. This is the prefered way to avoid flickering. This works very fine for HTTP, if i have a HTTPS connection i will see noting at all except my alternative text. Browser.setUrl(String) Load the image by setting the URL every second. This causes massiv

Access a widget from an event handler in Java SWT

断了今生、忘了曾经 提交于 2019-12-11 14:03:38
问题 I'm trying to design a small Java application with an UI using Java SWT: in Eclipse, I created a new Application Window and I added a button and a label. What I want is to make it so when I click the button, the label's text changes from "Not Clicked" to "Clicked". For this, I added an event handler for the button's SelectionEvent . However, I found that I cannot access the label from inside the event handler, so that I can change it's text. protected void createContents() { shell = new Shell

SWT and Webstart on Mac

◇◆丶佛笑我妖孽 提交于 2019-12-11 13:43:32
问题 I'm trying to develop a UI using SWT and Java Webstart. As a starting point I've created a simple app that works fine with Windows and Linux, but fails to work on Mac. My test app is available here. There are also links to the jar files and class code. Can anyone explain how to make this work on Mac? 回答1: See this Eclipse bug. Your JNLP file is incorrect. Remove the line <j2se version="1.5+"/> from the first <resources> tag. Specifying <j2se version="1.5+"/> in the <resources> tag without any

JFace/SWT: What is the best way to add a toolbar with Commands to a Section?

我的未来我决定 提交于 2019-12-11 13:39:39
问题 I have a Section and want to add a toolbar to it. I'm able to do it programmatically using the Actions but the requirement is to do it as much declaratively (in plugin.xml) as I can. So I'd like to define a Command and a Handler for each toolbar button but I don't know how to add them to the section's toolbar. Is there any way to do it declaratively in plugin.xml? If not, how can I do it programmatically? Thanks! 回答1: I think you would have to write your own extension point to define what

How to enable autoscroll for a StyledText Component

こ雲淡風輕ζ 提交于 2019-12-11 13:16:49
问题 I'm using StyledText component which behaves somewhat similar to the popular eclipse IDE console view, (which appends the log), but here, in my StyledText component the scroll-lock is enabled. I mean for each line appended to the StyledText , the vertical scroll bar position remains constant. Below image reflects the behavior: As an attempt I tried like this: StyledText declaration StyledText styledText = new StyledText(parent, SWT.V_SCROLL); //other relevant code here styledText.addListener

How to get ToolTip in a ListViewer in JFace?

不羁的心 提交于 2019-12-11 12:45:16
问题 This is a gridLayout in which the Available side is a Tree Viewer and The Selected side is a ListViewer. Now I have to get a toolTip on the right hand side. Which I am unable to get. I am working on a existing code base , so I am unable to figure out on which line did they add a tooltip + I did not find any keywords like tooltip or mouse Hover. Still how is this implemented. I am mentioning some code. I believe the answer should be somewhere here only. availableViewer = new TreeViewer

How to add a checkbox in a combo(Drop down) in java swt?

本小妞迷上赌 提交于 2019-12-11 12:36:22
问题 I want to have checkboxes in a combo(Drop down) so that I can select more than one elements of combo at once. Can this be done? If yes, can you please explain or provide any link if possible. Thank you. 回答1: Original poster asked for a drop down list with multi-selection support as an alternative. Custom implementation of MultiSelectionCombo can serve this purpose. Selected items are displayed in text field: Drop down with multi-selection support http://s12.postimg.org/7ee1y6j5n/Multi

How to lock swt Table or Jface tableviewer scrollbar

微笑、不失礼 提交于 2019-12-11 12:31:48
问题 I have a Tableviewer in which Objects are added really fast and I need the user to be able to select certain elements. The problem is that I can't find a way to make the scrollbar stop scrolling. I just want a button, which locks the Table at the current position. Maybe you have an answer. 回答1: [Edit] : You can use Toggle Button as Eclipse console have. You need to maintain below two states of button event. table#setSelection(item) will select the last item whichever is added.( Auto Scroll )

How to Disable Horizontal Scroll bar in ComboBox in SWT

感情迁移 提交于 2019-12-11 12:13:20
问题 I have created a combo Box but I am experiencing a strange behavior, If number of Elements in my Combobox is <= 2, I am unable to see a Horizontal scroll bar. But if they are more than 2 then I see a horizontal scroll bar automatically pop up. What I would like is, to disable the horizontal scroll bar. This is the code I am using. preferredResourceCombo = Components.createCombo(controlComposite, SWT.BORDER); GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false); gridData.widthHint