001: /*
002: * ChainBuilder ESB
003: * Visual Enterprise Integration
004: *
005: * Copyright (C) 2006 Bostech Corporation
006: *
007: * This program is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU General Public License as published by the
009: * Free Software Foundation; either version 2 of the License, or (at your option)
010: * any later version.
011: *
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
014: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
015: * for more details.
016: *
017: * You should have received a copy of the GNU General Public License along with
018: * this program; if not, write to the Free Software Foundation, Inc.,
019: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: *
021: *
022: * $Id$
023: */
024:
025: package com.bostechcorp.cbesb.ui.ide.classpath;
026:
027: import org.eclipse.jdt.core.IClasspathEntry;
028: import org.eclipse.jdt.internal.ui.JavaPluginImages;
029: import org.eclipse.jdt.ui.wizards.IClasspathContainerPage;
030: import org.eclipse.jface.wizard.WizardPage;
031: import org.eclipse.swt.SWT;
032: import org.eclipse.swt.layout.GridData;
033: import org.eclipse.swt.layout.GridLayout;
034: import org.eclipse.swt.widgets.Composite;
035: import org.eclipse.swt.widgets.Label;
036:
037: public abstract class ClasspathContainerPage extends WizardPage
038: implements IClasspathContainerPage {
039: private final static String PAGE_NAME = ClasspathContainerPage.class
040: .getName();
041:
042: /**Constructor for the ClasspathContainerPage object */
043: public ClasspathContainerPage() {
044: super (PAGE_NAME);
045:
046: this .setTitle("ClasspathContainerPage.title");//$NON-NLS-1$
047: this .setDescription("ClasspathContainerPage.description");//$NON-NLS-1$
048: this
049: .setImageDescriptor(JavaPluginImages.DESC_WIZBAN_ADD_LIBRARY);
050: }
051:
052: /**
053: * Description of the Method
054: *
055: * @param parent Description of the Parameter
056: */
057: public void createControl(Composite parent) {
058: Composite top = new Composite(parent, SWT.NONE);
059: GridLayout layout = new GridLayout(1, true);
060: top.setLayout(layout);
061:
062: Label lbl = new Label(top, SWT.NONE);
063: lbl
064: .setText("ClasspathContainerPage.text.start" + this .getClasspathEntryDescription() + "ClasspathContainerPage.text.end");//$NON-NLS-1$ //$NON-NLS-2$
065: GridData gd = new GridData(GridData.FILL_HORIZONTAL);
066: lbl.setLayoutData(gd);
067:
068: this .setControl(top);
069: }
070:
071: /**
072: * Description of the Method
073: *
074: * @return Description of the Return Value
075: */
076: public boolean finish() {
077: return true;
078: }
079:
080: /**
081: * Gets the selection attribute of the ClasspathContainerPage object
082: *
083: * @return The selection value
084: */
085: public IClasspathEntry getSelection() {
086: return this .getClasspathEntry();
087: }
088:
089: /**
090: * Sets the selection attribute of the ClasspathContainerPage object
091: *
092: * @param containerEntry The new selection value
093: */
094: public void setSelection(IClasspathEntry containerEntry) {
095: }
096:
097: /**
098: * Gets the classpathContainerId attribute of the ClasspathContainerPage object
099: *
100: * @return The classpathContainerId value
101: */
102: protected abstract String getClasspathContainerId();
103:
104: /**
105: * Gets the classpathEntry attribute of the ClasspathContainerPage object
106: *
107: * @return The classpathEntry value
108: */
109: protected IClasspathEntry getClasspathEntry() {
110: return ClassPathContainerRepository.getInstance().getEntry(
111: this .getClasspathContainerId());
112: }
113:
114: /**
115: * Gets the classpathEntryDescription attribute of the ClasspathContainerPage object
116: *
117: * @return The classpathEntryDescription value
118: */
119: protected abstract String getClasspathEntryDescription();
120: }
|