Java Code Examples for org.eclipse.swt.widgets.Label.addListener()

The following are Jave code examples for showing how to use addListener() of the org.eclipse.swt.widgets.Label class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Hydrograph   File: ComponentTooltip.java   View Source Code Vote up 6 votes
private void addLookupConfigurationDetailsInTooltip(final Composite container, String driverKey, String lookupKey, String lookupPort)
{
	Label driverKeyLabel = new Label(container, SWT.NONE);
	Label lookupKeyLabel = new Label(container, SWT.NONE);
	Label lookupPortLabel = new Label(container, SWT.NONE);
	driverKeyLabel.setText(DRIVER_KEY+driverKey);
	lookupKeyLabel.setText(LOOKUP_KEY+lookupKey);
	lookupPortLabel.setText(LOOKUP_PORT+lookupPort);
	driverKeyLabel.setBackground(container.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
	driverKeyLabel.addListener(SWT.MouseUp, getMouseClickListener(container));
	lookupKeyLabel.setBackground(container.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
	lookupKeyLabel.addListener(SWT.MouseUp, getMouseClickListener(container));
	lookupPortLabel.setBackground(container.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
	lookupPortLabel.addListener(SWT.MouseUp, getMouseClickListener(container));
	showErrorMessageWhenFieldIsEmpty(driverKey,driverKeyLabel,Messages.DRIVER_KEY_ERROR_MESSAGE);
	showErrorMessageWhenFieldIsEmpty(lookupKey,lookupKeyLabel,Messages.LOOKUP_KEY_ERROR_MESSAGE);
}
 
Example 2
Project: Hydrograph   File: ComponentTooltip.java   View Source Code Vote up 5 votes
private Label setExternalSchemaInTooltip(final Composite container, String externalSchemaPath) {
	Label externalSchemaPathLabel = new Label(container, SWT.NONE);
	externalSchemaPathLabel.setText(EXTERNAL_SCHEMA_PATH + externalSchemaPath);
	externalSchemaPathLabel.setBackground(container.getDisplay().getSystemColor(
			SWT.COLOR_INFO_BACKGROUND));
	externalSchemaPathLabel.addListener(SWT.MouseUp, getMouseClickListener(container));
	return externalSchemaPathLabel;
}
 
Example 3
Project: Hydrograph   File: ComponentTooltip.java   View Source Code Vote up 5 votes
private void addJoinKeysInTooltip(final Composite container, String joinKey, int index)
{
	Label joinKeyLabel = new Label(container, SWT.NONE);
	joinKeyLabel.setText(JOIN_KEY+index+":"+joinKey);
	joinKeyLabel.setBackground(container.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
	joinKeyLabel.addListener(SWT.MouseUp, getMouseClickListener(container));
	showErrorMessageWhenFieldIsEmpty(joinKey,joinKeyLabel,Messages.JOIN_KEY_ERROR_MESSAGE);
}
 
Example 4
Project: Hydrograph   File: ComponentTooltip.java   View Source Code Vote up 5 votes
private void addRecordRequiredInTooltip(final Composite container, String recordRequired, int index)
{
	Label recordRequiredLabel = new Label(container, SWT.NONE);
	recordRequiredLabel.setText(RECORD_REQUIRED+index+":"+recordRequired);
	recordRequiredLabel.setBackground(container.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
	recordRequiredLabel.addListener(SWT.MouseUp, getMouseClickListener(container));
}
 
Example 5
Project: Hydrograph   File: ComponentTooltip.java   View Source Code Vote up 5 votes
private Label addPropertyInTooltipWindow(final Composite container, PropertyToolTipInformation propertyInfo) {
	Label lblTextProperty = new Label(container, SWT.NONE);
	String propertyNameCapitalized = getCapitalizedName(propertyInfo);

	logger.debug("ComponentTooltip.addPropertyToToolTip() - propertyInfo=" + propertyInfo.toString());

	addText(propertyInfo, lblTextProperty, propertyNameCapitalized);

	lblTextProperty.setBackground(container.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
	lblTextProperty.addListener(SWT.MouseUp, getMouseClickListener(container));
	return lblTextProperty;
}
 
Example 6
Project: BiglyBT   File: StatsView.java   View Source Code Vote up 4 votes
private void initialize(Composite composite) {
	parent = composite;

   // Call plugin listeners
	UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
	if (uiFunctions != null) {
		tabbedMDI = uiFunctions.createTabbedMDI(composite, VIEW_ID);

		CTabFolder folder = tabbedMDI.getTabFolder();
		Label lblClose = new Label(folder, SWT.WRAP);
		lblClose.setText("x");
		lblClose.addListener(SWT.MouseUp, new Listener() {
			@Override
			public void handleEvent(Event event) {
				delete();
			}
		});
		folder.setTopRight(lblClose);


		UISWTInstance pluginUI = uiFunctions.getUISWTInstance();

		registerPluginViews(pluginUI);

		if ( pluginUI != null ){
			UISWTViewEventListenerWrapper[] pluginViews = pluginUI.getViewListeners(UISWTInstance.VIEW_STATISTICS);
			for (int i = 0; i < pluginViews.length; i++) {
				UISWTViewEventListenerWrapper l = pluginViews[i];
				String name = l.getViewID();

				try {
					MdiEntrySWT entry = (MdiEntrySWT) tabbedMDI.createEntryFromEventListener(
							UISWTInstance.VIEW_STATISTICS, l, name, false, null, null);
					entry.setDestroyOnDeactivate(false);
					if ((dataSource == null && i == 0) || name.equals(dataSource)) {
						tabbedMDI.showEntry(entry);
					}
				} catch (Exception e) {
					// skip
				}
			}
		}
	}

	updateThread = new UpdateThread();
	updateThread.setDaemon(true);
	updateThread.start();

	dataSourceChanged(dataSource);
}