* @throws CoreException
* Thrown when the evaluation of the code template fails.
*/
- public static String getCompilationUnitContent(ICompilationUnit cu,
- String typeComment, String typeContent, String lineDelimiter)
- throws CoreException {
- return StubUtility.getCompilationUnitContent(cu, typeComment,
- typeContent, lineDelimiter);
- }
+// public static String getCompilationUnitContent(ICompilationUnit cu,
+// String typeComment, String typeContent, String lineDelimiter)
+// throws CoreException {
+// return StubUtility.getCompilationUnitContent(cu, typeComment,
+// typeContent, lineDelimiter);
+// }
/**
* Returns the content for a new type comment using the 'type comment' code
* Thrown when the evaluation of the code template fails.
* @since 3.0
*/
- public static String getFieldComment(ICompilationUnit cu, String typeName,
- String fieldName, String lineDelimiter) throws CoreException {
- return StubUtility.getFieldComment(cu, typeName, fieldName,
- lineDelimiter);
- }
+// public static String getFieldComment(ICompilationUnit cu, String typeName,
+// String fieldName, String lineDelimiter) throws CoreException {
+// return StubUtility.getFieldComment(cu, typeName, fieldName,
+// lineDelimiter);
+// }
/**
* Returns the comment for a method or constructor using the comment code
* @throws CoreException
* Thrown when the evaluation of the code template fails.
*/
- public static String getMethodBodyContent(ICompilationUnit cu,
- String declaringTypeName, String methodName, boolean isConstructor,
- String bodyStatement, String lineDelimiter) throws CoreException {
- return StubUtility.getMethodBodyContent(isConstructor, cu
- .getJavaProject(), declaringTypeName, methodName,
- bodyStatement, lineDelimiter);
- }
+// public static String getMethodBodyContent(ICompilationUnit cu,
+// String declaringTypeName, String methodName, boolean isConstructor,
+// String bodyStatement, String lineDelimiter) throws CoreException {
+// return StubUtility.getMethodBodyContent(isConstructor, cu
+// .getJavaProject(), declaringTypeName, methodName,
+// bodyStatement, lineDelimiter);
+// }
/**
* Returns the content of body for a getter method using the getter method
* Thrown when the evaluation of the code template fails.
* @since 3.0
*/
- public static String getGetterMethodBodyContent(ICompilationUnit cu,
- String declaringTypeName, String methodName, String fieldName,
- String lineDelimiter) throws CoreException {
- return StubUtility.getGetterMethodBodyContent(cu.getJavaProject(),
- declaringTypeName, methodName, fieldName, lineDelimiter);
- }
+// public static String getGetterMethodBodyContent(ICompilationUnit cu,
+// String declaringTypeName, String methodName, String fieldName,
+// String lineDelimiter) throws CoreException {
+// return StubUtility.getGetterMethodBodyContent(cu.getJavaProject(),
+// declaringTypeName, methodName, fieldName, lineDelimiter);
+// }
/**
* Returns the content of body for a setter method using the setter method
* Thrown when the evaluation of the code template fails.
* @since 3.0
*/
- public static String getSetterMethodBodyContent(ICompilationUnit cu,
- String declaringTypeName, String methodName, String fieldName,
- String paramName, String lineDelimiter) throws CoreException {
- return StubUtility.getSetterMethodBodyContent(cu.getJavaProject(),
- declaringTypeName, methodName, fieldName, paramName,
- lineDelimiter);
- }
+// public static String getSetterMethodBodyContent(ICompilationUnit cu,
+// String declaringTypeName, String methodName, String fieldName,
+// String paramName, String lineDelimiter) throws CoreException {
+// return StubUtility.getSetterMethodBodyContent(cu.getJavaProject(),
+// declaringTypeName, methodName, fieldName, paramName,
+// lineDelimiter);
+// }
/**
* Returns the comment for a getter method using the getter comment
*
* @return the current adornments
*/
- public int getAdronments() {
- return fFlags;
- }
+// public int getAdronments() {
+// return fFlags;
+// }
/**
* Sets the size of the image created by calling <code>createImage()</code>.
* <code>createImage()</code>
* @see ImageDescriptor#createImage()
*/
- public void setImageSize(Point size) {
- Assert.isNotNull(size);
- Assert.isTrue(size.x >= 0 && size.y >= 0);
- fSize = size;
- }
+// public void setImageSize(Point size) {
+// Assert.isNotNull(size);
+// Assert.isTrue(size.x >= 0 && size.y >= 0);
+// fSize = size;
+// }
/**
* Returns the size of the image created by calling
* @see #SHOW_DEFAULT
* @since 2.0
*/
- public JavaElementLabelProvider() {
- this(SHOW_DEFAULT);
- }
+// public JavaElementLabelProvider() {
+// this(SHOW_DEFAULT);
+// }
/**
* Creates a new label provider.
* @param flags
* the options; a bitwise OR of <code>SHOW_* </code> constants
*/
- public void turnOn(int flags) {
- fFlags |= flags;
- updateImageProviderFlags();
- updateTextProviderFlags();
- }
+// public void turnOn(int flags) {
+// fFlags |= flags;
+// updateImageProviderFlags();
+// updateTextProviderFlags();
+// }
/**
* Turns off the rendering options specified in the given flags.
* the initial options; a bitwise OR of <code>SHOW_* </code>
* constants
*/
- public void turnOff(int flags) {
- fFlags &= (~flags);
- updateImageProviderFlags();
- updateTextProviderFlags();
- }
+// public void turnOff(int flags) {
+// fFlags &= (~flags);
+// updateImageProviderFlags();
+// updateTextProviderFlags();
+// }
private void updateImageProviderFlags() {
fImageFlags = 0;
* ViewerSorter#isSorterProperty(Object, String). Method could
* be removed, but kept for API compatibility.
*/
- public boolean isSorterProperty(Object element, Object property) {
- return true;
- }
+// public boolean isSorterProperty(Object element, Object property) {
+// return true;
+// }
/*
* @see ViewerSorter#category
package net.sourceforge.phpdt.ui;
import net.sourceforge.phpdt.core.IBufferFactory;
-import net.sourceforge.phpdt.core.IJavaElement;
-import net.sourceforge.phpdt.core.IWorkingCopy;
-import net.sourceforge.phpdt.core.JavaCore;
-import net.sourceforge.phpdt.core.JavaModelException;
+//import net.sourceforge.phpdt.core.IJavaElement;
+//import net.sourceforge.phpdt.core.IWorkingCopy;
+//import net.sourceforge.phpdt.core.JavaCore;
+//import net.sourceforge.phpdt.core.JavaModelException;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
-import net.sourceforge.phpeclipse.phpeditor.EditorUtility;
-import net.sourceforge.phpeclipse.ui.WebUI;
+//import net.sourceforge.phpeclipse.phpeditor.EditorUtility;
+//import net.sourceforge.phpeclipse.ui.WebUI;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.internal.SharedImages;
-import org.eclipse.ui.texteditor.IDocumentProvider;
+//import org.eclipse.ui.IEditorPart;
+//import org.eclipse.ui.ISharedImages;
+//import org.eclipse.ui.PartInitException;
+//import org.eclipse.ui.internal.SharedImages;
+//import org.eclipse.ui.texteditor.IDocumentProvider;
/**
* Central access point for the Java UI plug-in (id
*/
public final class JavaUI {
- private static ISharedImages fgSharedImages = null;
+// private static ISharedImages fgSharedImages = null;
private JavaUI() {
// prevent instantiation of JavaUI.
*
* @return the shared images manager
*/
- public static ISharedImages getSharedImages() {
- if (fgSharedImages == null)
- fgSharedImages = new SharedImages();
-
- return fgSharedImages;
- }
+// public static ISharedImages getSharedImages() {
+// if (fgSharedImages == null)
+// fgSharedImages = new SharedImages();
+//
+// return fgSharedImages;
+// }
/**
* Creates a selection dialog that lists all packages of the given Java
* if this element does not exist or if an exception occurs
* while accessing its underlying resource
*/
- public static IEditorPart openInEditor(IJavaElement element)
- throws JavaModelException, PartInitException {
- return EditorUtility.openInEditor(element);
- }
+// public static IEditorPart openInEditor(IJavaElement element)
+// throws JavaModelException, PartInitException {
+// return EditorUtility.openInEditor(element);
+// }
/**
* Reveals the source range of the given source reference element in the
*
* @return the working copy manager for the Java UI plug-in
*/
- public static IWorkingCopyManager getWorkingCopyManager() {
- return WebUI.getDefault().getWorkingCopyManager();
- }
+// public static IWorkingCopyManager getWorkingCopyManager() {
+// return WebUI.getDefault().getWorkingCopyManager();
+// }
/**
* Answers the shared working copies currently registered for the Java
* @see net.sourceforge.phpdt.core.JavaCore#getSharedWorkingCopies(net.sourceforge.phpdt.core.IBufferFactory)
* @since 2.0
*/
- public static IWorkingCopy[] getSharedWorkingCopies() {
- return JavaCore.getSharedWorkingCopies(getBufferFactory());
- }
+// public static IWorkingCopy[] getSharedWorkingCopies() {
+// return JavaCore.getSharedWorkingCopies(getBufferFactory());
+// }
/**
* Answers the shared working copies that are on the class path of a Java
* @see IDocumentProvider
* @since 2.0
*/
- public static IDocumentProvider getDocumentProvider() {
- return WebUI.getDefault()
- .getCompilationUnitDocumentProvider();
- }
+// public static IDocumentProvider getDocumentProvider() {
+// return WebUI.getDefault()
+// .getCompilationUnitDocumentProvider();
+// }
/**
* Sets the Javadoc location for an archive with the given path.
* Creates a decorator. The decorator creates an own image registry to cache
* images.
*/
- public OverrideIndicatorLabelDecorator() {
- this(null);
- fUseNewRegistry = true;
- }
+// public OverrideIndicatorLabelDecorator() {
+// this(null);
+// fUseNewRegistry = true;
+// }
/*
* Creates decorator with a shared image registry.
public static class ProblemsLabelChangedEvent extends
LabelProviderChangedEvent {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -7557704732816971319L;
private boolean fMarkerChange;
/**
/**
* Creates a new <code>ProblemsLabelDecorator</code>.
*/
- public ProblemsLabelDecorator() {
- this(null);
- fUseNewRegistry = true;
- }
+// public ProblemsLabelDecorator() {
+// this(null);
+// fUseNewRegistry = true;
+// }
/*
* Creates decorator with a shared image registry.
import net.sourceforge.phpdt.core.ICompilationUnit;
import net.sourceforge.phpdt.core.IJavaElement;
-import net.sourceforge.phpdt.core.IJavaElementDelta;
+//import net.sourceforge.phpdt.core.IJavaElementDelta;
import net.sourceforge.phpdt.core.IJavaModel;
import net.sourceforge.phpdt.core.IJavaProject;
import net.sourceforge.phpdt.core.IPackageFragment;
* members of compilation units or class files and it does not provide
* working copy elements.
*/
- public StandardJavaElementContentProvider() {
- }
+// public StandardJavaElementContentProvider() {
+// }
/**
* Creates a new <code>StandardJavaElementContentProvider</code>.
* @return <code>true</code> if the content provider provides members;
* otherwise <code>false</code> is returned
*/
- public boolean getProvideMembers() {
- return fProvideMembers;
- }
+// public boolean getProvideMembers() {
+// return fProvideMembers;
+// }
/**
* Sets whether the content provider is supposed to return members when
* <code>false</code> compilation units and class files are the
* leaves provided by this content provider.
*/
- public void setProvideMembers(boolean b) {
- fProvideMembers = b;
- }
+// public void setProvideMembers(boolean b) {
+// fProvideMembers = b;
+// }
/**
* Returns whether the provided members are from a working copy or the
*
* @see #setProvideWorkingCopy(boolean)
*/
- public boolean getProvideWorkingCopy() {
- return fProvideWorkingCopy;
- }
+// public boolean getProvideWorkingCopy() {
+// return fProvideWorkingCopy;
+// }
/**
* Sets whether the members are provided from a shared working copy that
* copy if one exists in JDT core. If <code>false</code> the
* provider always returns original elements.
*/
- public void setProvideWorkingCopy(boolean b) {
- fProvideWorkingCopy = b;
- }
+// public void setProvideWorkingCopy(boolean b) {
+// fProvideWorkingCopy = b;
+// }
/*
* (non-Javadoc)
* Note: This method is for internal use only. Clients should not call this
* method.
*/
- protected boolean isClassPathChange(IJavaElementDelta delta) {
-
- // need to test the flags only for package fragment roots
- if (delta.getElement().getElementType() != IJavaElement.PACKAGE_FRAGMENT_ROOT)
- return false;
-
- int flags = delta.getFlags();
- return (delta.getKind() == IJavaElementDelta.CHANGED
- && ((flags & IJavaElementDelta.F_ADDED_TO_CLASSPATH) != 0)
- || ((flags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0) || ((flags & IJavaElementDelta.F_REORDER) != 0));
- }
+// protected boolean isClassPathChange(IJavaElementDelta delta) {
+//
+// // need to test the flags only for package fragment roots
+// if (delta.getElement().getElementType() != IJavaElement.PACKAGE_FRAGMENT_ROOT)
+// return false;
+//
+// int flags = delta.getFlags();
+// return (delta.getKind() == IJavaElementDelta.CHANGED
+// && ((flags & IJavaElementDelta.F_ADDED_TO_CLASSPATH) != 0)
+// || ((flags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0) || ((flags & IJavaElementDelta.F_REORDER) != 0));
+// }
/**
* Note: This method is for internal use only. Clients should not call this
* Note: This method is for internal use only. Clients should not call this
* method.
*/
- protected boolean isPackageFragmentEmpty(IJavaElement element)
- throws JavaModelException {
- if (element instanceof IPackageFragment) {
- IPackageFragment fragment = (IPackageFragment) element;
- if (!(fragment.hasChildren()))
- // ||
- // fragment.getNonJavaResources().length > 0) &&
- // fragment.hasSubpackages())
- return true;
- }
- return false;
- }
+// protected boolean isPackageFragmentEmpty(IJavaElement element)
+// throws JavaModelException {
+// if (element instanceof IPackageFragment) {
+// IPackageFragment fragment = (IPackageFragment) element;
+// if (!(fragment.hasChildren()))
+// // ||
+// // fragment.getNonJavaResources().length > 0) &&
+// // fragment.hasSubpackages())
+// return true;
+// }
+// return false;
+// }
/**
* Note: This method is for internal use only. Clients should not call this
* Note: This method is for internal use only. Clients should not call this
* method.
*/
- protected static Object[] concatenate(Object[] a1, Object[] a2) {
- int a1Len = a1.length;
- int a2Len = a2.length;
- Object[] res = new Object[a1Len + a2Len];
- System.arraycopy(a1, 0, res, 0, a1Len);
- System.arraycopy(a2, 0, res, a1Len, a2Len);
- return res;
- }
+// protected static Object[] concatenate(Object[] a1, Object[] a2) {
+// int a1Len = a1.length;
+// int a2Len = a2.length;
+// Object[] res = new Object[a1Len + a2Len];
+// System.arraycopy(a1, 0, res, 0, a1Len);
+// System.arraycopy(a2, 0, res, a1Len, a2Len);
+// return res;
+// }
}
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentExtension3;
import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.rules.DefaultPartitioner;
+//import org.eclipse.jface.text.rules.DefaultPartitioner;
import org.eclipse.jface.text.rules.FastPartitioner;
-import org.eclipse.jface.text.rules.RuleBasedScanner;
+//import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
*
* @return a Java source code scanner
*/
- public RuleBasedScanner getCodeScanner() {
- return fCodeScanner;
- }
+// public RuleBasedScanner getCodeScanner() {
+// return fCodeScanner;
+// }
/**
* Returns a scanner which is configured to scan Java multiline comments.
*
* @since 2.0
*/
- public RuleBasedScanner getMultilineCommentScanner() {
- return fMultilineCommentScanner;
- }
+// public RuleBasedScanner getMultilineCommentScanner() {
+// return fMultilineCommentScanner;
+// }
/**
* Returns a scanner which is configured to scan HTML code.
*
* @since 2.0
*/
- public RuleBasedScanner getSmartyScanner() {
- return fSmartyScanner;
- }
+// public RuleBasedScanner getSmartyScanner() {
+// return fSmartyScanner;
+// }
/**
* Returns a scanner which is configured to scan Smarty code.
*
* @since 2.0
*/
- public RuleBasedScanner getSmartyDocScanner() {
- return fSmartyDocScanner;
- }
+// public RuleBasedScanner getSmartyDocScanner() {
+// return fSmartyDocScanner;
+// }
/**
* Returns a scanner which is configured to scan Java singleline comments.
*
* @since 2.0
*/
- public RuleBasedScanner getSinglelineCommentScanner() {
- return fSinglelineCommentScanner;
- }
+// public RuleBasedScanner getSinglelineCommentScanner() {
+// return fSinglelineCommentScanner;
+// }
/**
* Returns a scanner which is configured to scan Java strings.
*
* @return a JavaDoc scanner
*/
- public RuleBasedScanner getJavaDocScanner() {
- return fPHPDocScanner;
- }
+// public RuleBasedScanner getJavaDocScanner() {
+// return fPHPDocScanner;
+// }
/**
* Returns a scanner which is configured to scan Java-specific partitions,
* @return the partition managing position categories or <code>null</code>
* if there is none
*/
- public String[] getPartitionManagingPositionCategories() {
- return new String[] { DefaultPartitioner.CONTENT_TYPES_CATEGORY };
- }
+// public String[] getPartitionManagingPositionCategories() {
+// return new String[] { DefaultPartitioner.CONTENT_TYPES_CATEGORY };
+// }
/**
* Determines whether the preference change encoded by the given event
* @return the core preference store
* @since 3.0
*/
- protected Preferences getCorePreferenceStore() {
- return fCorePreferenceStore;
- }
+// protected Preferences getCorePreferenceStore() {
+// return fCorePreferenceStore;
+// }
}
\ No newline at end of file
*/
public void init(IStructuredSelection selection) {
IJavaElement jelem = getInitialJavaElement(selection);
- initContainerPage(jelem);
+ //initContainerPage(jelem);
initTypePage(jelem);
doStatusUpdate();
*
* @return the selection state of the 'Create Main' checkbox
*/
- public boolean isCreateMain() {
- return fMethodStubsButtons.isSelected(0);
- }
+// public boolean isCreateMain() {
+// return fMethodStubsButtons.isSelected(0);
+// }
/**
* Returns the current selection state of the 'Create Constructors'
*
* @return the selection state of the 'Create Constructors' checkbox
*/
- public boolean isCreateConstructors() {
- return fMethodStubsButtons.isSelected(1);
- }
+// public boolean isCreateConstructors() {
+// return fMethodStubsButtons.isSelected(1);
+// }
/**
* Returns the current selection state of the 'Create inherited abstract
* @return the selection state of the 'Create inherited abstract methods'
* checkbox
*/
- public boolean isCreateInherited() {
- return fMethodStubsButtons.isSelected(2);
- }
+// public boolean isCreateInherited() {
+// return fMethodStubsButtons.isSelected(2);
+// }
/**
* Sets the selection state of the method stub checkboxes.
// monitor.done();
// }
// }
-}
+}
\ No newline at end of file
* the Java element used to compute the initial package fragment
* root used as the source folder
*/
- protected void initContainerPage(IJavaElement elem) {
- //IPackageFragmentRoot initRoot = null;
- // if (elem != null) {
- // initRoot= JavaModelUtil.getPackageFragmentRoot(elem);
- // if (initRoot == null || initRoot.isArchive()) {
- // IJavaProject jproject= elem.getJavaProject();
- // if (jproject != null) {
- // try {
- // initRoot= null;
- // if (jproject.exists()) {
- // IPackageFragmentRoot[] roots= jproject.getPackageFragmentRoots();
- // for (int i= 0; i < roots.length; i++) {
- // if (roots[i].getKind() == IPackageFragmentRoot.K_SOURCE) {
- // initRoot= roots[i];
- // break;
- // }
- // }
- // }
- // } catch (JavaModelException e) {
- // PHPeclipsePlugin.log(e);
- // }
- // if (initRoot == null) {
- // initRoot= jproject.getPackageFragmentRoot(jproject.getResource());
- // }
- // }
- // }
- // }
- // setPackageFragmentRoot(initRoot, true);
- }
+// protected void initContainerPage(IJavaElement elem) {
+// //IPackageFragmentRoot initRoot = null;
+// // if (elem != null) {
+// // initRoot= JavaModelUtil.getPackageFragmentRoot(elem);
+// // if (initRoot == null || initRoot.isArchive()) {
+// // IJavaProject jproject= elem.getJavaProject();
+// // if (jproject != null) {
+// // try {
+// // initRoot= null;
+// // if (jproject.exists()) {
+// // IPackageFragmentRoot[] roots= jproject.getPackageFragmentRoots();
+// // for (int i= 0; i < roots.length; i++) {
+// // if (roots[i].getKind() == IPackageFragmentRoot.K_SOURCE) {
+// // initRoot= roots[i];
+// // break;
+// // }
+// // }
+// // }
+// // } catch (JavaModelException e) {
+// // PHPeclipsePlugin.log(e);
+// // }
+// // if (initRoot == null) {
+// // initRoot= jproject.getPackageFragmentRoot(jproject.getResource());
+// // }
+// // }
+// // }
+// // }
+// // setPackageFragmentRoot(initRoot, true);
+// }
/**
* Utility method to inspect a selection to find a Java element.
/**
* Sets the focus to the source folder's text field.
*/
- protected void setFocusOnContainer() {
- fContainerDialogField.setFocus();
- }
+// protected void setFocusOnContainer() {
+// fContainerDialogField.setFocus();
+// }
// -------- ContainerFieldAdapter --------
// -------- IStringButtonAdapter
public void changeControlPressed(DialogField field) {
- containerChangeControlPressed(field);
+ //containerChangeControlPressed(field);
}
// -------- IDialogFieldListener
}
}
- private void containerChangeControlPressed(DialogField field) {
- // take the current jproject as init element of the dialog
- // IPackageFragmentRoot root= getPackageFragmentRoot();
- // root= chooseSourceContainer(root);
- // if (root != null) {
- // setPackageFragmentRoot(root, true);
- // }
- }
+// private void containerChangeControlPressed(DialogField field) {
+// // take the current jproject as init element of the dialog
+// // IPackageFragmentRoot root= getPackageFragmentRoot();
+// // root= chooseSourceContainer(root);
+// // if (root != null) {
+// // setPackageFragmentRoot(root, true);
+// // }
+// }
private void containerDialogFieldChanged(DialogField field) {
if (field == fContainerDialogField) {
fContainerStatus = containerChanged();
}
// tell all others
- handleFieldChanged(CONTAINER);
+ //handleFieldChanged(CONTAINER);
}
// ----------- validation ----------
* The name of the field that has changed (field id). For the
* source folder the field id is <code>CONTAINER</code>
*/
- protected void handleFieldChanged(String fieldName) {
- }
+// protected void handleFieldChanged(String fieldName) {
+// }
// ---- get ----------------
// }
// return null;
// }
-}
+}
\ No newline at end of file
//import net.sourceforge.phpdt.externaltools.internal.ui.StatusInfo;
import net.sourceforge.phpeclipse.ui.StatusInfo;
import net.sourceforge.phpdt.internal.corext.codemanipulation.StubUtility;
-import net.sourceforge.phpdt.internal.corext.template.php.JavaContext;
-import net.sourceforge.phpdt.internal.corext.template.php.Templates;
-import net.sourceforge.phpdt.internal.corext.util.JavaModelUtil;
+//import net.sourceforge.phpdt.internal.corext.template.php.JavaContext;
+//import net.sourceforge.phpdt.internal.corext.template.php.Templates;
+//import net.sourceforge.phpdt.internal.corext.util.JavaModelUtil;
import net.sourceforge.phpdt.internal.ui.PHPUiImages;
import net.sourceforge.phpdt.internal.ui.util.SWTUtil;
import net.sourceforge.phpdt.internal.ui.wizards.NewWizardMessages;
import net.sourceforge.phpdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
import net.sourceforge.phpdt.internal.ui.wizards.dialogfields.StringButtonStatusDialogField;
import net.sourceforge.phpdt.internal.ui.wizards.dialogfields.StringDialogField;
-import net.sourceforge.phpdt.ui.CodeGeneration;
-import net.sourceforge.phpdt.ui.PreferenceConstants;
-import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+//import net.sourceforge.phpdt.ui.CodeGeneration;
+//import net.sourceforge.phpdt.ui.PreferenceConstants;
+//import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
//import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateException;
+//import org.eclipse.jface.text.BadLocationException;
+//import org.eclipse.jface.text.templates.Template;
+//import org.eclipse.jface.text.templates.TemplateException;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
* @see net.sourceforge.phpdt.ui.wizards.NewContainerWizardPage#handleFieldChanged(String)
*/
protected void handleFieldChanged(String fieldName) {
- super.handleFieldChanged(fieldName);
+ //super.handleFieldChanged(fieldName);
if (fieldName == CONTAINER) {
fPackageStatus = packageChanged();
// fEnclosingTypeStatus= enclosingTypeChanged();
*
* @return the text of the enclosing type input field
*/
- public String getEnclosingTypeText() {
- return fEnclosingTypeDialogField.getText();
- }
+// public String getEnclosingTypeText() {
+// return fEnclosingTypeDialogField.getText();
+// }
/**
* Returns the package fragment corresponding to the current input.
* @return the selected modifiers
* @see Flags
*/
- public int getModifiers() {
- int mdf = 0;
- if (fAccMdfButtons.isSelected(PUBLIC_INDEX)) {
- mdf += F_PUBLIC;
- } else if (fAccMdfButtons.isSelected(PRIVATE_INDEX)) {
- mdf += F_PRIVATE;
- } else if (fAccMdfButtons.isSelected(PROTECTED_INDEX)) {
- mdf += F_PROTECTED;
- }
- // if (fOtherMdfButtons.isSelected(ABSTRACT_INDEX) && (fStaticMdfIndex
- // != 0)) {
- // mdf+= F_ABSTRACT;
- // }
- if (fOtherMdfButtons.isSelected(FINAL_INDEX)) {
- mdf += F_FINAL;
- }
- if (fOtherMdfButtons.isSelected(fStaticMdfIndex)) {
- mdf += F_STATIC;
- }
- return mdf;
- }
+// public int getModifiers() {
+// int mdf = 0;
+// if (fAccMdfButtons.isSelected(PUBLIC_INDEX)) {
+// mdf += F_PUBLIC;
+// } else if (fAccMdfButtons.isSelected(PRIVATE_INDEX)) {
+// mdf += F_PRIVATE;
+// } else if (fAccMdfButtons.isSelected(PROTECTED_INDEX)) {
+// mdf += F_PROTECTED;
+// }
+// // if (fOtherMdfButtons.isSelected(ABSTRACT_INDEX) && (fStaticMdfIndex
+// // != 0)) {
+// // mdf+= F_ABSTRACT;
+// // }
+// if (fOtherMdfButtons.isSelected(FINAL_INDEX)) {
+// mdf += F_FINAL;
+// }
+// if (fOtherMdfButtons.isSelected(fStaticMdfIndex)) {
+// mdf += F_STATIC;
+// }
+// return mdf;
+// }
/**
* Sets the modifiers.
* otherwise they are read-only
* @see Flags
*/
- public void setModifiers(int modifiers, boolean canBeModified) {
- if (Flags.isPublic(modifiers)) {
- fAccMdfButtons.setSelection(PUBLIC_INDEX, true);
- } else if (Flags.isPrivate(modifiers)) {
- fAccMdfButtons.setSelection(PRIVATE_INDEX, true);
- } else if (Flags.isProtected(modifiers)) {
- fAccMdfButtons.setSelection(PROTECTED_INDEX, true);
- } else {
- fAccMdfButtons.setSelection(DEFAULT_INDEX, true);
- }
- // if (Flags.isAbstract(modifiers)) {
- // fOtherMdfButtons.setSelection(ABSTRACT_INDEX, true);
- // }
- if (Flags.isFinal(modifiers)) {
- fOtherMdfButtons.setSelection(FINAL_INDEX, true);
- }
- if (Flags.isStatic(modifiers)) {
- fOtherMdfButtons.setSelection(fStaticMdfIndex, true);
- }
-
- fAccMdfButtons.setEnabled(canBeModified);
- fOtherMdfButtons.setEnabled(canBeModified);
- }
+// public void setModifiers(int modifiers, boolean canBeModified) {
+// if (Flags.isPublic(modifiers)) {
+// fAccMdfButtons.setSelection(PUBLIC_INDEX, true);
+// } else if (Flags.isPrivate(modifiers)) {
+// fAccMdfButtons.setSelection(PRIVATE_INDEX, true);
+// } else if (Flags.isProtected(modifiers)) {
+// fAccMdfButtons.setSelection(PROTECTED_INDEX, true);
+// } else {
+// fAccMdfButtons.setSelection(DEFAULT_INDEX, true);
+// }
+// // if (Flags.isAbstract(modifiers)) {
+// // fOtherMdfButtons.setSelection(ABSTRACT_INDEX, true);
+// // }
+// if (Flags.isFinal(modifiers)) {
+// fOtherMdfButtons.setSelection(FINAL_INDEX, true);
+// }
+// if (Flags.isStatic(modifiers)) {
+// fOtherMdfButtons.setSelection(fStaticMdfIndex, true);
+// }
+//
+// fAccMdfButtons.setEnabled(canBeModified);
+// fOtherMdfButtons.setEnabled(canBeModified);
+// }
/**
* Returns the content of the superclass input field.
*
* @return the superclass name
*/
- public String getSuperClass() {
- return fSuperClassDialogField.getText();
- }
+// public String getSuperClass() {
+// return fSuperClassDialogField.getText();
+// }
/**
* Sets the super class name.
* @return a list of chosen super interfaces. The list's elements are of
* type <code>String</code>
*/
- public List getSuperInterfaces() {
- return fSuperInterfacesDialogField.getElements();
- }
+// public List getSuperInterfaces() {
+// return fSuperInterfacesDialogField.getElements();
+// }
/**
* Sets the super interfaces.
* @return the type comment or <code>null</code> if a type comment is not
* desired
*/
- protected String getTypeComment(ICompilationUnit parentCU) {
- if (PreferenceConstants.getPreferenceStore().getBoolean(
- PreferenceConstants.CODEGEN_ADD_COMMENTS)) {
- try {
- StringBuffer typeName = new StringBuffer();
- if (isEnclosingTypeSelected()) {
- typeName.append(
- JavaModelUtil
- .getTypeQualifiedName(getEnclosingType()))
- .append('.');
- }
- typeName.append(getTypeName());
- String comment = CodeGeneration.getTypeComment(parentCU,
- typeName.toString(), String.valueOf('\n'));
- if (comment != null && isValidComment(comment)) {
- return comment;
- }
- } catch (CoreException e) {
- PHPeclipsePlugin.log(e);
- }
- }
- return null;
- }
+// protected String getTypeComment(ICompilationUnit parentCU) {
+// if (PreferenceConstants.getPreferenceStore().getBoolean(
+// PreferenceConstants.CODEGEN_ADD_COMMENTS)) {
+// try {
+// StringBuffer typeName = new StringBuffer();
+// if (isEnclosingTypeSelected()) {
+// typeName.append(
+// JavaModelUtil
+// .getTypeQualifiedName(getEnclosingType()))
+// .append('.');
+// }
+// typeName.append(getTypeName());
+// String comment = CodeGeneration.getTypeComment(parentCU,
+// typeName.toString(), String.valueOf('\n'));
+// if (comment != null && isValidComment(comment)) {
+// return comment;
+// }
+// } catch (CoreException e) {
+// PHPeclipsePlugin.log(e);
+// }
+// }
+// return null;
+// }
/**
* @deprecated Use getTemplate(String,ICompilationUnit,int)
*/
- protected String getTemplate(String name, ICompilationUnit parentCU) {
- return getTemplate(name, parentCU, 0);
- }
+// protected String getTemplate(String name, ICompilationUnit parentCU) {
+// return getTemplate(name, parentCU, 0);
+// }
/**
* Returns the string resulting from evaluation the given template in the
* a source offset into the parent compilation unit. The template
* is evalutated at the given source offset
*/
- protected String getTemplate(String name, ICompilationUnit parentCU, int pos) {
- try {
- Template[] templates = Templates.getInstance().getTemplates(name);
- if (templates.length > 0) {
- return JavaContext
- .evaluateTemplate(templates[0], parentCU, pos);
- }
- } catch (CoreException e) {
- PHPeclipsePlugin.log(e);
- } catch (BadLocationException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- } catch (TemplateException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- return null;
- }
+// protected String getTemplate(String name, ICompilationUnit parentCU, int pos) {
+// try {
+// Template[] templates = Templates.getInstance().getTemplates(name);
+// if (templates.length > 0) {
+// return JavaContext
+// .evaluateTemplate(templates[0], parentCU, pos);
+// }
+// } catch (CoreException e) {
+// PHPeclipsePlugin.log(e);
+// } catch (BadLocationException e1) {
+// // TODO Auto-generated catch block
+// e1.printStackTrace();
+// } catch (TemplateException e1) {
+// // TODO Auto-generated catch block
+// e1.printStackTrace();
+// }
+// return null;
+// }
/**
* @deprecated Use
// }
// };
// }
-}
+}
\ No newline at end of file