public String getCurrentMethodName () { String s = cp1.getCurrentMethodName (); if ( (s == null) || (s.trim ().length () < 1)) return cp2.getCurrentMethodName (); return s; }
public static String getDefaultType () { String id = getContext().getSelectedIdentifier (); try { if (id != null) { if (id.equals(getContext().getCurrentMethodName())) return METHOD; String s = getContext().getCurrentClassName(); int i = s.lastIndexOf ('.'); if (i >= 0) s = s.substring (i + 1); if (id.equals (s)) return CLASS; return FIELD; } else { String s = getContext().getCurrentFieldName (); if (s != null && s.length () > 0) return FIELD; s = getContext().getCurrentMethodName(); if (s != null && s.length () > 0) return METHOD; if (s != null && s.length () < 1) { s = getContext().getCurrentClassName (); if (s.length () > 0) return CLASS; } } } catch (java.awt.IllegalComponentStateException icsex) {} return null; }
private static MethodBreakpoint createBreakpoint () { String className; try { className = EditorContextBridge.getContext().getCurrentClassName(); } catch (java.awt.IllegalComponentStateException icsex) { className = ""; } String methodName; try { methodName = EditorContextBridge.getContext().getCurrentMethodName(); } catch (java.awt.IllegalComponentStateException icsex) { methodName = ""; } MethodBreakpoint mb = MethodBreakpoint.create ( className, methodName ); try { mb.setMethodSignature(EditorContextBridge.getCurrentMethodSignature()); } catch (java.awt.IllegalComponentStateException icsex) {} mb.setPrintText ( NbBundle.getBundle (MethodBreakpointPanel.class).getString ("CTL_Method_Breakpoint_Print_Text") ); return mb; }