@Override public void setEnabled(boolean enabled) { fEnabled= enabled; configureStyledText(fText, fEnabled); }
public BulletListBlock(Composite parent, int style) { super(parent, style); fEnabled= true; fText= ""; //$NON-NLS-1$ GridLayout layout= new GridLayout(1, false); layout.marginHeight= 0; layout.marginWidth= 0; setLayout(layout); createControl(this); }
public void enableProjectSpecificSettings(boolean useProjectSpecificSettings) { fBrowserBlock.setEnabled(useProjectSpecificSettings); } }
explain.setText(FixMessages.CleanUpPostSaveListener_SlowCleanUpWarningDialog_explain); final BulletListBlock cleanUpListBlock= new BulletListBlock(messageComposite, SWT.NONE); GridData gridData= new GridData(SWT.FILL, SWT.FILL, true, true); cleanUpListBlock.setLayoutData(gridData); cleanUpListBlock.setText(fCleanUpNames);
fBrowserBlock= new BulletListBlock(); Control control= fBrowserBlock.createControl(composite); ((GridData)control.getLayoutData()).horizontalSpan= numColumns; fBrowserBlock.setText(getSelectedCleanUpsInfo(cleanUps));
private Composite createAdvancedComposite(final Composite parent) { Composite composite= new Composite(parent, SWT.NONE); GridData gridData= new GridData(SWT.FILL, SWT.FILL, true, true); gridData.horizontalIndent= INDENT; composite.setLayoutData(gridData); GridLayout layout= new GridLayout(2, false); layout.marginHeight= 0; layout.marginWidth= 0; composite.setLayout(layout); fSelectedActionsText= new BulletListBlock(composite, SWT.NONE); gridData= new GridData(SWT.FILL, SWT.FILL, true, true); gridData.heightHint= new PixelConverter(composite).convertHeightInCharsToPixels(8); fSelectedActionsText.setLayoutData(gridData); fConfigureButton= new Button(composite, SWT.NONE); fConfigureButton.setText(SaveParticipantMessages.CleanUpSaveParticipantPreferenceConfiguration_Configure_Button); fConfigureButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); fConfigureButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { Hashtable<String, String> workingValues= new Hashtable<>(fSettings); SaveActionSelectionDialog dialog= new SaveActionSelectionDialog(parent.getShell(), workingValues); if (dialog.open() == Window.OK) { fSettings= workingValues; settingsChanged(); } } }); return composite; }
private void settingsChanged() { fFormatCodeButton.setSelection(CleanUpOptions.TRUE.equals(fSettings.get(CleanUpConstants.FORMAT_SOURCE_CODE))); boolean isFormatting= fFormatCodeButton.getSelection(); fFormatChangedOnlyButton.setSelection(CleanUpOptions.TRUE.equals(fSettings.get(CleanUpConstants.FORMAT_SOURCE_CODE_CHANGES_ONLY))); fFormatAllButton.setSelection(CleanUpOptions.FALSE.equals(fSettings.get(CleanUpConstants.FORMAT_SOURCE_CODE_CHANGES_ONLY))); fFormatChangedOnlyButton.setEnabled(isFormatting); fFormatAllButton.setEnabled(isFormatting); fFormatConfigLink.setEnabled(isFormatting); fOrganizeImportsButton.setSelection(CleanUpOptions.TRUE.equals(fSettings.get(CleanUpConstants.ORGANIZE_IMPORTS))); fOrganizeImportsConfigLink.setEnabled(fOrganizeImportsButton.getSelection()); fAdditionalActionButton.setSelection(CleanUpOptions.TRUE.equals(fSettings.get(CleanUpConstants.CLEANUP_ON_SAVE_ADDITIONAL_OPTIONS))); boolean additionalEnabled= CleanUpOptions.TRUE.equals(fSettings.get(CleanUpConstants.CLEANUP_ON_SAVE_ADDITIONAL_OPTIONS)); fSelectedActionsText.setEnabled(additionalEnabled); fConfigureButton.setEnabled(additionalEnabled); Map<String, String> settings= new HashMap<>(fSettings); settings.put(CleanUpConstants.FORMAT_SOURCE_CODE, CleanUpOptions.FALSE); settings.put(CleanUpConstants.ORGANIZE_IMPORTS, CleanUpOptions.FALSE); CleanUpOptions options= new MapCleanUpOptions(settings); fSelectedActionsText.setText(getSelectedCleanUpsText(options)); }
composite.setLayout(layout); fSelectedActionsText= new BulletListBlock(); final GridData data= (GridData)fSelectedActionsText.createControl(composite).getLayoutData(); data.heightHint= new PixelConverter(composite).convertHeightInCharsToPixels(8);
@Override public void update(Observable o, Object arg) { final int value= ((Integer)arg).intValue(); switch (value) { case ProfileManager.PROFILE_CREATED_EVENT: case ProfileManager.PROFILE_DELETED_EVENT: case ProfileManager.SELECTION_CHANGED_EVENT: case ProfileManager.SETTINGS_CHANGED_EVENT: fill(profileManager.getSelected().getSettings(), sharedSettings); cleanUpListBlock.setText(getSelectedCleanUpsInfo(cleanUps)); } }
explain.setText(FixMessages.CleanUpPostSaveListener_SlowCleanUpWarningDialog_explain); final BulletListBlock cleanUpListBlock= new BulletListBlock(messageComposite, SWT.NONE); GridData gridData= new GridData(SWT.FILL, SWT.FILL, true, true); cleanUpListBlock.setLayoutData(gridData); cleanUpListBlock.setText(fCleanUpNames);
private Composite createAdvancedComposite(final Composite parent) { Composite composite= new Composite(parent, SWT.NONE); GridData gridData= new GridData(SWT.FILL, SWT.FILL, true, true); gridData.horizontalIndent= INDENT; composite.setLayoutData(gridData); GridLayout layout= new GridLayout(2, false); layout.marginHeight= 0; layout.marginWidth= 0; composite.setLayout(layout); fSelectedActionsText= new BulletListBlock(composite, SWT.NONE); gridData= new GridData(SWT.FILL, SWT.FILL, true, true); gridData.heightHint= new PixelConverter(composite).convertHeightInCharsToPixels(8); fSelectedActionsText.setLayoutData(gridData); fConfigureButton= new Button(composite, SWT.NONE); fConfigureButton.setText(SaveParticipantMessages.CleanUpSaveParticipantPreferenceConfiguration_Configure_Button); fConfigureButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); fConfigureButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { Hashtable<String, String> workingValues= new Hashtable<>(fSettings); SaveActionSelectionDialog dialog= new SaveActionSelectionDialog(parent.getShell(), workingValues); if (dialog.open() == Window.OK) { fSettings= workingValues; settingsChanged(); } } }); return composite; }
private void settingsChanged() { fFormatCodeButton.setSelection(CleanUpOptions.TRUE.equals(fSettings.get(CleanUpConstants.FORMAT_SOURCE_CODE))); boolean isFormatting= fFormatCodeButton.getSelection(); fFormatChangedOnlyButton.setSelection(CleanUpOptions.TRUE.equals(fSettings.get(CleanUpConstants.FORMAT_SOURCE_CODE_CHANGES_ONLY))); fFormatAllButton.setSelection(CleanUpOptions.FALSE.equals(fSettings.get(CleanUpConstants.FORMAT_SOURCE_CODE_CHANGES_ONLY))); fFormatChangedOnlyButton.setEnabled(isFormatting); fFormatAllButton.setEnabled(isFormatting); fFormatConfigLink.setEnabled(isFormatting); fOrganizeImportsButton.setSelection(CleanUpOptions.TRUE.equals(fSettings.get(CleanUpConstants.ORGANIZE_IMPORTS))); fOrganizeImportsConfigLink.setEnabled(fOrganizeImportsButton.getSelection()); fAdditionalActionButton.setSelection(CleanUpOptions.TRUE.equals(fSettings.get(CleanUpConstants.CLEANUP_ON_SAVE_ADDITIONAL_OPTIONS))); boolean additionalEnabled= CleanUpOptions.TRUE.equals(fSettings.get(CleanUpConstants.CLEANUP_ON_SAVE_ADDITIONAL_OPTIONS)); fSelectedActionsText.setEnabled(additionalEnabled); fConfigureButton.setEnabled(additionalEnabled); Map<String, String> settings= new HashMap<>(fSettings); settings.put(CleanUpConstants.FORMAT_SOURCE_CODE, CleanUpOptions.FALSE); settings.put(CleanUpConstants.ORGANIZE_IMPORTS, CleanUpOptions.FALSE); CleanUpOptions options= new MapCleanUpOptions(settings); fSelectedActionsText.setText(getSelectedCleanUpsText(options)); }
final BulletListBlock bulletListBlock= new BulletListBlock(); Control bulletList= bulletListBlock.createControl(composite); GridData layoutData= (GridData)bulletList.getLayoutData(); (layoutData).horizontalIndent= 15;
public void update(Observable o, Object arg) { final int value= ((Integer)arg).intValue(); switch (value) { case ProfileManager.PROFILE_CREATED_EVENT: case ProfileManager.PROFILE_DELETED_EVENT: case ProfileManager.SELECTION_CHANGED_EVENT: case ProfileManager.SETTINGS_CHANGED_EVENT: fill(profileManager.getSelected().getSettings(), sharedSettings); fBrowserBlock.setText(getSelectedCleanUpsInfo(cleanUps)); } }
final BulletListBlock cleanUpListBlock= new BulletListBlock(composite, SWT.NONE); GridData gridData= new GridData(SWT.FILL, SWT.FILL, true, true); gridData.horizontalSpan= numColumns; cleanUpListBlock.setLayoutData(gridData); cleanUpListBlock.setText(getSelectedCleanUpsInfo(cleanUps));
final BulletListBlock bulletListBlock= new BulletListBlock(composite, SWT.NONE); GridData layoutData= new GridData(SWT.FILL, SWT.FILL, true, true); layoutData.horizontalIndent= 15; layoutData.grabExcessVerticalSpace= true; bulletListBlock.setLayoutData(layoutData);
public void setText(String text) { fText= text; configureStyledText(fText, fEnabled); }
private void showCustomSettings(BulletListBlock bulletListBlock) { StringBuffer buf= new StringBuffer(); final ICleanUp[] cleanUps= CleanUpRefactoring.createCleanUps(fCustomSettings); for (int i= 0; i < cleanUps.length; i++) { String[] descriptions= cleanUps[i].getDescriptions(); if (descriptions != null) { for (int j= 0; j < descriptions.length; j++) { if (buf.length() > 0) { buf.append('\n'); } buf.append(descriptions[j]); } } } bulletListBlock.setText(buf.toString()); }
public BulletListBlock(Composite parent, int style) { super(parent, style); fEnabled= true; fText= ""; //$NON-NLS-1$ GridLayout layout= new GridLayout(1, false); layout.marginHeight= 0; layout.marginWidth= 0; setLayout(layout); createControl(this); }
private void updateAdvancedEnableState() { boolean additionalOptionEnabled= isEnabled(fContext) && CleanUpConstants.TRUE.equals(fSettings.get(CleanUpConstants.CLEANUP_ON_SAVE_ADDITIONAL_OPTIONS)); boolean additionalEnabled= additionalOptionEnabled && (!ProjectScope.SCOPE.equals(fContext.getName()) || hasSettingsInScope(fContext)); fSelectedActionsText.setEnabled(additionalEnabled); fConfigureButton.setEnabled(additionalEnabled); }