From 4e112eca7750a4f530c986be55c178c43c16d3ea Mon Sep 17 00:00:00 2001 From: Elliott Baron Date: Sat, 26 Jun 2010 22:27:34 -0400 Subject: Update codan plugins to CDT 7.0. * org.eclipse.cdt.codan.checkers.ui: Updated. * org.eclipse.cdt.codan.checkers: Updated. * org.eclipse.cdt.codan.core: Updated. * org.eclipse.cdt.codan.ui: Updated. * org.eclipse.cdt.codan.core.cxx: Added. * org.eclipse.cdt.codan.extension/META-INF/MANIFEST.MF: Import org.eclipse.cdt.codan.core.cxx.model. * org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/checkers/AbstractPropSimChecker.java: Superclass moved. --- .../ui/dialogs/CustomizeProblemDialog.java | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/dialogs/CustomizeProblemDialog.java (limited to 'org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/dialogs/CustomizeProblemDialog.java') diff --git a/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/dialogs/CustomizeProblemDialog.java b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/dialogs/CustomizeProblemDialog.java new file mode 100644 index 0000000..8b35f1d --- /dev/null +++ b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/dialogs/CustomizeProblemDialog.java @@ -0,0 +1,87 @@ +/******************************************************************************* + * Copyright (c) 2009, 2010 Alena Laskavaia + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Alena Laskavaia - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.codan.internal.ui.dialogs; + +import org.eclipse.cdt.codan.core.model.IProblem; +import org.eclipse.cdt.codan.core.model.IProblemWorkingCopy; +import org.eclipse.cdt.codan.internal.ui.CodanUIMessages; +import org.eclipse.cdt.codan.internal.ui.widgets.CustomizeProblemComposite; +import org.eclipse.core.resources.IResource; +import org.eclipse.jface.dialogs.TitleAreaDialog; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; + +/** + * Dialog that allows to customise problems + * + */ +public class CustomizeProblemDialog extends TitleAreaDialog { + private CustomizeProblemComposite comp; + private IProblem problem; + private IResource resource; + + /** + * @param parentShell + * @param selectedProblem + * @param iResource + */ + public CustomizeProblemDialog(Shell parentShell, IProblem selectedProblem, + IResource resource) { + super(parentShell); + this.problem = selectedProblem; + this.resource = resource; + setShellStyle(getShellStyle() | SWT.RESIZE); + } + + /** + * Stores edit values into problem working copy + * + * @param problem + * - problem working copy + */ + public void save(IProblemWorkingCopy problem) { + comp.save(problem); + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse + * .swt.widgets.Composite) + */ + @Override + protected Control createDialogArea(Composite parent) { + getShell().setText(CodanUIMessages.CustomizeProblemDialog_Title); + setTitle(problem.getName()); + setMessage(CodanUIMessages.CustomizeProblemDialog_Message); + Composite area = (Composite) super.createDialogArea(parent); + comp = new CustomizeProblemComposite(area, problem, resource); + GridData ld = new GridData(GridData.FILL_BOTH); + ld.minimumHeight = 300; + comp.setLayoutData(ld); + return area; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.dialogs.Dialog#okPressed() + */ + @Override + protected void okPressed() { + save((IProblemWorkingCopy) problem); + super.okPressed(); + } +} -- cgit