File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
sources/net.sf.j2s.java.core/src/swingjs Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 11package swingjs ;
22
3+ import java .awt .Component ;
34import java .awt .JSComponent ;
45import java .awt .Toolkit ;
56import java .io .BufferedInputStream ;
@@ -572,5 +573,29 @@ public static BufferedReader getJSONReader(Object is) {
572573 return JSON .getJSONReader ((InputStream ) is );
573574 }
574575
576+ /**
577+ * Retrieve the JavaScript method or field aliasing this component's method or field
578+ * @param c the component
579+ * @param name the method's fully qualified name, such as paint$java_awt_Graphics
580+ * @return the JavaScript function backing this method name
581+ */
582+ public static Object getJ2SAlias (Component c , String name ) {
583+ return (/** @j2sNative c[name] || */ null );
584+ }
585+
586+ /**
587+ *
588+ * @param f the JavaScript function aliasing the Java method
589+ * @param cl
590+ * @return
591+ */
592+ public static boolean isOverridden (Object f , Class <?> cl ) {
593+ return (/** @j2sNative f && f.exClazz != cl.$clazz$ || */ false );
594+ }
595+
596+ public static boolean isOverridden (Component c , String name , Class <?> cl ) {
597+ return isOverridden (getJ2SAlias (c , name ), cl );
598+ }
599+
575600}
576601
You can’t perform that action at this time.
0 commit comments