From 027d7aab463175ea44cc8d37be5e28cb4bdda424 Mon Sep 17 00:00:00 2001 From: David Inglis Date: Tue, 12 Aug 2003 13:39:20 +0000 Subject: [PATCH] abstract class for use by ICOptionPage implementers. --- .../eclipse/cdt/ui/AbstractCOptionPage.java | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/AbstractCOptionPage.java diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/AbstractCOptionPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/AbstractCOptionPage.java new file mode 100644 index 00000000000..65e3d25dd61 --- /dev/null +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/AbstractCOptionPage.java @@ -0,0 +1,83 @@ +/*********************************************************************** + * Copyright (c) 2003 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * QNX Software Systems - Initial API and implementation +***********************************************************************/ +package org.eclipse.cdt.ui; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; + +public abstract class AbstractCOptionPage implements ICOptionPage { + + private String fErrorMessage; + private String fMessage; + private boolean bIsValid = true; + private Control fControl; + private ICOptionContainer fContainer; + + public void setContainer(ICOptionContainer container) { + fContainer = container; + } + + protected ICOptionContainer getContainer() { + return fContainer; + } + + public Image getImage() { + return null; + } + + public abstract void createControl(Composite parent); + + public abstract String getLabel(); + + public Control getControl() { + return fControl; + } + + protected void setControl(Control control) { + fControl = control; + } + + protected void setValid(boolean isValid) { + bIsValid = isValid; + } + + public boolean isValid() { + return bIsValid; + } + + public String getMessage() { + return fMessage; + } + + protected void setMessage(String message) { + fMessage = message; + } + + public String getErrorMessage() { + return fErrorMessage; + } + + protected void setErrorMessage(String message) { + fErrorMessage = message; + } + + public void setVisible(boolean visible) { + } + + public abstract void performApply(IProgressMonitor monitor) throws CoreException; + + public void performDefaults() { + } + +}