String before= PreferencesMessages.getString("SmartTypingConfigurationBlock.tabs.message.before"); String linkText= PreferencesMessages.getString("SmartTypingConfigurationBlock.tabs.message.linktext"); String linkTooltip= PreferencesMessages.getString("SmartTypingConfigurationBlock.tabs.message.linktooltip"); String after= PreferencesMessages.getFormattedString("SmartTypingConfigurationBlock.tabs.message.after", new String[] {Integer.toString(getIndentSize()), getIndentChar()});
String linkTooltip= PreferencesMessages.getString("SmartTypingConfigurationBlock.tabs.message.tooltip"); String text= PreferencesMessages.getFormattedString("SmartTypingConfigurationBlock.tabs.message.text", new String[] {Integer.toString(getIndentSize()), getIndentChar()});
	private void createMessage(final Composite composite) {		// TODO create a link with an argument, so the formatter preference page can open the 		// current profile automatically.		String before= PreferencesMessages.getString("SmartTypingConfigurationBlock.tabs.message.before"); //$NON-NLS-1$		String linkText= PreferencesMessages.getString("SmartTypingConfigurationBlock.tabs.message.linktext"); //$NON-NLS-1$		String linkTooltip= PreferencesMessages.getString("SmartTypingConfigurationBlock.tabs.message.linktooltip"); //$NON-NLS-1$		String after= PreferencesMessages.getFormattedString("SmartTypingConfigurationBlock.tabs.message.after", new String[] {Integer.toString(getIndentSize()), getIndentChar()}); //$NON-NLS-1$				final CHyperLinkText link= new CHyperLinkText(composite, SWT.NONE);		link.setText(before + " {org.eclipse.jdt.ui.preferences.CodeFormatterPreferencePage," + linkText + "," + linkTooltip + "}" + after ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$		GridData gd= new GridData(SWT.FILL, SWT.BEGINNING, true, false);		gd.widthHint= 300; // don't get wider initially		link.setLayoutData(gd);		link.addLinkListener(new ILinkListener() {			public void linkSelected(String url) {				PreferencesUtil.createPreferenceDialogOn(link.getShell(), url, null, null);			}		});				final IPreferenceStore combinedStore= JavaPlugin.getDefault().getCombinedPreferenceStore();		final IPropertyChangeListener propertyChangeListener= new IPropertyChangeListener() {			private boolean fHasRun= false;			public void propertyChange(PropertyChangeEvent event) {				if (fHasRun)					return;				if (composite.isDisposed())					return;				String property= event.getProperty();				if (DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR.equals(property)						|| DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE.equals(property)) {					fHasRun= true;					link.dispose();					createMessage(composite);					composite.redraw();					composite.layout();				}			}		};		combinedStore.addPropertyChangeListener(propertyChangeListener);		link.addDisposeListener(new DisposeListener() {				public void widgetDisposed(org.eclipse.swt.events.DisposeEvent e) {					combinedStore.removePropertyChangeListener(propertyChangeListener);				}		});	}