use of org.eclipse.jface.util.IPropertyChangeListener in project titan.EclipsePlug-ins by eclipse.
the class ErrorsWarningsPreferencePage method createPotentialProgrammingProblemsSection.
/**
* Creates the section of potential issues related to potential
* programming problems. All of these should be considered as normal
* errors, but on our current level we might not be able to detect them
* in all cases correctly.
*
* @param parent
* the parent composite to put the section under.
*/
private void createPotentialProgrammingProblemsSection(final Composite parent) {
ExpandableComposite expandable = createExtendableComposite(parent, "Potential programming problems");
Composite comp = new Composite(expandable, SWT.NONE);
comp.setLayout(new GridLayout(2, false));
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
expandable.setClient(comp);
expandable.setExpanded(false);
ComboFieldEditor comboedit = new ComboFieldEditor(PreferenceConstants.REPORTMISSINGIMPORTEDMODULE, REPORTMISSINGIMPORTATION, IGNORE_WARNING_ERROR, comp);
Label text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORTMISSINGIMPORTATION_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
comboedit = new ComboFieldEditor(PreferenceConstants.REPORTMISSINGFRIENDMODULE, REPORTMISSINGFRIEND, IGNORE_WARNING_ERROR, comp);
text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORTMISSINGFRIEND_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
comboedit = new ComboFieldEditor(PreferenceConstants.REPORTUNUSEDFUNCTIONRETURNVALUES, REPORTUNUSEDFUNTIONRETURNVALUES, IGNORE_WARNING_ERROR, comp);
text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORTUNUSEDFUNCTIONRETURNVALUESTOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
comboedit = new ComboFieldEditor(PreferenceConstants.REPORTINFINITELOOPS, REPORT_INFINITE_LOOP, IGNORE_WARNING_ERROR, comp);
text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORT_INFINITE_LOOP_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
comboedit = new ComboFieldEditor(PreferenceConstants.REPORTREADONLY, REPORT_READONLY, IGNORE_WARNING_ERROR, comp);
text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORT_READONLY_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
comboedit = new ComboFieldEditor(PreferenceConstants.REPORT_NONPRIVATE_PRIVATE, REPORT_NONPRIVATE_PRIVATE, IGNORE_WARNING_ERROR, comp);
text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORT_NONPRIVATE_PRIVATE_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
comboedit = new ComboFieldEditor(PreferenceConstants.REPORT_TOOMANY_PARAMETERS, REPORT_TOOMANY_PARAMETERS, IGNORE_WARNING_ERROR, comp);
text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORT_TOOMANY_PARAMETERS_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
IntegerFieldEditor integeredit = new IntegerFieldEditor(PreferenceConstants.REPORT_TOOMANY_PARAMETERS_SIZE, REPORT_TOOMANY_PARAMETERS_SIZE, comp);
text = integeredit.getLabelControl(comp);
text.setToolTipText(REPORT_TOOMANY_PARAMETERS_TOOLTIP);
integeredit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(integeredit);
comboedit = new ComboFieldEditor(PreferenceConstants.REPORT_EMPTY_STATEMENT_BLOCK, REPORT_EMPTY_STATEMENT_BLOCK, IGNORE_WARNING_ERROR, comp);
text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORT_EMPTY_STATEMENT_BLOCK_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
comboedit = new ComboFieldEditor(PreferenceConstants.REPORT_TOOMANY_STATEMENTS, REPORT_TOOMANY_STATEMENTS, IGNORE_WARNING_ERROR, comp);
text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORT_TOOMANY_STATEMENTS_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
integeredit = new IntegerFieldEditor(PreferenceConstants.REPORT_TOOMANY_STATEMENTS_SIZE, REPORT_TOOMANY_STATEMENTS_SIZE, comp);
text = integeredit.getLabelControl(comp);
text.setToolTipText(REPORT_TOOMANY_STATEMENTS_TOOLTIP);
integeredit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(integeredit);
comboedit = new ComboFieldEditor(PreferenceConstants.REPORTINCORRECTSHIFTROTATESIZE, REPORTINCORRECTSHIFTROTATESIZE, IGNORE_WARNING_ERROR, comp);
text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORTINCORRECTSHIFTROTATESIZE_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
comboedit = new ComboFieldEditor(PreferenceConstants.REPORT_IF_WITHOUT_ELSE, REPORT_IF_WITHOUT_ELSE, IGNORE_WARNING_ERROR, comp);
text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORT_IF_WITHOUT_ELSE_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
comboedit = new ComboFieldEditor(PreferenceConstants.REPORT_SETVERDICT_WITHOUT_REASON, REPORT_SETVERDICT_WITHOUT_REASON, IGNORE_WARNING_ERROR, comp);
text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORT_SETVERDICT_WITHOUT_REASON_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
comboedit = new ComboFieldEditor(PreferenceConstants.REPORTERRORSINEXTENSIONSYNTAX, REPORTERRORSINEXTENSIONSYNTAX, IGNORE_WARNING_ERROR, comp);
text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORTERRORSINEXTENSIONSYNTAX_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
}
use of org.eclipse.jface.util.IPropertyChangeListener in project titan.EclipsePlug-ins by eclipse.
the class BaseNamingConventionPropertyPage method createFieldEditor.
/**
* Creates a field editor with the provided preference and name.
*
* @param parent
* the composite to add the field editor to.
* @param preference
* the preference the field editor should handle.
* @param namepart
* the name of the field editor to be displayed.
*
* @return the new field editor.
*/
private RegexpFieldEditor createFieldEditor(final Composite parent, final String preference, final String namepart) {
RegexpFieldEditor stringEditor = new RegexpFieldEditor(preference, "Format of " + namepart + " names", parent, namepart);
stringEditor.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
setErrorMessage(null);
String newValue = ((StringFieldEditor) event.getSource()).getStringValue();
try {
Pattern.compile(newValue);
} catch (PatternSyntaxException e) {
setErrorMessage("The format of " + namepart + " name regexp is wrong");
}
}
});
return stringEditor;
}
use of org.eclipse.jface.util.IPropertyChangeListener in project titan.EclipsePlug-ins by eclipse.
the class NamingConventionPreferencePage method createOthersSection.
/**
* Creates the section of naming conventions governing definitions
*
* @param parent
* the parent composite to put the section under.
*/
private void createOthersSection(final Composite parent) {
ExpandableComposite expandable = createExtendableComposite(parent, "other naming rules");
Composite comp = new Composite(expandable, SWT.NONE);
comp.setLayout(new GridLayout(2, false));
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
expandable.setClient(comp);
expandable.setExpanded(false);
ComboFieldEditor comboedit = new ComboFieldEditor(PreferenceConstants.REPORT_MODULENAME_IN_DEFINITION, REPORT_MODULENAME_IN_DEFINITION, IGNORE_WARNING_ERROR, comp);
Label text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORT_MODULENAME_IN_DEFINITION_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
comboedit = new ComboFieldEditor(PreferenceConstants.REPORT_VISIBILITY_IN_DEFINITION, REPORT_VISIBILITY_IN_DEFINITION, IGNORE_WARNING_ERROR, comp);
text = comboedit.getLabelControl(comp);
text.setToolTipText(REPORT_VISIBILITY_IN_DEFINITION_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
}
use of org.eclipse.jface.util.IPropertyChangeListener in project titan.EclipsePlug-ins by eclipse.
the class NamingConventionPreferencePage method createFieldEditor.
/**
* Creates a field editor with the provided preference and name.
*
* @param parent
* the composite to add the field editor to.
* @param preference
* the preference the field editor should handle.
* @param namepart
* the name of the field editor to be displayed.
*
* @return the new field editor.
*/
private StringFieldEditor createFieldEditor(final Composite parent, final String preference, final String namepart) {
final RegexpFieldEditor stringEditor = new RegexpFieldEditor(preference, "Format of " + namepart + " names", parent, namepart);
stringEditor.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
return stringEditor;
}
use of org.eclipse.jface.util.IPropertyChangeListener in project titan.EclipsePlug-ins by eclipse.
the class NamingConventionPreferencePage method createFieldEditors.
@Override
protected void createFieldEditors() {
final Composite tempParent = getFieldEditorParent();
ComboFieldEditor comboedit = new ComboFieldEditor(PreferenceConstants.REPORTNAMINGCONVENTIONPROBLEMS, REPORTNAMINGCONVENTIONPROBLEMS, IGNORE_WARNING_ERROR, tempParent);
Label text = comboedit.getLabelControl(tempParent);
text.setToolTipText(REPORTNAMINGCONVENTIONPROBLEMS_TOOLTIP);
comboedit.setPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
changed = true;
}
});
addField(comboedit);
createModuleSection(tempParent);
createTTCN3GlobalSection(tempParent);
createTTCN3LocalSection(tempParent);
createTTCN3ComponentSection(tempParent);
createOthersSection(tempParent);
}
Aggregations