public void handleEvent(Event event) { IStatus status = findMostSevere(); applyToStatusLine(status); this.setValid(status.getSeverity()!= IStatus.ERROR && status.getSeverity()!= IStatus.INFO); }
protected void initializeValues() { Iterator iter = _sections.values().iterator(); while(iter.hasNext()) { IDataServerPreferenceSection accessor = (IDataServerPreferenceSection) iter.next(); accessor.loadFromPreferenceStore(getPreferenceStore()); } }
/** * Applies the status to the status line of a dialog page. */ protected void applyToStatusLine(IStatus status) { String message = status.getMessage(); if (message.length() == 0) message = null; switch (status.getSeverity()) { case IStatus.OK: setErrorMessage(null); setMessage(message); break; case IStatus.WARNING: setErrorMessage(null); setMessage(message, WizardPage.WARNING); break; case IStatus.INFO: setErrorMessage(null); setMessage(message, WizardPage.INFORMATION); break; default: setErrorMessage(message); setMessage(null); break; } }
Map sections = PreferencesRegistry.INSTANCE.getPageSections(getPreferencePageId()); for (Iterator iter = sections.keySet().iterator(); iter.hasNext();) initializeValues(); SWTUtils.listenModify(comp, this, null); return comp;
protected void initializeValues() { super.initializeValues(); _insertSingleProposal.setSelection(_store.getBoolean(PreferenceConstants.INSERT_SINGLE_PROPOSALS_AUTO)); _showSystemTables.setSelection(_store.getBoolean(PreferenceConstants.SHOW_SYSTEM_TABLES)); _showSystemProcedures.setSelection(_store.getBoolean(PreferenceConstants.SHOW_SYSTEM_PROCEDURES)); _showOwnerOfTable.setSelection(_store.getBoolean(PreferenceConstants.SHOW_OWNER_OF_TABLE)); _enableAuto.setSelection(_store.getBoolean(PreferenceConstants.ENABLE_AUTO_ACTIVATION)); _autoActivationDelayText.setText(Integer.toString(_store.getInt(PreferenceConstants.AUTO_ACTIVATION_DELAY))); _autoActivationTriggersText.setText(_store.getString(PreferenceConstants.AUTO_ACTIVATION_TRIGGER)); _showSystemViews.setSelection(_store.getBoolean(PreferenceConstants.SHOW_SYSTEM_VIEWS)); updateEnablement(); }
protected void performDefaults() { super.performDefaults(); _insertSingleProposal.setSelection(_store.getDefaultBoolean(PreferenceConstants.INSERT_SINGLE_PROPOSALS_AUTO)); _showSystemTables.setSelection(_store.getDefaultBoolean(PreferenceConstants.SHOW_SYSTEM_TABLES)); _showSystemProcedures.setSelection(_store.getDefaultBoolean(PreferenceConstants.SHOW_SYSTEM_PROCEDURES)); _showOwnerOfTable.setSelection(_store.getDefaultBoolean(PreferenceConstants.SHOW_OWNER_OF_TABLE)); _enableAuto.setSelection(_store.getDefaultBoolean(PreferenceConstants.ENABLE_AUTO_ACTIVATION)); _autoActivationDelayText.setText(Integer.toString(_store.getDefaultInt(PreferenceConstants.AUTO_ACTIVATION_DELAY))); _autoActivationTriggersText.setText(_store.getDefaultString(PreferenceConstants.AUTO_ACTIVATION_TRIGGER)); _showSystemViews.setSelection(_store.getDefaultBoolean(PreferenceConstants.SHOW_SYSTEM_VIEWS)); updateEnablement(); }
/** * Stores the values of the controls back to the preference store. This is called when the user presses the OK or * Apply button. */ public boolean performOk() { _store.setValue(PreferenceConstants.INSERT_SINGLE_PROPOSALS_AUTO, _insertSingleProposal.getSelection()); _store.setValue(PreferenceConstants.SHOW_SYSTEM_TABLES, _showSystemTables.getSelection()); _store.setValue(PreferenceConstants.SHOW_SYSTEM_PROCEDURES, _showSystemProcedures.getSelection()); _store.setValue(PreferenceConstants.SHOW_OWNER_OF_TABLE, _showOwnerOfTable.getSelection()); _store.setValue(PreferenceConstants.ENABLE_AUTO_ACTIVATION, _enableAuto.getSelection()); _store.setValue(PreferenceConstants.AUTO_ACTIVATION_DELAY, Integer.parseInt(_autoActivationDelayText.getText())); _store.setValue(PreferenceConstants.AUTO_ACTIVATION_TRIGGER, _autoActivationTriggersText.getText()); _store.setValue(PreferenceConstants.SHOW_SYSTEM_VIEWS, _showSystemViews.getSelection()); return super.performOk(); }
protected Control createContents(Composite parent) { PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.PREFERENCES_CODE_ASSIST); Composite page = createGeneralPage(parent); initializeValues(); // composite for vendor specific tabs Composite tabs = new Composite(page, SWT.NONE); tabs.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout gdl =new GridLayout(); gdl.marginLeft = 0; gdl.marginWidth = 0; gdl.marginRight = 0; gdl.marginBottom = 0; tabs.setLayout(gdl); super.createContents(tabs); return page; }
IStatus[] statuses = getSevereFirstStatus(); if (statuses == null || statuses.length == 0)
public boolean performOk() { Iterator iter = _sections.values().iterator(); while(iter.hasNext()) { IDataServerPreferenceSection accessor = (IDataServerPreferenceSection) iter.next(); accessor.saveToPreferenceStore(getPreferenceStore()); } return super.performOk(); }
protected void performDefaults() { //void NullPointException if(_folder == null) { return; } TabItem currentItem = _folder.getItem(_folder.getSelectionIndex()); IDataServerPreferenceSection accessor = (IDataServerPreferenceSection)_sections.get(currentItem.getText()); accessor.loadDefaultPreference(getPreferenceStore()); super.performDefaults(); }