本文整理匯總了Java中edu.mit.csail.sdg.alloy4.OurSyntaxWidget.getCaret方法的典型用法代碼示例。如果您正苦於以下問題:Java OurSyntaxWidget.getCaret方法的具體用法?Java OurSyntaxWidget.getCaret怎麽用?Java OurSyntaxWidget.getCaret使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類edu.mit.csail.sdg.alloy4.OurSyntaxWidget
的用法示例。
在下文中一共展示了OurSyntaxWidget.getCaret方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: notifyChange
import edu.mit.csail.sdg.alloy4.OurSyntaxWidget; //導入方法依賴的package包/類
/** Updates the status bar at the bottom of the screen. */
private Runner notifyChange() {
if (wrap)
return wrapMe();
commands = null;
if (text == null)
return null; // If this was called prior to the "text" being fully
// initialized
OurSyntaxWidget t = text.get();
if (Util.onMac())
frame.getRootPane().putClientProperty("windowModified", Boolean.valueOf(t.modified()));
if (t.isFile())
frame.setTitle(t.getFilename());
else
frame.setTitle("Alloy Analyzer " + Version.version());
toolbar.setBorder(new OurBorder(false, false, text.count() <= 1, false));
int c = t.getCaret();
int y = t.getLineOfOffset(c) + 1;
int x = c - t.getLineStartOffset(y - 1) + 1;
status.setText("<html> Line " + y + ", Column " + x
+ (t.modified() ? " <b style=\"color:#B43333;\">[modified]</b></html>" : "</html>"));
return null;
}
示例2: notifyChange
import edu.mit.csail.sdg.alloy4.OurSyntaxWidget; //導入方法依賴的package包/類
/** Updates the status bar at the bottom of the screen. */
private Runner notifyChange() {
if (wrap) return wrapMe();
commands=null;
if (text==null) return null; // If this was called prior to the "text" being fully initialized
OurSyntaxWidget t = text.get();
if (Util.onMac()) frame.getRootPane().putClientProperty("windowModified", Boolean.valueOf(t.modified()));
if (t.isFile()) frame.setTitle(t.getFilename()); else frame.setTitle("Alloy Analyzer "+Version.version());
toolbar.setBorder(new OurBorder(false, false, text.count()<=1, false));
int c = t.getCaret();
int y = t.getLineOfOffset(c)+1;
int x = c - t.getLineStartOffset(y-1)+1;
status.setText("<html> Line "+y+", Column "+x
+(t.modified()?" <b style=\"color:#B43333;\">[modified]</b></html>":"</html>"));
return null;
}