use of net.sf.eclipsecs.core.projectconfig.FileMatchPattern in project eclipse-cs by checkstyle.
the class FileSetEditDialog method initializeControls.
/**
* Initializes the controls with their data.
*/
private void initializeControls() {
// init the check configuration combo
mComboViewer.setInput(mPropertyPage.getProjectConfigurationWorkingCopy());
this.setTitleImage(CheckstyleUIPluginImages.getImage(CheckstyleUIPluginImages.PLUGIN_LOGO));
this.setMessage(Messages.FileSetEditDialog_message);
if (mIsCreatingNewFileset) {
this.setTitle(Messages.FileSetEditDialog_titleCreate);
} else {
this.setTitle(Messages.FileSetEditDialog_titleEdit);
}
// intitialize the name
// $NON-NLS-1$
mFileSetNameText.setText(mFileSet.getName() != null ? mFileSet.getName() : "");
// init the check configuration combo
if (mFileSet.getCheckConfig() != null) {
mComboViewer.setSelection(new StructuredSelection(mFileSet.getCheckConfig()));
}
// init the pattern area
mPatternViewer.setInput(mFileSet.getFileMatchPatterns());
for (FileMatchPattern pattern : mFileSet.getFileMatchPatterns()) {
mPatternViewer.setChecked(pattern, pattern.isIncludePattern());
}
getShell().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
mMatchGroup.setText(Messages.FileSetEditDialog_msgBuildTestResults);
try {
mProjectFiles = getFiles(mProject);
} catch (CoreException e) {
CheckstyleLog.log(e);
}
// init the test area
mMatchesViewer.setInput(mProjectFiles);
updateMatchView();
}
});
}
use of net.sf.eclipsecs.core.projectconfig.FileMatchPattern in project eclipse-cs by checkstyle.
the class FileSetEditDialog method removeFileMatchPattern.
private void removeFileMatchPattern() {
IStructuredSelection selection = (IStructuredSelection) mPatternViewer.getSelection();
FileMatchPattern pattern = (FileMatchPattern) selection.getFirstElement();
if (pattern == null) {
//
return;
}
mFileSet.getFileMatchPatterns().remove(pattern);
mPatternViewer.refresh();
}
use of net.sf.eclipsecs.core.projectconfig.FileMatchPattern in project eclipse-cs by checkstyle.
the class SimpleFileSetsEditor method setFileSets.
/**
* {@inheritDoc}
*/
@Override
public void setFileSets(List<FileSet> fileSets) throws CheckstylePluginException {
mFileSets = fileSets;
ICheckConfiguration config = null;
if (mFileSets.size() > 0) {
config = (mFileSets.get(0)).getCheckConfig();
}
if (config == null) {
CheckConfigurationWorkingCopy[] allConfigs = mPropertyPage.getProjectConfigurationWorkingCopy().getGlobalCheckConfigWorkingSet().getWorkingCopies();
if (allConfigs.length > 0) {
config = allConfigs[0];
}
}
mDefaultFileSet = new FileSet(Messages.SimpleFileSetsEditor_nameAllFileset, config);
// $NON-NLS-1$
mDefaultFileSet.getFileMatchPatterns().add(new FileMatchPattern("."));
mFileSets.clear();
mFileSets.add(mDefaultFileSet);
}
Aggregations