use of org.eclipse.jface.preference.IPreferenceStore in project tdi-studio-se by Talend.
the class TalendEditorPaletteFactory method createEntryFrom.
public static TalendCombinedTemplateCreationEntry createEntryFrom(IComponent component) {
if (component == null) {
return null;
}
String name = component.getName();
ImageDescriptor imageSmall = component.getIcon16();
IPreferenceStore store = DesignerPlugin.getDefault().getPreferenceStore();
ImageDescriptor imageLarge;
final String string = store.getString(TalendDesignerPrefConstants.LARGE_ICONS_SIZE);
if (string.equals("24")) {
//$NON-NLS-1$
imageLarge = component.getIcon24();
} else {
imageLarge = component.getIcon32();
}
TalendCombinedTemplateCreationEntry newEntry = new TalendCombinedTemplateCreationEntry(name, name, Node.class, component, imageSmall, imageLarge);
newEntry.setDescription(component.getLongName());
return newEntry;
}
use of org.eclipse.jface.preference.IPreferenceStore in project tdi-studio-se by Talend.
the class DownloadCheckUpdatesDialog method createDialogArea.
/**
* Create contents of the dialog.
*
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
Composite composite = new Composite(container, SWT.NONE);
composite.setLayout(new GridLayout(2, false));
GridData gd_composite = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_composite.heightHint = 188;
gd_composite.widthHint = 423;
composite.setLayoutData(gd_composite);
Label lblNewLabel = new Label(composite, SWT.NONE);
GridData gd_lblNewLabel = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
gd_lblNewLabel.heightHint = 92;
gd_lblNewLabel.widthHint = 406;
lblNewLabel.setLayoutData(gd_lblNewLabel);
lblNewLabel.setText("\nThere are newer versions of some items you have downloaded\nfrom the Talend Exchange.");
Label lblNewLabel_1 = new Label(composite, SWT.NONE);
lblNewLabel_1.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
lblNewLabel_1.setText("Total available updates : ");
new Label(composite, SWT.NONE);
new Label(composite, SWT.NONE);
new Label(composite, SWT.NONE);
new Label(composite, SWT.NONE);
Button btnCheckButton = new Button(composite, SWT.CHECK);
btnCheckButton.setText("Don't ask again ");
new Label(composite, SWT.NONE);
btnCheckButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
IPreferenceStore prefStore = PlatformUI.getPreferenceStore();
prefStore.setValue(ITalendCorePrefConstants.EXCHANGE_DOWNLOADED_CHECK_UPDATES, true);
cancelPressed();
}
});
return container;
}
use of org.eclipse.jface.preference.IPreferenceStore in project tdi-studio-se by Talend.
the class BusinessRulersAndGridComposite method initializeControls.
/**
*
* Sets up controls with proper layouts and groups
*
* @param parent
*/
private void initializeControls(Composite parent) {
parent.setLayout(new GridLayout(1, false));
// Top row composite
Composite topComposite = widgetFactory.createComposite(parent);
topComposite.setLayout(new GridLayout(2, false));
// Create the groups for this section
createDisplayGroup(topComposite);
createMeasurementGroup(topComposite);
// Bottom row composite
Composite bottomComposite = widgetFactory.createComposite(parent);
bottomComposite.setLayout(new GridLayout(2, false));
// Create grid line settings
createGridlineGroup(bottomComposite);
Composite extraComposite = widgetFactory.createComposite(bottomComposite);
extraComposite.setLayout(new GridLayout(1, false));
// Create snap to grid checkbox
snapToGridButton = widgetFactory.createButton(extraComposite, SNAP_TO_GRID_LABEL, SWT.CHECK);
snapToGridButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
// Set the snap to grid workspace property
setWorkspaceProperty(WorkspaceViewerProperties.SNAPTOGRID, snapToGridButton.getSelection());
}
});
// Create snap to geometry checkbox
snapToGeometryButton = widgetFactory.createButton(extraComposite, SNAP_TO_GEOMETRY_LABEL, SWT.CHECK);
snapToGeometryButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
// Set the snap to geometry workspace property
setWorkspaceProperty(WorkspaceViewerProperties.SNAPTOGEOMETRY, snapToGeometryButton.getSelection());
}
});
// Create restore to preferences defaults
restoreButton = widgetFactory.createButton(extraComposite, RESTORE_LABEL, SWT.PUSH);
restoreButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
restorePreferenceValues();
}
private void restorePreferenceValues() {
IPreferenceStore preferenceStore = getPreferenceStore();
// The workspace properties will always exist because it is set
//
IPreferenceStore wsPrefStore = getWorkspaceViewerProperties();
if (wsPrefStore.getBoolean(WorkspaceViewerProperties.GRIDORDER) == false) {
wsPrefStore.setValue(WorkspaceViewerProperties.GRIDORDER, true);
}
if (wsPrefStore.getInt(WorkspaceViewerProperties.GRIDLINECOLOR) != LIGHT_GRAY_RGB) {
wsPrefStore.setValue(WorkspaceViewerProperties.GRIDLINECOLOR, LIGHT_GRAY_RGB);
}
if (wsPrefStore.getInt(WorkspaceViewerProperties.GRIDLINESTYLE) != SWT.LINE_CUSTOM) {
wsPrefStore.setValue(WorkspaceViewerProperties.GRIDLINESTYLE, SWT.LINE_CUSTOM);
}
if (wsPrefStore.getBoolean(WorkspaceViewerProperties.VIEWRULERS) != preferenceStore.getBoolean(IPreferenceConstants.PREF_SHOW_RULERS)) {
wsPrefStore.setValue(WorkspaceViewerProperties.VIEWRULERS, preferenceStore.getBoolean(IPreferenceConstants.PREF_SHOW_RULERS));
}
if (wsPrefStore.getBoolean(WorkspaceViewerProperties.VIEWGRID) != preferenceStore.getBoolean(IPreferenceConstants.PREF_SHOW_GRID)) {
wsPrefStore.setValue(WorkspaceViewerProperties.VIEWGRID, preferenceStore.getBoolean(IPreferenceConstants.PREF_SHOW_GRID));
}
if (wsPrefStore.getBoolean(WorkspaceViewerProperties.SNAPTOGRID) != preferenceStore.getBoolean(IPreferenceConstants.PREF_SNAP_TO_GRID)) {
wsPrefStore.setValue(WorkspaceViewerProperties.SNAPTOGRID, preferenceStore.getBoolean(IPreferenceConstants.PREF_SNAP_TO_GRID));
}
if (wsPrefStore.getBoolean(WorkspaceViewerProperties.SNAPTOGEOMETRY) != preferenceStore.getBoolean(IPreferenceConstants.PREF_SNAP_TO_GEOMETRY)) {
wsPrefStore.setValue(WorkspaceViewerProperties.SNAPTOGEOMETRY, preferenceStore.getBoolean(IPreferenceConstants.PREF_SNAP_TO_GEOMETRY));
}
if ((wsPrefStore.getInt(WorkspaceViewerProperties.RULERUNIT) != preferenceStore.getInt(IPreferenceConstants.PREF_RULER_UNITS)) || (wsPrefStore.getDouble(WorkspaceViewerProperties.GRIDSPACING) != preferenceStore.getDouble(IPreferenceConstants.PREF_GRID_SPACING))) {
wsPrefStore.setValue(WorkspaceViewerProperties.RULERUNIT, preferenceStore.getInt(IPreferenceConstants.PREF_RULER_UNITS));
wsPrefStore.setValue(WorkspaceViewerProperties.GRIDSPACING, preferenceStore.getDouble(IPreferenceConstants.PREF_GRID_SPACING));
}
// reset the input values
setInput();
}
});
setInput();
}
use of org.eclipse.jface.preference.IPreferenceStore in project tdi-studio-se by Talend.
the class ComponentPreferenceInitializer method initializeDefaultPreferences.
public void initializeDefaultPreferences() {
IPreferenceStore preferenceStore = CodeGeneratorActivator.getDefault().getPreferenceStore();
//$NON-NLS-1$
preferenceStore.putValue(IComponentPreferenceConstant.LIMIT, "1000");
//$NON-NLS-1$
preferenceStore.setDefault(IComponentPreferenceConstant.LIMIT, "1000");
preferenceStore.putValue(IComponentPreferenceConstant.LINK_STYLE, LINK_STYLE.AUTO.toString());
}
use of org.eclipse.jface.preference.IPreferenceStore in project tdi-studio-se by Talend.
the class MapPreferenceInitializer method initializeDefaultPreferences.
@Override
public void initializeDefaultPreferences() {
IPreferenceStore prefs = getPluginPreferenceStore();
prefs.putValue(MapPrefsConstants.LINK_STYLE, LINK_STYLE.AUTO.toString());
}
Aggregations