かずきのBlog

C#やJavaやRubyとメモ書き

目次

Blog 利用状況

ニュース

わんくまBlogが不安定になったため、前に書いてたはてなダイアリーにメインを移動します。
かずきのBlog@Hatena
技術的なネタは、こちらにも、はてなへのリンクという形で掲載しますが、雑多ネタははてなダイアリーだけに掲載することが多いと思います。
コメント
プログラマ的自己紹介
お気に入りのツール/IDE
プロフィール
経歴
広告
アクセサリ

書庫

日記カテゴリ

[NetBeans][Java]エディタのフォーマットをやるには

NetBeansのモジュールからエディタの中をフォーマッティングするには下のように書く。

// targetComponentがJTextComponent
BaseDocument doc = (BaseDocument) targetComponent.getDocument();
Reformat reformat = Reformat.get(doc);
reformat.lock();
try {
    doc.atomicLock();
    try {
        // 位置の指定は文字数単位
        doc.getFormatter().reformat(
                doc, フォーマット対象開始位置, フォーマット対象終了位置);
    } finally {
        doc.atomicUnlock();
    }
} finally {
    reformat.unlock();
}

ReformatとかNetBeans5.5になかったから作ったモジュールをNetBeans6.1にうつした途端にエラーになってびっくりしたのでメモ

投稿日時 : 2008年6月3日 10:06

Feedback

# [NetBeans][Java]NetBeansのモジュール開発のエントリをまとめてみた 2009/04/16 7:20 かずきのBlog

[NetBeans][Java]NetBeansのモジュール開発のエントリをまとめてみた

# Women Moncler Jackets 2012/12/08 7:50 http://supermonclercoats.webs.com/

great issues altogether, you just received a logo new|a new} reader. What may you suggest in regards to your put up that you just made some days in the past? Any positive?

# longchamp outlet 2012/12/15 16:18 http://www.longchampbagoutlet.info/category/longch

i applaud you in your great content material and excellent topic selections.

# handbags burberry uk 2012/12/16 5:11 http://www.burberryuksale.co/burberry-uk-shawls-c-

Think it like a journal or even a magazine from general interest for those who to look over. Funny, witty, controversial, entertaining, useful, acerbic, thoughtful, serious, curious, unexpected comebacks happen to be welcome.

# sac pliage longchamp 2012/12/16 22:31 http://www.saclongchampachete.info/category/sac-lo

I do not know... there's a specific thing tacky with regards to owning Ferrari branded things like this.. unless you furthermore may own a total Ferrari.

# burberry sale 2012/12/17 8:42 http://www.burberryuksale.org/category/burberry-ou

I waiting to take a closer look at some of that memorabilia!

# isabel marant soldes 2012/12/17 19:18 http://www.isabelmarant-stores.com/category/isabel

I have never looked into Sennheisers together with am in search of new tote.

# トリーバーチ 靴 2012/12/17 21:57 http://www.torybruchjp.info/category/トリーバーチ

make them red with a yellow moose!!

# burberry london sale 2012/12/18 21:33 http://www.burberryoutlet2012.info/category/burber

Our admins enjoy a sharp eye and in many cases sharper sensibilities - and additionally our Ideal Comments neighborhood enjoys an incredible read. Come play around!

# burberry en ligne 2012/12/18 22:50 http://sacburberrysoldesfr.webnode.fr/actualites

These appear great.

# burberry uk 2012/12/21 8:33 http://burberryukoutlets.wordpress.com

Great article, it's practical information.

# http://www.destockchinefr.fr/maillot-de-club-pas-cher/serie-a-pas-cher/ 2013/01/13 4:58 http://www.destockchinefr.fr/maillot-de-club-pas-c

Absolutely love could be the busy dread for those life and also increase of that which we tend to absolutely adore.
http://www.destockchinefr.fr/maillot-de-club-pas-cher/serie-a-pas-cher/ http://www.destockchinefr.fr/maillot-de-club-pas-cher/serie-a-pas-cher/

# http://www.destockchinefr.fr/veste-marque-pas-cher/veste-ed-hardy-pas-cher/ 2013/01/13 4:58 http://www.destockchinefr.fr/veste-marque-pas-cher

Friendships keep working while every single colleague seems brand-new areas such as a small fineness across the other sorts of.
http://www.destockchinefr.fr/veste-marque-pas-cher/veste-ed-hardy-pas-cher/ http://www.destockchinefr.fr/veste-marque-pas-cher/veste-ed-hardy-pas-cher/

タイトル
名前
Url
コメント