[jbosstools-commits] JBoss Tools SVN: r24026 - in trunk/cdi/plugins/org.jboss.tools.cdi.ui: src/org/jboss/tools/cdi/ui and 1 other directories.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Tue Aug 10 12:58:28 EDT 2010
Author: scabanovich
Date: 2010-08-10 12:58:27 -0400 (Tue, 10 Aug 2010)
New Revision: 24026
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewInterceptorCreationWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewInterceptorWizardPage.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIAnnotationWizardPage.java
Log:
https://jira.jboss.org/browse/JBIDE-3122
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2010-08-10 16:31:16 UTC (rev 24025)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2010-08-10 16:58:27 UTC (rev 24026)
@@ -178,6 +178,19 @@
Create a Interceptor Binding Java File
</description>
</wizard>
+
+ <wizard
+ category="org.jboss.tools.cdi.ui"
+ class="org.jboss.tools.cdi.ui.wizard.NewInterceptorCreationWizard"
+ icon="icons/cdi16.png"
+ id="org.jboss.tools.cdi.ui.wizard.NewInterceptorCreationWizard"
+ name="Interceptor Type"
+ project="false">
+ <description>
+ Create an Interceptor Java File
+ </description>
+ </wizard>
+
</extension>
</plugin>
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2010-08-10 16:31:16 UTC (rev 24025)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2010-08-10 16:58:27 UTC (rev 24026)
@@ -37,6 +37,9 @@
public static String NEW_INTERCEPTOR_BINDING_WIZARD_TITLE;
public static String NEW_INTERCEPTOR_BINDING_WIZARD_PAGE_NAME;
+ public static String NEW_INTERCEPTOR_WIZARD_TITLE;
+ public static String NEW_INTERCEPTOR_WIZARD_PAGE_NAME;
+
public static String SELECT_STEREOTYPE;
public static String SELECT_INTERCEPTOR_BINDING;
@@ -45,4 +48,7 @@
public static String FIELD_EDITOR_INTERCEPTOR_BINDINGS_LABEL;
public static String FIELD_EDITOR_STEREOTYPES_LABEL;
+ public static String MESSAGE_METHOD_NAME_EMPTY;
+ public static String MESSAGE_METHOD_NAME_NOT_VALID;
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2010-08-10 16:31:16 UTC (rev 24025)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2010-08-10 16:58:27 UTC (rev 24026)
@@ -26,6 +26,9 @@
NEW_INTERCEPTOR_BINDING_WIZARD_TITLE=New Interceptor Binding
NEW_INTERCEPTOR_BINDING_WIZARD_PAGE_NAME=Interceptor Binding Annotation Type
+NEW_INTERCEPTOR_WIZARD_TITLE=New Interceptor
+NEW_INTERCEPTOR_WIZARD_PAGE_NAME=Interceptor Type
+
SELECT_STEREOTYPE=Select Stereotype Annotation Type
SELECT_INTERCEPTOR_BINDING=Select Interceptor Binding Annotation Type
@@ -33,3 +36,6 @@
FIELD_EDITOR_TARGET_LABEL=Target:
FIELD_EDITOR_INTERCEPTOR_BINDINGS_LABEL=Interceptor Bindings:
FIELD_EDITOR_STEREOTYPES_LABEL=Stereotypes:
+
+MESSAGE_METHOD_NAME_EMPTY=Method Name is empty.
+MESSAGE_METHOD_NAME_NOT_VALID=Method Name is not valid. {0}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIAnnotationWizardPage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIAnnotationWizardPage.java 2010-08-10 16:31:16 UTC (rev 24025)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIAnnotationWizardPage.java 2010-08-10 16:58:27 UTC (rev 24026)
@@ -82,7 +82,7 @@
sb.append("@Target( {" + list.toString() + "} )").append(lineDelimiter);
}
- protected void addAnnotation(String typeName, ImportsManager imports, StringBuffer sb, String lineDelimiter) {
+ static void addAnnotation(String typeName, ImportsManager imports, StringBuffer sb, String lineDelimiter) {
int i = typeName.lastIndexOf('.');
String name = typeName.substring(i + 1);
imports.addImport(typeName);
@@ -199,7 +199,7 @@
}
}
- protected ICDIProject getCDIProject(IJavaProject jp) {
+ static ICDIProject getCDIProject(IJavaProject jp) {
CDICoreNature n = getCDINatureWithProgress(jp.getProject());
return n == null ? null : n.getDelegate();
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewInterceptorCreationWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewInterceptorCreationWizard.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewInterceptorCreationWizard.java 2010-08-10 16:58:27 UTC (rev 24026)
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.cdi.ui.wizard;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.internal.ui.wizards.NewElementWizard;
+import org.eclipse.jdt.ui.wizards.NewClassWizardPage;
+import org.jboss.tools.cdi.ui.CDIUIMessages;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class NewInterceptorCreationWizard extends NewElementWizard {
+ private NewClassWizardPage fPage;
+ private boolean fOpenEditorOnFinish = true;
+
+
+ public NewInterceptorCreationWizard() {
+ setWindowTitle(CDIUIMessages.NEW_INTERCEPTOR_WIZARD_TITLE);
+ }
+
+ /*
+ * @see Wizard#createPages
+ */
+ public void addPages() {
+ super.addPages();
+ if (fPage == null) {
+ fPage = new NewInterceptorWizardPage();
+ fPage.init(getSelection());
+ }
+ addPage(fPage);
+ }
+
+ /*(non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#canRunForked()
+ */
+ protected boolean canRunForked() {
+ return !fPage.isEnclosingTypeSelected();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#finishPage(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException {
+ fPage.createType(monitor); // use the full progress monitor
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.IWizard#performFinish()
+ */
+ public boolean performFinish() {
+ warnAboutTypeCommentDeprecation();
+ boolean res= super.performFinish();
+ if (res) {
+ IResource resource= fPage.getModifiedResource();
+ if (resource != null) {
+ selectAndReveal(resource);
+ if (fOpenEditorOnFinish) {
+ openResource((IFile) resource);
+ }
+ }
+ }
+ return res;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#getCreatedElement()
+ */
+ public IJavaElement getCreatedElement() {
+ return fPage.getCreatedType();
+ }
+
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewInterceptorCreationWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewInterceptorWizardPage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewInterceptorWizardPage.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewInterceptorWizardPage.java 2010-08-10 16:58:27 UTC (rev 24026)
@@ -0,0 +1,309 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.cdi.ui.wizard;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jdt.core.IBuffer;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.formatter.CodeFormatter;
+import org.eclipse.jdt.internal.corext.codemanipulation.AddUnimplementedConstructorsOperation;
+import org.eclipse.jdt.internal.corext.codemanipulation.AddUnimplementedMethodsOperation;
+import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
+import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
+import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2;
+import org.eclipse.jdt.internal.corext.dom.ASTNodes;
+import org.eclipse.jdt.internal.corext.util.JavaConventionsUtil;
+import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
+import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
+import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
+import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
+import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
+import org.eclipse.jdt.ui.CodeGeneration;
+import org.eclipse.jdt.ui.PreferenceConstants;
+import org.eclipse.jdt.ui.wizards.NewClassWizardPage;
+import org.eclipse.jdt.ui.wizards.NewTypeWizardPage.ImportsManager;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.core.ICDIAnnotation;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.ui.CDIUIMessages;
+import org.jboss.tools.common.java.generation.JavaBeanGenerator;
+import org.jboss.tools.common.ui.widget.editor.CompositeEditor;
+import org.jboss.tools.common.ui.widget.editor.IFieldEditor;
+import org.jboss.tools.common.ui.widget.editor.IFieldEditorFactory;
+import org.jboss.tools.common.ui.widget.editor.LabelFieldEditor;
+import org.jboss.tools.common.ui.widget.editor.ListFieldEditor;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class NewInterceptorWizardPage extends NewClassWizardPage {
+ protected InterceptorBindingSelectionProvider interceptorBindingsProvider = new InterceptorBindingSelectionProvider();
+ protected ListFieldEditor interceptorBindings = null;
+ IFieldEditor methodName = null;
+
+ protected StatusInfo methodNameStatus = new StatusInfo();
+ protected StatusInfo interceptorBindingsStatus = new StatusInfo();
+
+ public NewInterceptorWizardPage() {
+ setTitle(CDIUIMessages.NEW_INTERCEPTOR_WIZARD_PAGE_NAME);
+ }
+
+ public void init(IStructuredSelection selection) {
+ super.init(selection);
+ }
+
+ public void createControl(Composite parent) {
+ initializeDialogUnits(parent);
+
+ Composite composite= new Composite(parent, SWT.NONE);
+ composite.setFont(parent.getFont());
+
+ int nColumns= 4;
+
+ GridLayout layout= new GridLayout();
+ layout.numColumns= nColumns;
+ composite.setLayout(layout);
+
+ // pick & choose the wanted UI components
+
+ createContainerControls(composite, nColumns);
+ createPackageControls(composite, nColumns);
+// createEnclosingTypeControls(composite, nColumns);
+
+ createSeparator(composite, nColumns);
+
+ createTypeNameControls(composite, nColumns);
+// createModifierControls(composite, nColumns);
+
+ createSuperClassControls(composite, nColumns);
+// createSuperInterfacesControls(composite, nColumns);
+
+// createMethodStubSelectionControls(composite, nColumns);
+
+ createCustomFields(composite);
+
+ createCommentControls(composite, nColumns);
+ enableCommentControl(true);
+
+ setControl(composite);
+
+ Dialog.applyDialogFont(composite);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.NEW_CLASS_WIZARD_PAGE);
+
+ onInterceptorBindingChange();
+ doStatusUpdate();
+ }
+
+ protected void createTypeMembers(IType newType, final ImportsManager imports, IProgressMonitor monitor) throws CoreException {
+ createInheritedMethods(newType, true, true, imports, new SubProgressMonitor(monitor, 1));
+
+ ISourceRange range = newType.getSourceRange();
+ IBuffer buf = newType.getCompilationUnit().getBuffer();
+ String lineDelimiter = StubUtility.getLineDelimiterUsed(newType.getJavaProject());
+ StringBuffer sb = new StringBuffer();
+ addAnnotations(imports, sb, lineDelimiter);
+ buf.replace(range.getOffset(), 0, sb.toString());
+ //TODO add method
+ createAroundInvokeMethod(newType, imports, monitor, lineDelimiter);
+ }
+
+ void addAnnotations(ImportsManager imports, StringBuffer sb, String lineDelimiter) {
+ addInterceptorBindingAnnotations(imports, sb, lineDelimiter);
+ addInterceptorAnnotation(imports, sb, lineDelimiter);
+ }
+
+ protected void addInterceptorAnnotation(ImportsManager imports, StringBuffer sb, String lineDelimiter) {
+ NewCDIAnnotationWizardPage.addAnnotation(CDIConstants.INTERCEPTOR_ANNOTATION_TYPE_NAME, imports, sb, lineDelimiter);
+ }
+
+ protected void addInterceptorBindingAnnotations(ImportsManager imports, StringBuffer sb, String lineDelimiter) {
+ if(interceptorBindings != null) {
+ List list = (List)interceptorBindings.getValue();
+ for (Object o: list) {
+ if(o instanceof ICDIAnnotation) {
+ ICDIAnnotation a = (ICDIAnnotation)o;
+ String typeName = a.getSourceType().getFullyQualifiedName();
+ NewCDIAnnotationWizardPage.addAnnotation(typeName, imports, sb, lineDelimiter);
+ }
+ }
+ }
+ }
+
+ protected void createCustomFields(Composite composite) {
+ createInterceptorBindingField(composite);
+ createMethodNameField(composite);
+ }
+
+ protected void createInterceptorBindingField(Composite composite) {
+ interceptorBindings = new ListFieldEditor("interceptorBindings", CDIUIMessages.FIELD_EDITOR_INTERCEPTOR_BINDINGS_LABEL, new ArrayList<Object>());
+ interceptorBindings.setProvider(interceptorBindingsProvider);
+ interceptorBindingsProvider.setEditorField(interceptorBindings);
+ interceptorBindings.doFillIntoGrid(composite);
+ setInterceptorBindings(getPackageFragmentRoot());
+ interceptorBindings.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ onInterceptorBindingChange();
+ doStatusUpdate();
+ }
+ });
+ }
+
+ void onInterceptorBindingChange() {
+ interceptorBindingsStatus = new StatusInfo();
+ if(((List)interceptorBindings.getValue()).isEmpty()) {
+ interceptorBindingsStatus.setWarning("Interseptor Bindings list is empty.");
+ }
+ }
+
+ protected void createMethodNameField(Composite composite) {
+ String label = "Around Invoke Method Name:";
+ methodName = IFieldEditorFactory.INSTANCE.createTextEditor("methodName", label, "manage");
+ ((CompositeEditor)methodName).addFieldEditors(new IFieldEditor[]{new LabelFieldEditor("methodName", "")});
+ methodName.doFillIntoGrid(composite);
+ methodName.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ onMethodNameChange();
+ doStatusUpdate();
+ }
+ });
+ }
+
+ void setInterceptorBindings(IPackageFragmentRoot root) {
+ interceptorBindingsProvider.setProject(null);
+ if(root != null) {
+ IJavaProject jp = root.getJavaProject();
+ ICDIProject cdi = NewCDIAnnotationWizardPage.getCDIProject(jp);
+ if(cdi != null) {
+ interceptorBindingsProvider.setProject(cdi);
+ }
+ }
+ }
+
+ void onMethodNameChange() {
+ String methodName = this.methodName.getValueAsString();
+ methodNameStatus = new StatusInfo();
+ if(methodName.length() == 0) {
+ methodNameStatus.setError(CDIUIMessages.MESSAGE_METHOD_NAME_EMPTY);
+ return;
+ }
+ IStatus val = JavaConventionsUtil.validateMethodName(methodName, null);
+ if(val != null && val.getSeverity() == IStatus.ERROR) {
+ methodNameStatus.setError(NLS.bind(CDIUIMessages.MESSAGE_METHOD_NAME_NOT_VALID, val.getMessage()));
+ }
+
+ }
+
+ protected IMethod createAroundInvokeMethod(IType type, ImportsManager imports, IProgressMonitor monitor, String lineDelimiter) throws CoreException {
+ String methodName = "" + this.methodName.getValue();
+
+ imports.addImport("javax.interceptor.InvocationContext");
+ imports.addImport("javax.interceptor.AroundInvoke");
+
+ final ICompilationUnit cu= type.getCompilationUnit();
+ JavaModelUtil.reconcile(cu);
+ CodeGenerationSettings settings = JavaPreferencesSettings.getCodeGenerationSettings(type.getJavaProject());
+ settings.createComments = isAddComments();
+ String access = "public";
+ String javatype = "Object";
+
+ String methodHeader = "@AroundInvoke" + lineDelimiter + access + " " + javatype + " " + methodName + "(InvocationContext ic) throws Exception"; //$NON-NLS-1$ //$NON-NLS-2$
+ String stub = null;
+ if(!type.isInterface()) {
+ methodHeader += " {" + lineDelimiter; //$NON-NLS-1$
+ stub = methodHeader + "}" + lineDelimiter; //$NON-NLS-1$
+ } else {
+ methodHeader += ";" + lineDelimiter; //$NON-NLS-1$
+ stub = methodHeader;
+ }
+ IMethod m = type.createMethod(stub, null, true, null);
+
+ editMethod(cu, m, methodHeader, "return null;", lineDelimiter);
+ return m;
+ }
+
+ void editMethod(ICompilationUnit cu, IMethod m, String methodHeader, String methodContent, String lineDelimiter) throws CoreException {
+ synchronized(cu) {
+ cu.reconcile(ICompilationUnit.NO_AST, true, null, null);
+ }
+ ISourceRange range = m.getSourceRange();
+ IBuffer buf = cu.getBuffer();
+ StringBuffer sb = new StringBuffer(lineDelimiter);
+ if(isAddComments()) {
+ String methodComment = CodeGeneration.getMethodComment(m, null, lineDelimiter);
+ sb.append(methodComment);
+ }
+ sb.append(methodHeader);
+ if(methodContent != null) {
+ sb.append(methodContent).append("}").append(lineDelimiter); //$NON-NLS-1$
+ }
+ String formattedContent = JavaBeanGenerator.codeFormat2(CodeFormatter.K_CLASS_BODY_DECLARATIONS, sb.toString(), 1, lineDelimiter, cu.getJavaProject());
+ if(formattedContent != null && formattedContent.startsWith("\t")) { //$NON-NLS-1$
+ formattedContent = formattedContent.substring(1);
+ }
+ buf.replace(range.getOffset(), range.getLength(), formattedContent);
+ }
+
+
+ private void doStatusUpdate() {
+ // status of all used components
+ IStatus[] status= new IStatus[] {
+ fContainerStatus,
+ isEnclosingTypeSelected() ? fEnclosingTypeStatus : fPackageStatus,
+ fTypeNameStatus,
+ fModifierStatus,
+ fSuperClassStatus,
+ fSuperInterfacesStatus
+ };
+
+ // the mode severe status will be displayed and the OK button enabled/disabled.
+ updateStatus(status);
+ }
+
+ protected void updateStatus(IStatus[] status) {
+ IStatus[] ns = new IStatus[status.length + 2];
+ System.arraycopy(status, 0, ns, 0, status.length);
+ ns[status.length] = methodNameStatus;
+ ns[status.length + 1] = interceptorBindingsStatus;
+ status = ns;
+ updateStatus(StatusUtil.getMostSevere(status));
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewInterceptorWizardPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
More information about the jbosstools-commits
mailing list