JBoss Tools SVN: r21834 - in trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext: view and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2010-04-30 12:09:11 -0400 (Fri, 30 Apr 2010)
New Revision: 21834
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
Log:
SWTBot Extensions : small fixes, + auto-closing unexpected dialogs when closing shell
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java 2010-04-30 15:49:48 UTC (rev 21833)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTOpenExt.java 2010-04-30 16:09:11 UTC (rev 21834)
@@ -237,6 +237,12 @@
log.info("OK, shell '"+activeShellStr+"' closed.");
return;
} catch (TimeoutException ex) {
+ String currentShellStr = bot.activeShell().getText();
+ if (!activeShellStr.equals(currentShellStr)) {
+ log.error("Unexpected shell '"+currentShellStr+"': ["+SWTUtilExt.getAllBotWidgetsAsText(bot)+"] appeared, when waiting for shell to close");
+ bot.activeShell().close();
+ log.info("Shell '"+currentShellStr+"' closed.");
+ }
if (System.currentTimeMillis()-time>timeout) {
log.error("Shell '"+activeShellStr+"' probably hanged up (480s timeout), returning, forcing to close it, expect errors");
try {
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java 2010-04-30 15:49:48 UTC (rev 21833)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java 2010-04-30 16:09:11 UTC (rev 21834)
@@ -33,6 +33,8 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
+import org.eclipse.swtbot.swt.finder.results.Result;
import org.eclipse.swtbot.swt.finder.utils.SWTUtils;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton;
@@ -606,6 +608,27 @@
}
}
/**
+ * gets all active widgets as string
+ * @param bot
+ * @return
+ */
+ public static String getAllBotWidgetsAsText(final SWTBot bot) {
+ return UIThreadRunnable.syncExec(new Result<String>(){
+ public String run() {
+ StringBuilder sb = new StringBuilder();
+ List<?> widgets = bot.widgets(new SWTUtilExt.AlwaysMatchMatcher<Widget>());
+ for (Object object : widgets){
+ String objectName = object.getClass().getSimpleName();
+ String text = SWTUtilExt.invokeMethod(object, "getText").trim();
+ if (!"".equals(text)) {
+ sb.append("{"+ objectName + "->"+text+"} ");
+ }
+ }
+ return sb.toString();
+ }});
+
+ }
+ /**
* Display all active widgets
* @param bot
*/
@@ -652,7 +675,7 @@
String result = "<null>";
try {
- Object oResult = SWTUtils.invokeMethod(object, "getText");
+ Object oResult = SWTUtils.invokeMethod(object, method);
if (oResult != null){
result = oResult.toString();
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java 2010-04-30 15:49:48 UTC (rev 21833)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java 2010-04-30 16:09:11 UTC (rev 21834)
@@ -53,7 +53,7 @@
*/
public void deleteProject(String projectName, boolean fileSystem) {
log.info("Deleting project '"+projectName+"'");
- SWTBot viewBot = viewByTitle(viewObject.getName()).bot();
+ SWTBot viewBot = show().bot();
SWTBotTreeItem item = viewBot.tree().expandNode(projectName);
ContextMenuHelper.prepareTreeItemForContextMenu(viewBot.tree(), item);
new SWTBotMenu(ContextMenuHelper.getContextMenu(viewBot.tree(), IDELabel.Menu.DELETE, false)).click();
@@ -69,7 +69,7 @@
* deletes all projects from workspace
*/
public void deleteAllProjects() {
- SWTBot viewBot = viewByTitle(viewObject.getName()).bot();
+ SWTBot viewBot = show().bot();
List<String> items = new Vector<String>();
for (SWTBotTreeItem ti : viewBot.tree().getAllItems()) {
items.add(ti.getText());
@@ -95,7 +95,7 @@
* @return editor with opened file
*/
public SWTBotEditor openFile(String projectName, String... path) {
- SWTBot viewBot = open.viewOpen(viewObject).bot();
+ SWTBot viewBot = show().bot();
SWTBotTree tree = viewBot.tree();
SWTBotTreeItem item = tree.expandNode(projectName);
StringBuilder builder = new StringBuilder(projectName);
@@ -114,7 +114,7 @@
* @param projectName
*/
public void runOnServer(String projectName) {
- SWTBot viewBot = open.viewOpen(viewObject).bot();
+ SWTBot viewBot = show().bot();
SWTBotTreeItem item = viewBot.tree().expandNode(projectName);
ContextMenuHelper.prepareTreeItemForContextMenu(viewBot.tree(), item);
final SWTBotMenu menuRunAs = viewBot.menu(IDELabel.Menu.RUN).menu(IDELabel.Menu.RUN_AS);
@@ -155,7 +155,7 @@
public boolean existsResource(String... resource) {
try {
- SWTBot viewBot = viewByTitle(viewObject.getName()).bot();
+ SWTBot viewBot = show().bot();
SWTBotTreeItem ancestor = viewBot.tree().getTreeItem(resource[0]);
viewBot.tree().expandNode(resource[0]);
for (int i=1;i<resource.length;i++) {
@@ -167,7 +167,6 @@
return true;
}
catch (WidgetNotFoundException ex) {
- ex.printStackTrace();
return false;
}
}
14 years, 8 months
JBoss Tools SVN: r21833 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-04-30 11:49:48 -0400 (Fri, 30 Apr 2010)
New Revision: 21833
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-2708 Added new validation rules
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties 2010-04-30 15:49:13 UTC (rev 21832)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties 2010-04-30 15:49:48 UTC (rev 21833)
@@ -76,7 +76,7 @@
CDIValidatorConfigurationBlock_pb_illegalConditionalObserver_label=Illegal conditional observer:
##Interceptor & Decorator
-CDIValidatorConfigurationBlock_section_interceptor_and_decorator=Interceptors & Decorators
+CDIValidatorConfigurationBlock_section_interceptor_and_decorator=Interceptors and Decorators
CDIValidatorConfigurationBlock_pb_bothInterceptorAndDecorator_label=Both @Interceptor and @Decorator used:
CDIValidatorConfigurationBlock_pb_sessionBeanAnnotatedInterceptorOrDecorator_label=Session bean annotated @Interceptor or @Decorator:
CDIValidatorConfigurationBlock_pb_producerInInterceptorOrDecorator_label=Interceptor or decorator has a field annotated @Produces:
14 years, 8 months
JBoss Tools SVN: r21832 - in trunk: cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-04-30 11:49:13 -0400 (Fri, 30 Apr 2010)
New Revision: 21832
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/Spider.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/TimestampLogger.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/beans.xml
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/FordInterceptor.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/Spider.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/Transactional.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2708 Added new validation rules
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-04-30 14:55:55 UTC (rev 21831)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-04-30 15:49:13 UTC (rev 21832)
@@ -312,6 +312,7 @@
Set<IBeanMethod> disposers = bean.getDisposers();
for (IBeanMethod disposer : disposers) {
List<IParameter> params = disposer.getParameters();
+
/*
* 3.3.6. Declaring a disposer method
* - method has more than one parameter annotated @Disposes
@@ -328,6 +329,7 @@
addError(CDIValidationMessages.MULTIPLE_DISPOSING_PARAMETERS, CDIPreferences.MULTIPLE_DISPOSING_PARAMETERS, declaration, bean.getResource());
}
}
+
/*
* 3.3.6. Declaring a disposer method
* - a disposer method has a parameter annotated @Observes.
@@ -350,6 +352,7 @@
addError(CDIValidationMessages.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, CDIPreferences.OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED, declaration, bean.getResource());
}
}
+
/*
* 3.3.6. Declaring a disposer method
* - a disposer method is annotated @Inject.
@@ -370,6 +373,32 @@
* - a non-static method of a session bean class has a parameter annotated @Disposes, and the method is not a business method of the session bean
*/
validateSessionBeanMethod(bean, disposer, disposerDeclarations, CDIValidationMessages.ILLEGAL_DISPOSER_IN_SESSION_BEAN, CDIPreferences.ILLEGAL_DISPOSER_IN_SESSION_BEAN);
+
+ /*
+ * 3.3.6. Declaring a disposer method
+ * - decorators may not declare disposer methods
+ */
+ if(bean instanceof IDecorator) {
+ IDecorator decorator = (IDecorator)bean;
+ IAnnotationDeclaration decoratorDeclaration = decorator.getDecoratorAnnotation();
+ addError(CDIValidationMessages.DISPOSER_IN_DECORATOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, decoratorDeclaration, bean.getResource());
+ for (ITextSourceReference declaration : disposerDeclarations) {
+ addError(CDIValidationMessages.DISPOSER_IN_DECORATOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource());
+ }
+ }
+
+ /*
+ * 3.3.6. Declaring a disposer method
+ * - interceptors may not declare disposer methods
+ */
+ if(bean instanceof IInterceptor) {
+ IInterceptor interceptor = (IInterceptor)bean;
+ IAnnotationDeclaration interceptorDeclaration = interceptor.getInterceptorAnnotation();
+ addError(CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, interceptorDeclaration, bean.getResource());
+ for (ITextSourceReference declaration : disposerDeclarations) {
+ addError(CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource());
+ }
+ }
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-04-30 14:55:55 UTC (rev 21831)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-04-30 15:49:13 UTC (rev 21832)
@@ -68,8 +68,10 @@
public static String ILLEGAL_CONDITIONAL_OBSERVER;
public static String BOTH_INTERCEPTOR_AND_DECORATOR;
- public static String PRODUCER_IN_INTERCEPTOR_OR_DECORATOR;
- public static String DISPOSER_IN_INTERCEPTOR_OR_DECORATOR;
+ public static String PRODUCER_IN_INTERCEPTOR;
+ public static String PRODUCER_IN_DECORATOR;
+ public static String DISPOSER_IN_INTERCEPTOR;
+ public static String DISPOSER_IN_DECORATOR;
public static String MULTIPLE_DELEGATE;
public static String MISSING_DELEGATE;
public static String ILLEGAL_INJECTION_POINT_DELEGATE;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-04-30 14:55:55 UTC (rev 21831)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-04-30 15:49:13 UTC (rev 21832)
@@ -48,8 +48,10 @@
BOTH_INTERCEPTOR_AND_DECORATOR=the bean class of a managed bean is annotated with both the @Interceptor and @Decorator stereotypes
SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR=Bean class of a session bean is annotated @Interceptor or @Decorator
-PRODUCER_IN_INTERCEPTOR_OR_DECORATOR=Interceptor or decorator has a member annotated @Produces
-DISPOSER_IN_INTERCEPTOR_OR_DECORATOR=Interceptor or decorator has a method annotated @Disposes
+PRODUCER_IN_INTERCEPTOR=Interceptor has a member annotated @Produces
+PRODUCER_IN_OR_DECORATOR=Decorator has a member annotated @Produces
+DISPOSER_IN_INTERCEPTOR=Interceptor has a method annotated @Disposes
+DISPOSER_IN_DECORATOR=Decorator has a method annotated @Disposes
MULTIPLE_DELEGATE=Decorator has more than one delegate injection point
MISSING_DELEGATE=Decorator does not have a delegate injection point
ILLEGAL_INJECTION_POINT_DELEGATE=Injection point that is not an injected field, initializer method parameter or bean constructor method parameter is annotated @Delegate
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-04-30 14:55:55 UTC (rev 21831)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-04-30 15:49:13 UTC (rev 21832)
@@ -97,13 +97,13 @@
CDICorePlugin.PLUGIN_ID
);
-// private static SectionDescription SECTION_INTERCEPTOR = new SectionDescription(
-// CDIPreferencesMessages.CDIValidatorConfigurationBlock_section_interceptor_and_decorator,
-// new String[][]{
+ private static SectionDescription SECTION_INTERCEPTOR = new SectionDescription(
+ CDIPreferencesMessages.CDIValidatorConfigurationBlock_section_interceptor_and_decorator,
+ new String[][]{
// {CDIPreferences.BOTH_INTERCEPTOR_AND_DECORATOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_bothInterceptorAndDecorator_label},
// {CDIPreferences.SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_sessionBeanAnnotatedInterceptorOrDecorator_label},
// {CDIPreferences.PRODUCER_IN_INTERCEPTOR_OR_DECORATOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_producerInInterceptorOrDecorator_label},
-// {CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_disposerInInterceptorOrDecorator_label},
+ {CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_disposerInInterceptorOrDecorator_label},
// {CDIPreferences.MULTIPLE_DELEGATE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_multipleDelegate_label},
// {CDIPreferences.MISSING_DELEGATE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_missingDelegate_label},
// {CDIPreferences.ILLEGAL_INJECTION_POINT_DELEGATE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalInjectionPointDelegate_label},
@@ -115,9 +115,9 @@
// {CDIPreferences.OBSERVER_IN_INTERCEPTOR_OR_DECORATOR, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_observerInInterceptorOrDecorator_label},
// {CDIPreferences.INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_interceptorOrDecoratorIsAlternative_label},
// {CDIPreferences.MISSING_INTERCEPTOR_BINDING, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_missingInterceptorBinding_label},
-// },
-// CDICorePlugin.PLUGIN_ID
-// );
+ },
+ CDICorePlugin.PLUGIN_ID
+ );
// private static SectionDescription SECTION_SPECIALIZATION = new SectionDescription(
// CDIPreferencesMessages.CDIValidatorConfigurationBlock_section_specializing,
@@ -148,7 +148,7 @@
SECTION_TYPE,
SECTION_SCOPE,
SECTION_MEMBER,
-// SECTION_INTERCEPTOR,
+ SECTION_INTERCEPTOR,
// SECTION_SPECIALIZATION,
SECTION_MISCELLANEOUS
};
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml 2010-04-30 15:49:13 UTC (rev 21832)
@@ -0,0 +1,5 @@
+<beans>
+ <decorators>
+ <class>org.jboss.jsr299.tck.tests.jdt.validation.decorators.NamedDecoratorBroken</class>
+ </decorators>
+</beans>
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/decorators/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/Spider.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/Spider.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/Spider.java 2010-04-30 15:49:13 UTC (rev 21832)
@@ -0,0 +1,4 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.disposers;
+
+class Spider {
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/Spider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/TimestampLogger.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/TimestampLogger.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/TimestampLogger.java 2010-04-30 15:49:13 UTC (rev 21832)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.disposers;
+
+import javax.decorator.Decorator;
+import javax.enterprise.inject.Disposes;
+
+@Decorator
+public class TimestampLogger {
+
+ public static void destorySpider(@Disposes Spider spider) {
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/TimestampLogger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/beans.xml (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/beans.xml 2010-04-30 15:49:13 UTC (rev 21832)
@@ -0,0 +1,5 @@
+<beans>
+ <decorators>
+ <class>org.jboss.jsr299.tck.tests.jdt.validation.disposers.TimestampLogger</class>
+ </decorators>
+</beans>
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/disposers/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/FordInterceptor.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/FordInterceptor.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/FordInterceptor.java 2010-04-30 15:49:13 UTC (rev 21832)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.interceptors;
+
+import javax.enterprise.inject.Disposes;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+@Interceptor
+@Transactional
+class FordInterceptor {
+ @AroundInvoke
+ public Object alwaysReturnThis(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+
+ public static void destorySpider(@Disposes Spider spider) {
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/FordInterceptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/Spider.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/Spider.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/Spider.java 2010-04-30 15:49:13 UTC (rev 21832)
@@ -0,0 +1,4 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.interceptors;
+
+class Spider {
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/Spider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/Transactional.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/Transactional.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/Transactional.java 2010-04-30 15:49:13 UTC (rev 21832)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.interceptors;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.interceptor.InterceptorBinding;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@InterceptorBinding
+@interface Transactional {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/Transactional.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml 2010-04-30 15:49:13 UTC (rev 21832)
@@ -0,0 +1,6 @@
+<beans>
+ <interceptors>
+ <class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.NamedInterceptorBroken</class>
+ <class>org.jboss.jsr299.tck.tests.jdt.validation.interceptors.FordInterceptor</class>
+ </interceptors>
+</beans>
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/interceptors/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-04-30 14:55:55 UTC (rev 21831)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-04-30 15:49:13 UTC (rev 21832)
@@ -217,6 +217,28 @@
}
/**
+ * 3.3.6. Declaring a disposer method
+ * - decorators may not declare disposer methods
+ *
+ * @throws Exception
+ */
+ public void testDecoratorDeclaresDisposer() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/disposers/TimestampLogger.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.DISPOSER_IN_DECORATOR, 6, 9);
+ }
+
+ /**
+ * 3.3.6. Declaring a disposer method
+ * - interceptors may not declare disposer methods
+ *
+ * @throws Exception
+ */
+ public void testInterceptorDeclaresDisposer() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/interceptors/FordInterceptor.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, 8, 16);
+ }
+
+ /**
* 3.3.7. Disposer method resolution
* TODO
*
Modified: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2010-04-30 14:55:55 UTC (rev 21831)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2010-04-30 15:49:13 UTC (rev 21832)
@@ -99,6 +99,7 @@
realString.append(", ");
}
}
+ i = 1;
for (int expected : expectedLines) {
expectedString.append(expected);
if(expectedLines.length>i++) {
14 years, 8 months
JBoss Tools SVN: r21831 - in trunk/jsf: tests/org.jboss.tools.jsf.text.ext.test/projects/numberguess/web and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-04-30 10:55:55 -0400 (Fri, 30 Apr 2010)
New Revision: 21831
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/numberguess/web/giveup.jspx
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6179
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java 2010-04-30 14:32:07 UTC (rev 21830)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java 2010-04-30 14:55:55 UTC (rev 21831)
@@ -82,6 +82,7 @@
private IHyperlinkRegion getRegion(IDocument document, final int offset) {
jspExpression = false;
+ dotExpression = false;
ELContext context = getELContext(document);
if(context != null){
ExpressionStructure eStructure = getExpression(context, offset);
@@ -94,7 +95,7 @@
return region;
}
}
- dotExpression = checkDot(document, offset, context, eStructure.expression, invocationExpression, offset-eStructure.reference.getStartPosition(), offset);
+ dotExpression = checkDot(document, offset, context, eStructure.expression, invocationExpression, offset-eStructure.reference.getStartPosition());
IHyperlinkRegion region = new HyperlinkRegion(eStructure.expression.getStartPosition(), eStructure.expression.getLength(), null, null, null);
return region;
@@ -158,13 +159,13 @@
return false;
}
- public boolean checkDot(IDocument document, int superOffset, ELContext context, ELExpression expression, ELInvocationExpression invocationExpression, int offset, int globalOffset){
+ public boolean checkDot(IDocument document, int superOffset, ELContext context, ELExpression expression, ELInvocationExpression invocationExpression, int offset){
try{
String text = document.get(superOffset, 1);
if(DOT.equals(text)){
- if(decide(context, expression, invocationExpression, offset+1, globalOffset))
+ if(decide(context, expression, invocationExpression, offset+1, superOffset+1))
return true;
- else if(decide(context, expression, invocationExpression, offset-1, globalOffset))
+ else if(decide(context, expression, invocationExpression, offset-1, superOffset-1))
return true;
}
}catch(BadLocationException ex){
Modified: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/numberguess/web/giveup.jspx
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/numberguess/web/giveup.jspx 2010-04-30 14:32:07 UTC (rev 21830)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/numberguess/web/giveup.jspx 2010-04-30 14:55:55 UTC (rev 21831)
@@ -2,6 +2,7 @@
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.org/rich"
xmlns="http://www.w3.org/1999/xhtml"
version="2.0">
<jsp:output doctype-root-element="html"
@@ -20,6 +21,9 @@
<h:outputText value="#{Message.info_start}" /><h:outputText value="#{numberGuess.remainingGuesses}"/><h:outputText value="#{Message.info_finish}" />
<h:commandButton value="#{Message.button_yes}" action="yes"/>
<h:commandButton value="#{Message.button_no}" action="no"/>
+ <rich:dataTable value="#{numberGuess.possibilities}" var="_localVariable">
+ <h:outputText value="#{_localVariable.intValue}" />
+ </rich:dataTable>
</h:form>
</f:view>
</body>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java 2010-04-30 14:32:07 UTC (rev 21830)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java 2010-04-30 14:55:55 UTC (rev 21831)
@@ -118,38 +118,30 @@
HashMap<Object, ArrayList<Region>> recognitionTest = new HashMap<Object, ArrayList<Region>>();
ArrayList<Region> regionList = new ArrayList<Region>();
- regionList.add(new Region(623, 16));
- regionList.add(new Region(706, 16));
- regionList.add(new Region(813, 18));
- regionList.add(new Region(914, 19));
- regionList.add(new Region(972, 18));
- regionList.add(new Region(1041, 17));
+ regionList.add(new Region(673, 7));
+ regionList.add(new Region(680, 9));
+ regionList.add(new Region(756, 7));
+ regionList.add(new Region(763, 9));
+ regionList.add(new Region(863, 7));
+ regionList.add(new Region(870, 11));
+ regionList.add(new Region(964, 19));
+ regionList.add(new Region(1022, 18));
+ regionList.add(new Region(1091, 17));
recognitionTest.put("org.jboss.tools.common.text.ext.jsp.JSP_BUNDLE", regionList);
regionList = new ArrayList<Region>();
- regionList.add(new Region(859, 11));
- regionList.add(new Region(871, 16));
- recognitionTest.put("org.jboss.tools.common.text.ext.jsp.JSP_BEAN", regionList);
+ regionList.add(new Region(920, 1));
+ regionList.add(new Region(1168, 1));
+ regionList.add(new Region(1251, 1));
+ recognitionTest.put("org.jboss.tools.common.text.ext.jsp.DOT_EXPRESSION", regionList);
regionList = new ArrayList<Region>();
- regionList.add(new Region(859, 11));
- regionList.add(new Region(871, 16));
- recognitionTest.put("org.jboss.tools.seam.text.ext.SEAM_BEAN", regionList);
-
- regionList = new ArrayList<Region>();
- regionList.add(new Region(859, 11));
- regionList.add(new Region(870, 16));
- regionList.add(new Region(886, 1));
-
- recognitionTest.put("org.jboss.tools.common.text.ext.jsp.JSP_EXPRESSION", regionList);
-
-// regionList = new ArrayList<Region>();
-// regionList.add(new Region(870, 16));
-// recognitionTest.put("org.eclipse.jst.jsp.SCRIPT.JSP_EL2", regionList);
-
- regionList = new ArrayList<Region>();
- regionList.add(new Region(859, 11));
- regionList.add(new Region(871, 16));
+ regionList.add(new Region(909, 11));
+ regionList.add(new Region(921, 16));
+ regionList.add(new Region(1157, 11));
+ regionList.add(new Region(1169, 13));
+ regionList.add(new Region(1237, 14));
+ regionList.add(new Region(1252, 8));
recognitionTest.put("org.jboss.tools.common.text.ext.jsp.EXPRESSION", regionList);
int counter = 0;
@@ -216,7 +208,7 @@
}
}
- assertEquals("Wrong recognized region count: ", 132, counter);
+ assertEquals("Wrong recognized region count: ", 180, counter);
model.releaseFromEdit();
Modified: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java 2010-04-30 14:32:07 UTC (rev 21830)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java 2010-04-30 14:55:55 UTC (rev 21831)
@@ -17,7 +17,7 @@
public static Test suite() {
TestSuite suite = new TestSuite(JsfTextExtAllTests.class.getName());
- //suite.addTest(ELExprPartitionerTest.suite());
+ suite.addTest(ELExprPartitionerTest.suite());
return suite;
}
}
\ No newline at end of file
14 years, 8 months
JBoss Tools SVN: r21830 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-04-30 10:32:07 -0400 (Fri, 30 Apr 2010)
New Revision: 21830
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java
Log:
Moved model releasing to finally block.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java 2010-04-30 14:29:10 UTC (rev 21829)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java 2010-04-30 14:32:07 UTC (rev 21830)
@@ -79,10 +79,15 @@
if (document instanceof IStructuredDocument) {
IStructuredModel model = StructuredModelManager.getModelManager()
.getExistingModelForRead(document);
- if (model instanceof IDOMModel) {
- this.document = ((IDOMModel) model).getDocument();
+ try {
+ if (model instanceof IDOMModel) {
+ this.document = ((IDOMModel) model).getDocument();
+ }
+ } finally {
+ if(model!=null) {
+ model.releaseFromRead();
+ }
}
- model.releaseFromRead();
}
}
14 years, 8 months
JBoss Tools SVN: r21829 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: mozilla and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-04-30 10:29:10 -0400 (Fri, 30 Apr 2010)
New Revision: 21829
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaAfterPaintListener.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaScrollListener.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6203
Selection rectangle disappears when mouse cursor leaves the selected element.
- Resolved. Selection refresh is called now on mouse move.
https://jira.jboss.org/jira/browse/JBIDE-4022
Blue selection rectantle artefacts - if you select some big part in VPE and scroll with the mouse wheel and move mouse over it.
- Resolved. Selection refresh is called now on scroll and mozafterpait events move.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-04-30 14:14:04 UTC (rev 21828)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-04-30 14:29:10 UTC (rev 21829)
@@ -97,10 +97,12 @@
import org.jboss.tools.vpe.editor.menu.VpeMenuCreator;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
import org.jboss.tools.vpe.editor.mozilla.MozillaEventAdapter;
+import org.jboss.tools.vpe.editor.mozilla.listener.MozillaAfterPaintListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaContextMenuListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaKeyListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaMouseListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaResizeListener;
+import org.jboss.tools.vpe.editor.mozilla.listener.MozillaScrollListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaSelectionListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaTooltipListener;
import org.jboss.tools.vpe.editor.selection.VpeSelectionController;
@@ -147,7 +149,8 @@
ResourceReferenceListListener, ISelectionChangedListener,
IVisualController, MozillaMouseListener, MozillaKeyListener,
MozillaTooltipListener, MozillaSelectionListener,
- MozillaContextMenuListener, MozillaResizeListener {
+ MozillaContextMenuListener, MozillaResizeListener,
+ MozillaAfterPaintListener, MozillaScrollListener {
private boolean visualEditorVisible = true;
private boolean synced = true;
@@ -458,6 +461,8 @@
mozillaEventAdapter.addKeyListener(this);
mozillaEventAdapter.addMouseListener(this);
mozillaEventAdapter.addSelectionListener(this);
+ mozillaEventAdapter.addAfterPaintListener(this);
+ mozillaEventAdapter.addScrollListener(this);
}
}
}
@@ -475,6 +480,8 @@
mozillaEventAdapter.removeKeyListener(this);
mozillaEventAdapter.removeMouseListener(this);
mozillaEventAdapter.removeSelectionListener(this);
+ mozillaEventAdapter.removeAfterPaintListener(this);
+ mozillaEventAdapter.removeScrollListener(this);
}
}
}
@@ -1277,6 +1284,7 @@
}
public void mouseMove(nsIDOMMouseEvent mouseEvent) {
+ onRefresh();
// nsIDOMNode visualNode = VisualDomUtil.getTargetNode(mouseEvent);
// if (visualNode != null) {
// if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
@@ -1431,6 +1439,14 @@
visualBuilder.resize(element, constrains, top, left, width, height);
sourceSelectionChanged();
}
+
+ public void afterPaint(nsIDOMEvent domEvent) {
+ onRefresh();
+ }
+
+ public void editorScrolled(nsIDOMEvent domEvent) {
+ onRefresh();
+ }
/**
* Calls when on when browser receive context menu event.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java 2010-04-30 14:14:04 UTC (rev 21828)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java 2010-04-30 14:29:10 UTC (rev 21829)
@@ -12,10 +12,12 @@
import javax.swing.event.EventListenerList;
+import org.jboss.tools.vpe.editor.mozilla.listener.MozillaAfterPaintListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaContextMenuListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaDndListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaKeyListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaMouseListener;
+import org.jboss.tools.vpe.editor.mozilla.listener.MozillaScrollListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaSelectionListener;
import org.jboss.tools.vpe.xulrunner.browser.XulRunnerBrowser;
import org.mozilla.interfaces.nsIDOMDocument;
@@ -202,6 +204,23 @@
public void removeSelectionListener(MozillaSelectionListener listener) {
listeners.remove(MozillaSelectionListener.class, listener);
}
+
+ public void addAfterPaintListener(MozillaAfterPaintListener listener) {
+ listeners.add(MozillaAfterPaintListener.class, listener);
+ }
+
+ public void removeAfterPaintListener(MozillaAfterPaintListener listener) {
+ listeners.remove(MozillaAfterPaintListener.class, listener);
+ }
+
+ public void addScrollListener(MozillaScrollListener listener) {
+ listeners.add(MozillaScrollListener.class, listener);
+ }
+
+ public void removeScrollListener(MozillaScrollListener listener) {
+ listeners.remove(MozillaScrollListener.class, listener);
+ }
+
/**
* {@inheritDoc}
*/
@@ -293,6 +312,16 @@
MozillaDndListener.class)) {
listener.dragOver(domEvent);
}
+ } else if (SCROLL.equals(eventType)) {
+ for (MozillaScrollListener listener : listeners.getListeners(
+ MozillaScrollListener.class)) {
+ listener.editorScrolled(domEvent);
+ }
+ } else if (MOZAFTERPAINT.equals(eventType)) {
+ for (MozillaAfterPaintListener listener : listeners.getListeners(
+ MozillaAfterPaintListener.class)) {
+ listener.afterPaint(domEvent);
+ }
}
}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaAfterPaintListener.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaAfterPaintListener.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaAfterPaintListener.java 2010-04-30 14:29:10 UTC (rev 21829)
@@ -0,0 +1,15 @@
+package org.jboss.tools.vpe.editor.mozilla.listener;
+
+import java.util.EventListener;
+
+import org.mozilla.interfaces.nsIDOMEvent;
+
+/**
+ * Listener for MozAfterPaint events.
+ *
+ * @author Yahor Radtsevich (yradtsevich)
+ *
+ */
+public interface MozillaAfterPaintListener extends EventListener {
+ void afterPaint(nsIDOMEvent domEvent);
+}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaScrollListener.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaScrollListener.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaScrollListener.java 2010-04-30 14:29:10 UTC (rev 21829)
@@ -0,0 +1,15 @@
+package org.jboss.tools.vpe.editor.mozilla.listener;
+
+import java.util.EventListener;
+
+import org.mozilla.interfaces.nsIDOMEvent;
+
+/**
+ * Listener for scrolling events,
+ *
+ * @author Yahor Radtsevich (yradtsevich)
+ *
+ */
+public interface MozillaScrollListener extends EventListener {
+ void editorScrolled(nsIDOMEvent domEvent);
+}
14 years, 8 months
JBoss Tools SVN: r21828 - trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/editors.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2010-04-30 10:14:04 -0400 (Fri, 30 Apr 2010)
New Revision: 21828
Modified:
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/editors/ODEDeployMultiPageEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6230
added missing links to JIRA in comments as per my own recommendation ;)
Modified: trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/editors/ODEDeployMultiPageEditor.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/editors/ODEDeployMultiPageEditor.java 2010-04-30 12:51:48 UTC (rev 21827)
+++ trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/editors/ODEDeployMultiPageEditor.java 2010-04-30 14:14:04 UTC (rev 21828)
@@ -61,6 +61,7 @@
// Display this in title if no BPEL process files are found in current directory
private final static String NO_PROCESSES_FOUND = " *** No Processes Found *** ";
private boolean readOnly = false;
+ // https://jira.jboss.org/jira/browse/JBIDE-6230
// if BPEL processes were added or deleted, DD model is not in sync and needs to be saved
private boolean modelInSync = true;
protected TDeployment deployDescriptor = null;
@@ -263,6 +264,9 @@
return true;
}
});
+ // https://jira.jboss.org/jira/browse/JBIDE-6230
+ // figure out which BPEL processes are missing from the workspace
+ // and remove them from the DD model
Vector<ProcessType> processesToDelete = new Vector<ProcessType>();
for(ProcessType pt : deployDescriptor.getProcess())
{
14 years, 8 months
JBoss Tools SVN: r21827 - trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-04-30 08:51:48 -0400 (Fri, 30 Apr 2010)
New Revision: 21827
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/Flasher.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6203
Selection rectangle disappears when mouse cursor leaves the selected element.
- Minor fix: comment added.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/Flasher.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/Flasher.java 2010-04-30 12:51:03 UTC (rev 21826)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/Flasher.java 2010-04-30 12:51:48 UTC (rev 21827)
@@ -8,6 +8,8 @@
import org.mozilla.xpcom.Mozilla;
/**
+ * Class responsible for drawing borders around visual elements.
+ *
* @author Yahor Radtsevich (yradtsevich): extracted the code from XulRunnerEditor
*
*/
14 years, 8 months
JBoss Tools SVN: r21826 - trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-04-30 08:51:03 -0400 (Fri, 30 Apr 2010)
New Revision: 21826
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6203
Selection rectangle disappears when mouse cursor leaves the selected element.
- Outline code has been refactored.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2010-04-30 12:23:48 UTC (rev 21825)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2010-04-30 12:51:03 UTC (rev 21826)
@@ -720,8 +720,10 @@
@Override
protected void onDispose() {
lastSelectedNode = null;
- flasher.dispose();
- flasher = null;
+ if (flasher != null) {
+ flasher.dispose();
+ flasher = null;
+ }
super.onDispose();
}
14 years, 8 months
JBoss Tools SVN: r21825 - in trunk/vpe/plugins: org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-04-30 08:23:48 -0400 (Fri, 30 Apr 2010)
New Revision: 21825
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/Flasher.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeDomMapping.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6203
Selection rectangle disappears when mouse cursor leaves the selected element.
- Outline code has been refactored.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2010-04-30 11:12:59 UTC (rev 21824)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2010-04-30 12:23:48 UTC (rev 21825)
@@ -995,7 +995,7 @@
void setVisualElementSelection(nsIDOMElement visualElement) {
nsISelection selection = visualSelectionController.getSelection(nsISelectionController.SELECTION_NORMAL);
- visualElement.removeAttribute(XulRunnerEditor.VPEFLASHERCOLORATTRIBUTE);
+ visualElement.removeAttribute(XulRunnerEditor.VPE_INVISIBLE_ELEMENT);
nsIDOMNode visualParent = visualElement.getParentNode();
int offset = (int) VisualDomUtil.getOffset(visualElement);
selection.removeAllRanges();
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeDomMapping.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeDomMapping.java 2010-04-30 11:12:59 UTC (rev 21824)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeDomMapping.java 2010-04-30 12:23:48 UTC (rev 21825)
@@ -133,7 +133,7 @@
if(nearVisualNode instanceof nsIDOMElement){
nsIDOMElement visualElement = (nsIDOMElement) nearVisualNode;
- visualElement.removeAttribute(XulRunnerEditor.VPEFLASHERCOLORATTRIBUTE);
+ visualElement.removeAttribute(XulRunnerEditor.VPE_INVISIBLE_ELEMENT);
}
}
}
@@ -145,10 +145,10 @@
nsIDOMNode nearVisualNode = nodeMapping.getVisualNode();
if(nearVisualNode instanceof nsIDOMElement){
nsIDOMElement visualElement = (nsIDOMElement) nearVisualNode;
- visualElement.setAttribute(XulRunnerEditor.VPEFLASHERCOLORATTRIBUTE,
- XulRunnerEditor.flasherHiddentElementColor);
+ visualElement.setAttribute(XulRunnerEditor.VPE_INVISIBLE_ELEMENT,
+ Boolean.TRUE.toString());
}
- }
+ }
}
return nodeMapping;
}
Added: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/Flasher.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/Flasher.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/Flasher.java 2010-04-30 12:23:48 UTC (rev 21825)
@@ -0,0 +1,79 @@
+package org.jboss.tools.vpe.xulrunner.editor;
+
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.vpe.xulrunner.XPCOM;
+import org.mozilla.interfaces.inIFlasher;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIServiceManager;
+import org.mozilla.xpcom.Mozilla;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich): extracted the code from XulRunnerEditor
+ *
+ */
+public class Flasher {
+ private inIFlasher iFlasher;
+ private nsIDOMElement lastBorderedElement = null;
+
+ // added by Maksim Areshkau as element for which we
+ // have drowed border. When we draw new border,
+ // we should remove old one;
+ private static final String ELEMENT_BORDER_PATTERN = "border: 2px solid %s !important;";//$NON-NLS-1$
+ private static final String PREV_STYLE_ATTR_NAME = "oldstyle";//$NON-NLS-1$
+
+ public Flasher() {
+ nsIServiceManager serviceManager = Mozilla.getInstance()
+ .getServiceManager();
+ iFlasher = (inIFlasher) serviceManager.getServiceByContractID(
+ XPCOM.IN_FLASHER_CONTRACTID, inIFlasher.INIFLASHER_IID);
+ iFlasher.setThickness(2);
+ }
+
+ public void drawElementOutline(nsIDOMElement domElement) {
+ // fix for JBIDE-3969
+ // if(Platform.OS_MACOSX.equals(Platform.getOS())&&hasSelectInParenNodes(domElement.getParentNode()))
+ // {
+ // return;
+ // }
+ if (Platform.OS_MACOSX.equals(Platform.getOS())) {
+ // restore style for previously bordered element
+ if (this.lastBorderedElement != null
+ && this.lastBorderedElement.getAttribute(XulRunnerEditor.STYLE_ATTR) != null) {
+ String style = this.lastBorderedElement
+ .getAttribute(PREV_STYLE_ATTR_NAME);
+ this.lastBorderedElement.removeAttribute(PREV_STYLE_ATTR_NAME);
+ this.lastBorderedElement.setAttribute(XulRunnerEditor.STYLE_ATTR, style);
+ }
+
+ // save style for early bordered element
+ String oldstyle = domElement.getAttribute(XulRunnerEditor.STYLE_ATTR);
+ domElement.setAttribute(XulRunnerEditor.STYLE_ATTR,
+ domElement.getAttribute(XulRunnerEditor.STYLE_ATTR) + ';'
+ + String.format(ELEMENT_BORDER_PATTERN, iFlasher.getColor()));
+
+ this.lastBorderedElement = domElement;
+ this.lastBorderedElement.setAttribute(PREV_STYLE_ATTR_NAME,
+ oldstyle);
+ } else {
+ // under osx function drawElementOutline not works
+ iFlasher.drawElementOutline(domElement);
+ }
+ }
+
+ public void scrollElementIntoView(nsIDOMElement element) {
+ iFlasher.scrollElementIntoView(element);
+ }
+
+ public Object getColor() {
+ return iFlasher.getColor();
+ }
+
+ public void setColor(String color) {
+ iFlasher.setColor(color);
+ }
+
+ public void dispose() {
+ iFlasher = null;
+ lastBorderedElement = null;
+ }
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2010-04-30 11:12:59 UTC (rev 21824)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2010-04-30 12:23:48 UTC (rev 21825)
@@ -13,7 +13,6 @@
import java.util.regex.Pattern;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
@@ -27,7 +26,6 @@
import org.jboss.tools.vpe.xulrunner.XPCOM;
import org.jboss.tools.vpe.xulrunner.XulRunnerException;
import org.jboss.tools.vpe.xulrunner.browser.XulRunnerBrowser;
-import org.mozilla.interfaces.inIFlasher;
import org.mozilla.interfaces.nsIBaseWindow;
import org.mozilla.interfaces.nsIClipboardDragDropHookList;
import org.mozilla.interfaces.nsIComponentManager;
@@ -47,7 +45,6 @@
import org.mozilla.interfaces.nsISupports;
import org.mozilla.interfaces.nsITooltipListener;
import org.mozilla.interfaces.nsITransferable;
-import org.mozilla.xpcom.Mozilla;
import org.mozilla.xpcom.XPCOMException;
/**
@@ -64,29 +61,22 @@
/** IXulRunnerVpeResizer */
private IXulRunnerVpeResizer xulRunnerVpeResizer;
+
/**
* color which used for highlight elements which user can see, blue color
*/
- public static final String flasherVisialElementColor = "#0000ff"; //$NON-NLS-1$
+ private static final String FLASHER_VISUAL_ELEMENT_COLOR = "#0000ff"; //$NON-NLS-1$
/**
* color which used for highlight parent elements for elements which user,
* red color can't see.
*/
- public static final String flasherHiddentElementColor = "#ff0000"; //$NON-NLS-1$
+ private static final String FLASHER_HIDDEN_ELEMENT_COLOR = "#ff0000"; //$NON-NLS-1$
- // added by Maksim Areshkau as element for which we
- // have drowed border. When we draw new border,
- // we should remove old one;
- private nsIDOMElement lastBorderedElement;
- private static final String INVISIBLE_ELEMENT_BORDER = "border: 2px solid red !important;";//$NON-NLS-1$
- private static final String VISIBLE_ELEMENT_BORDER = "border: 2px solid blue !important;";//$NON-NLS-1$
- private static final String PREV_STYLE_ATTR_NAME = "oldstyle";//$NON-NLS-1$
-
/**
* Contains name of attribute for inIFLasher drawing
*/
- public static String VPEFLASHERCOLORATTRIBUTE = "vpeFlasherColorAttribute"; //$NON-NLS-1$
+ public static String VPE_INVISIBLE_ELEMENT = "vpeInvisibleElement"; //$NON-NLS-1$
public static final String TRANS_FLAVOR_kHTMLMime = "text/html"; //$NON-NLS-1$
public static final String TRANS_FLAVOR_kURLDataMime = "text/x-moz-url-data"; //$NON-NLS-1$
@@ -98,7 +88,7 @@
/**
* xpcom flasher component which used to draw lines
*/
- private inIFlasher iFlasher;
+ private Flasher flasher;
private nsIDocShell docShell = null;
/**
@@ -111,7 +101,7 @@
/**
* Contains attribute name for style
*/
- private static final String STYLE_ATTR = "style"; //$NON-NLS-1$
+ public static final String STYLE_ATTR = "style"; //$NON-NLS-1$
// private nsIDOMElement lastSelectedElement;
private nsIDOMNode lastSelectedNode;
@@ -385,7 +375,7 @@
*/
public void setSelectionRectangle(nsIDOMNode node, int resizerConstrains,
boolean scroll) {
- if (getIFlasher() == null) {
+ if (getFlasher() == null) {
return;
}
@@ -458,24 +448,22 @@
scrollToElement(element);
scrollRegtangleFlag = true;
}
- if (checkVisability(element)) {
- if ((element.getAttribute(VPEFLASHERCOLORATTRIBUTE) == null)
- || (!element.getAttribute(VPEFLASHERCOLORATTRIBUTE)
- .equals(flasherHiddentElementColor))) {
+ if (checkVisibility(element)) {
+ if ((element.getAttribute(VPE_INVISIBLE_ELEMENT) == null)
+ || (!element.getAttribute(VPE_INVISIBLE_ELEMENT)
+ .equals(Boolean.TRUE.toString()))) {
- getIFlasher().setColor(flasherVisialElementColor);
+ getFlasher().setColor(FLASHER_VISUAL_ELEMENT_COLOR);
} else {
- getIFlasher().setColor(flasherHiddentElementColor);
+ getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
}
drawElementOutline(element);
} else {
-
- getIFlasher().setColor(flasherHiddentElementColor);
+ getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
nsIDOMElement domElement = findVisbleParentElement(element);
if (domElement != null) {
-
drawElementOutline(domElement);
}
}
@@ -498,16 +486,12 @@
/**
* @return the iFlasher
*/
- private inIFlasher getIFlasher() {
+ private Flasher getFlasher() {
- if (iFlasher == null) {
- nsIServiceManager serviceManager = Mozilla.getInstance()
- .getServiceManager();
- iFlasher = (inIFlasher) serviceManager.getServiceByContractID(
- XPCOM.IN_FLASHER_CONTRACTID, inIFlasher.INIFLASHER_IID);
- iFlasher.setThickness(2);
+ if (flasher == null) {
+ flasher = new Flasher();
}
- return iFlasher;
+ return flasher;
}
private IXulRunnerVpeResizer getIXulRunnerVpeResizer() {
@@ -519,19 +503,14 @@
}
/**
- * Function created for checking if user can see element or not. Element
- * doesn't shows in VPE if it's has 'display:none;' attribute in style.
+ * Function created for checking if the user can see element or not. Element
+ * isn't shown in VPE if it has 'display:none;' attribute in style.
*
- * @param node
- * for checking it's visability
- * @param iFlasher
- * flasher which used for drawning border for elements adn in
- * which was setted color in depends of visability of element
- *
- * @return false for hiddent elements and true for visble elements
+ * @param node node to check its visibility
+ * @return {@code false} for hidden elements and {@code true}
+ * for visible elements
*/
- private boolean checkVisability(nsIDOMNode node) {
-
+ private boolean checkVisibility(nsIDOMNode node) {
nsIDOMElement domElement;
try {
@@ -569,8 +548,8 @@
// if parent node isn't nsIDOMElement just return null;
return null;
}
- while (parentElement != null && !checkVisability(parentElement)) {
- if (checkVisability(parentElement)) {
+ while (parentElement != null && !checkVisibility(parentElement)) {
+ if (checkVisibility(parentElement)) {
return parentElement;
} else {
@@ -621,31 +600,31 @@
// ((nsIBaseWindow)getWebBrowser().queryInterface(nsIBaseWindow.NS_IBASEWINDOW_IID)).repaint(false);
- if (getIFlasher() != null && getLastSelectedElement() != null) {
+ if (getLastSelectedElement() != null) {
if (scrollRegtangleFlag) {
scrollRegtangleFlag = false;
scrollToElement(getLastSelectedElement());
}
// checks visability of element
- if (checkVisability(getLastSelectedElement())) {
+ if (checkVisibility(getLastSelectedElement())) {
if ((getLastSelectedElement().getAttribute(
- VPEFLASHERCOLORATTRIBUTE) == null)
+ VPE_INVISIBLE_ELEMENT) == null)
|| (!getLastSelectedElement().getAttribute(
- VPEFLASHERCOLORATTRIBUTE).equals(
- flasherHiddentElementColor))) {
+ VPE_INVISIBLE_ELEMENT).equals(
+ Boolean.TRUE.toString()))) {
- getIFlasher().setColor(flasherVisialElementColor);
+ getFlasher().setColor(FLASHER_VISUAL_ELEMENT_COLOR);
} else {
- getIFlasher().setColor(flasherHiddentElementColor);
+ getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
}
drawElementOutline(getLastSelectedElement());
} else {
- getIFlasher().setColor(flasherHiddentElementColor);
+ getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
nsIDOMElement domElement = findVisbleParentElement(getLastSelectedElement());
if (domElement != null) {
@@ -675,8 +654,7 @@
* -element to which we should scroll
*/
private void scrollToElement(nsIDOMElement element) {
-
- getIFlasher().scrollElementIntoView(element);
+ getFlasher().scrollElementIntoView(element);
}
/**
@@ -718,40 +696,8 @@
* arround which border will be shown
*
*/
- private void drawElementOutline(nsIDOMElement domElement) {
- // fix for JBIDE-3969
- // if(Platform.OS_MACOSX.equals(Platform.getOS())&&hasSelectInParenNodes(domElement.getParentNode()))
- // {
- // return;
- // }
- if (Platform.OS_MACOSX.equals(Platform.getOS())) {
- // restore style for previously bordered element
- if (this.lastBorderedElement != null
- && this.lastBorderedElement.getAttribute(STYLE_ATTR) != null) {
- String style = this.lastBorderedElement
- .getAttribute(PREV_STYLE_ATTR_NAME);
- this.lastBorderedElement.removeAttribute(PREV_STYLE_ATTR_NAME);
- this.lastBorderedElement.setAttribute(STYLE_ATTR, style);
- }
-
- // save style for early bordered element
- String oldstyle = domElement.getAttribute(STYLE_ATTR);
- if (flasherHiddentElementColor.equals(getIFlasher().getColor())) {
- domElement.setAttribute(STYLE_ATTR, domElement
- .getAttribute(STYLE_ATTR)
- + ';' + XulRunnerEditor.INVISIBLE_ELEMENT_BORDER);
- } else {
- domElement.setAttribute(STYLE_ATTR, domElement
- .getAttribute(STYLE_ATTR)
- + ';' + XulRunnerEditor.VISIBLE_ELEMENT_BORDER);
- }
- this.lastBorderedElement = domElement;
- this.lastBorderedElement.setAttribute(PREV_STYLE_ATTR_NAME,
- oldstyle);
- } else {
- // under osx function drawElementOutline not works
- getIFlasher().drawElementOutline(domElement);
- }
+ private void drawElementOutline(nsIDOMElement element) {
+ getFlasher().drawElementOutline(element);
}
/**
@@ -774,7 +720,8 @@
@Override
protected void onDispose() {
lastSelectedNode = null;
- iFlasher = null;
+ flasher.dispose();
+ flasher = null;
super.onDispose();
}
14 years, 8 months