??xml version="1.0" encoding="utf-8" standalone="yes"?>91精品国产欧美一区二区,欧美极度另类性三渗透,亚洲欧美日韩国产中文http://www.aygfsteel.com/conans/category/32530.html你越挣扎我就兴?/description>zh-cnWed, 25 Jun 2008 18:52:52 GMTWed, 25 Jun 2008 18:52:52 GMT60NetBeans6.5 M1 众多期待的特性一览表! http://www.aygfsteel.com/conans/articles/210665.htmlCONANCONANWed, 25 Jun 2008 12:14:00 GMThttp://www.aygfsteel.com/conans/articles/210665.html

NetBeans6.5 M1 众多期待的特性一览表!

Netbeans 6.5 M1 已经发布,最新版本的NetBeans 增强了许多功?同时也引入了许多值得期待的新Ҏ?
其中我比较喜Ƣ的是DataBase 的改q?Eclipse 目导入变得比以前更方便?可以正确的区分Web目
和普通项?q有Spring   Hibernate 增强. GUI 中新增了JDK1.6 u10 中的look&feel 只要你用的是 JDK1.6 u10
可以用这个外观预?数据l定功能也改q了!   全新的多U程Debug  功能支持!
 JavaScript  也加入的Debug功能,q加入了好几个Javascript ?像JQuery ,Yahoo ui dojo {等!
q新增了一?"驼峰拼写" 代码补全功能. 很有意?
JavaEE 的lib path 也变成了可变的了.此外q增加了快速搜索功? 更方便搜?   q有好多个特性呢!

q有PHP Groovy Ruby {都有增?
具体看下面的介绍! 英文太多了就不翻译了 大家自己看吧!

UNC paths on Windows

Now the NetBeans IDE supports UNC paths like ""computerName"sharedFolder" . It is possible to install the IDE to UNC like folder and also it is possible to create projects and other resources on UNC paths.

File Associations options panel and Open As... action

A new panel in options dialog which allows to say to NetBeans that files with certain extension should be treated as files with a certain MIME type (see #133773 ). You can add a new extension to the list of modify existing one. If you want to restore default setting for selected extension, you just click the Default button.

file-associations.png

In connection with the above change there was also added a new Open As... action. It is enabled only for files which are not recognized by the IDE. User can choose one from supplied MIME types and from now on all files with this extension are treated as of choosen MIME type.

open-as-action.png

Running some IDE distributions on JRE

Certain IDE distributions (e.g. PHP IDE) don't require Java JDK to run on, JRE is enough.

Plugin Manager now checks OpenIDE-Module-Package-Dependencies of all modules which user selects to be installed. If the user's IDE is running on JRE and the unsatified package dependency might indicate that JDK is required, user is warned about it and the plugin installation is not allowed.

missing-jdk-warning.png

QuickSearch

Quickly search for action or type is now easy. Use Ctrl-I.

qs.png

Variable based paths in J2SE/J2EE projects

Since NetBeans 6.1 it is possible to control whether JAR/Folder added to project classpath is referenced via absolute or relative path. Now it is also possible to define a global IDE named variable pointing to a folder and use this variable as a base for referring to JARs/Folders.

This feature further simplifies project sharing between users. In scenario where a project depends on JARs for which:

  • it is not desirable to store them in VCS; and which
  • can be placed in different locations for different users

a named IDE variable can be used.

The variables are managed via Tools -> Variable menu item:

Manage-Variables.png

In above screenshot single variable is defined with these details:

Edit-Variable.png

When variable based JAR/Folder is added to project classpath you can see its path starting with variable name (and tooltip showing absolute path):

Project-Properties.png

Variable based JAR/Fodler is added to classpath via standard means of "Add Jar/Folder" button in classpath customizer (or "Add JAR/Folder" action on project's Libraries node in project's view). Custom file chooser is shown with one new option "Use Variable Path":

Add-JAR-Folder.png

Just browse for your JAR/Folder and if selected file is under a variable the option gets enabled. Alternatively press "..." button and setup a new variable.

If a user opens project with a variable based path and the variable is not defined in user's IDE then standard broken reference warning is shown to advice user to define variable:

Broken-Reference.png

Eclipse project import and synchronization

The Eclipse project import feature facilitates mixed IDE development teams. It allows you to select Eclipse projects from an Eclipse workspace and generate NetBeans projects for them. The generated NetBeans project keeps a link to the original Eclipse project and will update itself after any relevant change: for example, changing the classpath of the Eclipse project. The update is done automatically when the NetBeans project is opened, or can be explicitly requested via a context menu item "Synch with Eclipse" on the project.

wizard1.png

This is early preview of the Eclipse import feature which will be fully implemented in Milestone 2. (It supersedes the limited Eclipse import feature available in former NetBeans releases on the update center.) We would appreciate feedback and real-life Eclipse projects for testing; best is to use Issuezilla. (component ide , subcomponent eclipse project import )

Enhanced Java Web Start support

Support for creating applets that can be deployed via Java Web Start was added to NetBeans IDE. Note: the functionality is available in JDK 1.6.0 update 10.

JWSProjProps.png

Each application or applet deployed via Java Web Start can specify external resources (usually other JNLP file in internet). Dialog is opened by clicking on 'External Resources' button.

JWSExtRes.png

Each applet can have number of properties defined in JNLP file, those properties can be defined in dialog that is opened by clicking 'Applet Parameters'. Also you can set applet dimensions in the dialog.

JWSAppletParams.png

Platform

Sliding windows support original window sizes

Slided-in windows can keep their preferred size instead of being stretched to the whole height/width of the IDE window.

(see #135318 ).

Possibility to configure some Window System properties for applications based on Platform

Some window system features can be turned off by branding of core.windows module.

winsys_customization.png

TreeTableView replacement introduced

OutlineView is a new replacement for buggy TreeTableView. It supports drag and drop, in-place editing of tree cells, enhanced sorting etc. The data model is fully compatible with TreeTableView.

(see #33281 ).

Opening Options dialog with preselected subcategories

API in options.api module has been changed to allow open Options dialog with preselected subcategory (see #109538 ). In your code you can call OptionsDisplayer.getDefault().open("CategoryID/SubcategoryID"); where CategoryID and SubcategoryID are registration names from layer. For selection a panel under Miscellaneous category use OptionsDisplayer.getDefault().open(OptionsDisplayer.ADVANCED+"/SubcategoryID"); .

Support allowing a user to drop a text into the palette

It is possible to drag and drop any text to the Palette window to create a new code snippet. It works for HTML editor palette only at the moment, more document types will follow soon.

PHP

Features first introduced in Early Access for PHP

The NetBeans IDE Early Access for PHP was released in April at the same time as NetBeans 6.1. Milestone 1 of NetBeans 6.5 now contains all features introduced in this release .

Next, in NB 6.5 M1, PHP features are a part of the "all-in-one" distribution of NetBeans, so they can be used together with all the other NetBeans features. Of course, there is still the slim PHP edition of NetBeans, targeted for PHP development specifically.

See below for more features added in NetBeans 6.5 Milestone 1, that were not present in Early Access. Also, to keep up with the new features added to NetBeans PHP support, make sure to check and bookmark the NetBeans PHP Team Blog .

Database-related code snippets

Generate code to connect to a MySQL database and to display the data in a database table. These snippets are available under the Generate Code action [Alt+Insert], just like in the Java editor.

php-database-table-snippet.png

Find Usages

Available also for PHP development. Right click the item and select "Find Usages" or hit Alt-F7.

php-find-usages.png

Multiple project configurations

  • running, debugging either as script or as web page in browser
  • index file, arguments ...

php-project-configs.png

Ajax

JavaScript Debugger

  • Supported browsers
    • Firefox 2.0.0.X
    • Requires Firebug 1.1beta. An automatic installation is attempted when not found.
  • Add & delete breakpoints in JavaScript code
    • Html Files
    • JavaScript Files
    • URL source resulting from server side technologies such as JSP
  • Manage debugger session
  • View & navigate source artifacts
    • Html Files
    • JavaScript files
    • URL source resulting from server side technologies such as JSP
  • View window/frame structure
  • View & navigate JavaScript Callstack
  • View local variables
  • Set & delete watches
  • View (static) browser DOM in the IDE
  • J2EE & Ruby Project integration
    • Debug Client Session: Run the project and launch a JavaScript debugging session in NetBeans, attached to the Firefox 2.0.0.X browser where the client-side application is running
    • Source Mapping: Correlate a client-side application (browser DOM) identified by a URI with the corresponding source file in the J2EE project (limited mapping in M1) Mapping for:
      • Html files
      • JavaScript files

User Guide

JavaScript Library Manager

  • Utilizes NetBeans Library Manager to manage JavaScript libraries
  • Wizard to add JS libraries to Java EE, Ruby, or PHP projects (Tools->Add JavaScript Libraries)

Bundled JavaScript Libraries

  • Yahoo UI
  • WoodStock
  • jQuery
  • dojo
  • scriptaculous
  • prototype

Java

Javadoc Analyzer

This plugin provides ability to check and fix Javadoc comments in your source code. Just select project/package/files and invoke "Source | Analyze Javadoc". Auto comment functionality is back.

javadoc.png

Call Hierarchy

Show all callers/callees in the search scope of the selected member.

ch.png

Formatting Settings per Project

You can specify formatting settings individually for each project

sttings.png

CamelCase code completion

Code completion improved. Just write first letters of each word in method to get smart code completion. For instance "iL" stands for invokeLater.

cc.png

Improved Encapsulate Fields Refactoring

Encapsulate Fields Refactoring Improved. New options available.

encapsulate.png

Option to remove whitespace at end of line

Top voted enhancement finally implemented

Groovy

Editor

  • placeholder

Java SE Project Integration

Database

Improved New Connection dialog

Now the dialog for creating a new database connection does not expect you to know the details of the JDBC URL to open a connection. If you want to modify the URL, however, you can do so, just click on the "Show JDBC URL" checkbox. Changes to the URL are reflected in the fields and vice versa.

conndialog.jpg

SQL history dialog

SQL that has been executed is saved to a file in the userdir and available for viewing in a dialog and also SQL can be selected and reinserted in an existing SQL file. sql_history_icon.png

sql_history.png

Server Support

GlassFish V3 integration module.

Is now part of the Web & Java EE and Ruby bundles. No need to get the modules from the update center.

Web frameworks (Spring, Hibernate, JSF, JSF CRUD Generator, JPA)

Spring

  • Improved Java class FQN completion

Code completion is now faster than the earlier version. For efficiency, Java class FQN completion is now a two step process. Most of the times, a user will need only classes defined locally in the project (source classpath). Hence the first CTRL+SPACE will list only the items in the source classpath, as shown below: cc_step1.png

If the user wishes to add an item not in the source classpath, he can press CTRL+SPACE again. Also, if the typed prefix does not match any local item, the completion will automatically switch to show all items instead of just local items. cc_step2.png

  • Go to Spring Bean dialog

A Go to Spring Bean dialog is similar to the Go to Type dialog and will allow the user to quickly navigate to a given Spring Bean definition by it's name. The user selects the main menu item Navigate | Go to Spring Bean... or the keyboard short cut Alt + Shift + B to invoke the Go to Spring Bean dialog. menu_goto.png

goto_dialog.png

  • Refactoring support for Java properties

When refactoring Java Bean property getters and setters, the corresponding usages in the Spring XML Configuration files are also modified. ren_ref_pre.png

Hibernate (Available via Development Update center for M1)

  • Reverse Engineering support. With an existing configuration, POJOs and mapping files can be generated using this feature. See Reverse Engineering for more details

ReverseEngg.png

.

  • HQL query execution support. Execute HQL queries right inside the IDE. Queries can include joins and clauses. See HQL Editor for more details

HQLQueryEditor.png .

  • Refactoring of hibernate mapping files is supported. See Refactoring for more details.

.

JSF, JSF CRUD Generator

The editor support for both JSF Configuration Files and JSF JSP Pages are both improved. The improved features include: Code Completion, Hyperlink, Refactoring, and Find Usage. More details can be found at Editor Support in JSF Configuration Files and JSP Files .

  • Code Completion: On top of the generic JSP editing features, the JSP editor for the JSF page file provides additional code completion for Managed Beans and Resource Bundles.
Example Code Completion UI
Managed Beans JsfEditorSupportCodeComplete1.gif

JsfEditorSupportCodeComplete2.gif
Resource Bundles JsfEditorSupportCodeComplete3.gif

JsfEditorSupportCodeComplete4.gif
  • Hyperlink: By using the Hyperlink inside the JSF configuration files and JSF JSP Pages, developers can fast navigate from one source to another reference.
JSF Configuration Files Example File opened
<managed-bean-class>foo.ManagedBean </managed-bean-class> the Java file ManagedBean.java under package foo
<to-view-id>/Page2.jsp </to-view-id> the JSF page file Page2.jsp under the context root
JSF JSP Pages Example File opened
<h3> <h:outputText  value =" #{ManagedBean .min}" /></h3> the JSF configuration file on position where the managed bean been defined
<h3> <h:outputText  value =" #{ManagedBean.min }" /></h3> the appropriate Java file on position where the getter for the property been defined
  • Refactoring Support: The refactoring support processes all files in the list of JSF configuration files. Bean and Java class/method usages are found in bean and alias elements and their subelements, as well as elements in the util namespace.
Example Refactoring UI
Managed Beans JsfEditorSupportRefactoring1.gif
Folder / Package JsfEditorSupportRefactoring2.gif
  • Find usages: The JSF support will plug into the Java find usages to show JSF beans definitions which refer to Java elements (classes, methods, fields, properties). The Find Usages action will be available for bean definitions as well, to show beans used by other beans.
Example Usages UI
Managed Beans JsfEditorSupportUsages.gif
  • The JSF CRUD Generator now applies default styles.

styled-jsfcrud.gif

JPA

In NetBean 6.5, the Entity Classes from Database wizard has one additional panel to allow the user to configure the following mapping options:

  • Association Fetch: can be default, eager or lazy. By default, it is default, meaning no fetch attribute will be added to the relationship annotations
  • Collection Type: The collection type used for OneToMany and ManyToMany CMR fields. Can be java.util.Collection, java.util.List or java.util.Set. By default, it is java.util.Collection.
  • Fully Qualified Database Table Names: if checked, catalog and schema attributes will be added on @Table. By default, it is not checked.
  • Attributes for Regenerating Database Tables: if checked, nullable (when it is false), length (for String type), precision and scale (for decimal type) will be added on @Column. Unique constraints will be added on @Table if checked. By default, it is not checked.

The panel is at the last step of the wizard. It is optional.

UML

NetBeans Development is migrating UML to the NetBeans Visual Library. The majority of the planned features are now implemented in the release trunk and the Development is focused on stabilizing the code for release. The new UML will be available in M2. Please see UML Current Projects for additional information.

Mobility

Databinding

Mobility Data binding provides a simple and consistent way for applications to present and interact with data in the Visual Designer. It utilizes the Databinding libraries available in Netbeans Mobility. New custom component DataSet which provides data for UI components.

Supported components in Milstone 1:

  • TextField ( Text, Label)
  • ImageItem (Image, Label)
  • DateField (Date, Label)
  • StringItem (Text, Label)
  • rest of the Items ( Label)

Databinding support in the custom property editors:

mobilitypropertyeditor.png

Generated code for empty DataSet:

mobilitydataset.png

Custom Component Support

Custom Component Support helps to create the Visual Mobile Designer Custom Components. It generates all of the necessary Custom Component infrastructure including: Module project Infrastructure, components descriptors and producers as well the layer.xml file.

New Project Custom Component wizard.

mobilityccp1.png

Generated project and classes with one component descriptor and one producer.

mobilityccp3.png

Add Mobile Custom Component wizard.

mobilityccp5.png

Full description of this feature i available here: Custom Components API Project Support - DRAFT

New SVG Support

Motivation is to extend group of existing SVG components to provide better support for creation of compelling UI on mobile platforms using SVG technology.

New components available in the SVG library:

  • SVGForm
  • Button
  • RadioButton
  • CheckBox
  • ComboBox
  • Label
  • List
  • Slider
  • Spinner
  • TextField

SVG Components in action:

widgets.gif

Debugger

New Multithreaded Debugging Support

This is a summary description for the new Multithreaded Debugging Support that is available in M1 NB 6.5. These bits have been done as a first phase of the overall NB debugger redesign effort, which goal is to significantly improve the debugging workflow and usability.

 

Debugging Window


In order to improve UI for multithreaded debugging and also willing to reduce the number of debugger views, a new (unifying) debugger view is introduced. This view (referred as Debugging View) integrates current Sessions, Threads and Call Stack views being displayed in the Explorer group by default.

From the technical perspective, the Debug view is organized as (in general) a list of sessions, having each session as a list of threads, each suspended thread than expandable to its call stack and more. Debug view is customizable via context options only showing typically needed info by default. With the 'Suspend Table' switched on, any thread can be resumed/suspended by one click on the dedicated button.

If there is the debugger counter displayed in the editor and another thread encounters a breakpoint, the current thread will not be automatically switched. Instead, a non-modal panel is displayed in the bottom of Debugging view informing that there are new breakpoint hits waiting; there is also a drop-down button switching the debugger to the next (or selected) breakpoint hit. Having this non-modal notification, users are allowed to finish their debugging of current thread (e.g. expression evaluation) and switch to next breakpoint hit when it fits to the workflow.

 

Current Thread Chooser


When doing a multithreaded debugging, it is often needed to quickly switch between particular threads; e.g. when doing a stepping sequence in two threads alternately. For such purpose we introduce a new action--Current Thread Chooser (CTRL+8). In fact, it is an analogy to application switching common in OS environment. With this feature, it is really straightforward to revisit any thread for debugging or switch to a particular thread for the first time.

 

'Other Thread(s) Suspended Here' Gutter Navigation


Anytime the debugger displays the thread icon in the editor gutter, the user is informed that there is/are one or more suspended non-current thread(s) at this line. The list of these threads can be seen in the icon tooltip, and it is also possible to switch debugging to any of these threads via the context menu. Strictly speeking, it is the Source->Threads navigation available in the editor gutter.

 

Deadlock Detection


The debugger automatically searches for deadlock among all suspended threads. When a deadlock is detected, a non-modal notification is displayed having emphasized involved threads. Detailed monitor info is also available displayed in dedicated monitor nodes.

 

New Threading Model

In order to improve multithreaded debugging, we decided to change the way how debugger manages debuggee threads. The main issue related to current model (NB 6.1 and older) is likely the fact that any step resumes all threads regardless there are threads intentionally suspended by the user or not. This can be limiting e.g. in case of debugging race conditions or deadlock issues. The natural solution to this problem is to resume only the current thread leaving other threads suspended if they are (may have happened via breakpoints or Suspend action). Obviously, this change needs the default breakpoint to suspend only the breakpoint thread, otherwise stepping could lead to so-called Deadlock Caused by Debugger.

Current Model Summary (NB 6.1 and older):

  • Default breakpoint suspends all threads.
  • Step resumes all threads when invoked and suspends all threads when completed regardless there are threads intentionally suspended or not.
  • Evaluation is done only resuming the current thread (by default), which may easily lead to 'deadlock caused by debugger' in current model.
  • 'Step interrupted by a breakpoint' issue exists with default breakpoint.

New Model Summary:

  • Default breakpoint only suspends breakpoint thread.
  • Step only resumes current thread when invoked and suspends current thread when completed.
  • Evaluation is done resuming the current thread (other threads unsuspended by default breakpoint or step). No deadlock caused by debugger might happen as far as no thread is explicitly suspended by the user (via suspend action or some breakpoint).
  • 'Step interrupted by a breakpoint' issue does not exist with default breakpoint. (Except the stepping thread itself encounters a breakpoint.)

GUI Builder

ButtonGroup visualization

When you select a ButtonGroup or some component in a ButtonGroup then the GUI builder shows you which components belong into this group.

buttonGroups.jpg

Preview in Nimbus look and feel

If you use JDK 6 Update 10 then you can preview your form in the new Nimbus look and feel. We have made this preview more reliable and accurate (within the limits of javax.swing.UIManager design). Besides the design preview you can also set the Nimbus look and feel for runtime - this is easily possible for Desktop Java Application projects in the Project Properties window (go to the Desktop App panel).

nimbusPreview.jpg

TreeModel editor

New TreeModel property editor allows you to prototype your JTree easily.

treeModelEditor.jpg

ListModel and ComboBoxModel usability enhancements

We rewrote property editors for ListModel and ComboBoxModel. It is much easier to use them by now.

listModelEditor.jpg comboBoxModelEditor.jpg

Web Services

RESTful services from database

A new wizard allows for the creation of RESTful, JSR311-based services directly from database tables. This facility is in addition to the wizard that creates services from JPA entities.

Consuming popular SaaS services in Php

Web Services nodes in the Services tab of Netbeans 6.5 support Drag-n-drop to Php files as shown below.

PhpSaaSClient.png

C/C++

Code completion accuracy

Code completion accuracy is much improved in milestone 1 compared to NetBeans 6.1. There are very few known cases where an incorrect choice is presented. So the known "inaccuracy rate" is nearly 0. There are known situations where valid choices are not presented to the user. For a range of mid to large scale applications those cases (where valid choices are not shown) is under 5%. Work to further improve accuracy is ongoing.

Call Graph

Show all callers/callees of the selected function.

Direct call graph:

direct_callgraph.png

Reverse call graph:

reverse_callgraph.png

Error highlighting and more types of semantic highlighting

C/C++ editors highlights basic errors. Semantic highlighting for typedefs, class fields and function names was added.

hl-ss.png

Ruby

  • Rake
    • Rake Runner (http://wiki.netbeans.org/RubyRake)
    • infrastructure overhaul
      • internal unification brings more smooth workflow to users
  • Debugger
    • support for conditional (expression) breakpoints
    • support for breakpoint on exception (catchpoint)
    • switched to the new engines versions
  • Projects
    • useful pre-generated Rakefile (clean, gem, packages, rdoc, spec, test, .... tasks)
    • possibility to pass JVM options to the JRuby (e.g. -Djruby.objectspace.enabled=true)
  • Platform
    • Rubinius Support
    • sudo support - 'gksu' so far (issue 128575)
    • Options for tweaking Gems fetching in Gem Manager (-a, -d)
  • Rails
    • updated the bundled Rails to 2.1.0
    • support for running the Rails console in different environments
    • possibility to specify the version of Rails for new projects (in case there are more than one version installed)
    • support for 'destroy' in the Rails generator
  • Test Runner
    • New Test Runner UI for displaying test results


CONAN 2008-06-25 20:14 发表评论
]]>
在NetBeans5.0中用xdoclet生成hibernate?.hbm.xml文ghttp://www.aygfsteel.com/conans/articles/210393.htmlCONANCONANTue, 24 Jun 2008 13:02:00 GMThttp://www.aygfsteel.com/conans/articles/210393.html
敬告Q?br /> ------------------------------------------------------------
    本文作者希望本文可以在|络及Q何媒体进行Q何Ş式的传播、复
制、引用、修改,在此q程中请保留此敬告内宏V?br />
                                 谢谢Q?br />                                                     popo
------------------------------------------------------------

NetBeans是基于ANTq行目的build和run的,所以我们可以方便的加入自己的target对原有项目进行扩展?br /> 启动NetBeansQ打开以前写的SimpleWebSite_dao目Q因为我们要做的是利用XDoclet生成Hibernate?.hbm.xml(ORM)文gQ所以将XDoclet的所有Jar包解压到lib\xdoclet-1.3-SNAPSHOT目录下,不用在项目中引用XDoclet的包Q因为我们是要通过修改Build文g来引用这些包?br /> 选择“Files”H口Q展开SimpleWebSite_dao目?br /> 打开build.xml文gQ看该文件中的注释,大概是讲NetBeans为我们生成的build文g是nbproject/build-impl.xmlQbuild.xml已经import了build-impl文gQ如果我们想加入自己的target或者对原有targetq行修改Q只要改动build文g可以?br /> 用NetBeans~辑XML文g很方便,可以对XML文gq行查和校验Qƈ且还有代码提C及补齐的功能:Q。导航窗口更是ؓ我们查看XML内容l构提供了极大的方便?br /> 在build.xml中加入以下内容:

    <property name="lib.dir" location="../lib" />
    <property name="xdoclet.dir" location="../lib/xdoclet-1.3-SNAPSHOT" />

    <path id="xdoclet.classpath">
        <fileset dir="${lib.dir}" includes="*.jar"/>
        <fileset dir="${xdoclet.dir}" includes="*.jar"/>
    </path>
    <!-- =================================================================== -->
    <!-- The "hibernatedoclet" target generates Hibernate mapping files      -->
    <!-- based on XDoclet marked-up Plain Old Java Object (POJO)             -->
    <!-- =================================================================== -->
    <target name="hibernatedoclet" depends="compile" unless="hibernatedoclet.unnecessary"
        description="Generate Hibernate mapping files">

        <taskdef name="hibernatedoclet"
        classname="xdoclet.modules.hibernate.HibernateDocletTask"
        classpathref="xdoclet.classpath"/>
       
        <!-- generate hibernate files -->
        <hibernatedoclet destdir="${build.classes.dir}"  mergedir="${build.classes.dir}"
            excludedtags="@version,@author" addedtags="@xdoclet-generated at ${TODAY}"
            force="${xdoclet.force}">
            <fileset dir="src"/>
            <hibernate validatexml="true" version="3.0"/>
        </hibernatedoclet>
    </target>

用右键点build.xml文gQ在“Run target”中,会看到我们新加的target->“hibernatedoclet”?br /> 现在写一个POJOQ用q个target生成.hbm.xml文g?br /> New 一个Java Class  CustomerQ这个类的代码是从网上拷贝来的,因ؓ我对XDocletq不太熟悉)Q?br /> package hibernate;
import java.util.Set;
import java.util.Collections;
/**
 * @author roson
 * @since 1.0
 * @version 1.0
 * @hibernate.class tables="customers"
 */
public class Customer {
    /**This customer's identifier field.
     */
    private long id;
   
    /**This customer's name field.
     */
    private String name;
   
    /**The customer's orders set.
     */
    private Set orders=Collections.EMPTY_SET;
   
    /**The default construtor for Hibernate to instantiate with.
     */
    public Customer() {}
   
    /**The getter method for this Customer's identifier.
     *
     * @hibernate.id generator-class="native"
     */
    public long getId() {
        return id;
    }
   
    /**The setter method for this Customer's identifier.
     */
    public void setId(long id) {
        this.id=id;
    }
   
    /**The getter method for this Customer's name.
     *
     * @hibernate.property
     */
    public String getName() {
        return name;
    }
   
    /**The setter method for this Customer's name.
     */
    public void setName(String name) {
        this.name=name;
    }
   
    /**The getter method for this Customer's orders.
     *
     * @hibernate.set role="orders"
     *
     * @hibernate.collection-key column="customer_id"
     *
     * @hibernate.collection-one-to-many class="Order"
     */
    public Set getOrders() {
        return orders;
    }
   
    /**The setter method for this Customer's orders.
     */
    public void setOrders(Set orders) {
        this.orders=orders;
    }
}

现在右键点build.xml文gQ在“Run target”中,?#8220;hibernatedoclet”QBUILD SUCCESSFUL?br /> 在build\classes\hibernate目录下会看到~译后的Customer.class文g和XDoclet生成的Customer.hbm.xml?br />
Z方便Q我们进一步修改build.xml文gQ将build-impl.xml中的“jar”q个target复制_脓q来Qƈ改ؓ以下内容Q?br />     <target name="jar" depends="init,hibernatedoclet,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR."/>
我只把depends中的compile改ؓ了hibernatedocletQ这样在~译后和打包前的时候,会生?.hbm.xml文g?br />
现在的build.xml文g内容如下Q?br /> <?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<project name="SimpleWebSite_Dao" default="default" basedir=".">
    <description>Builds, tests, and runs the project SimpleWebSite_Dao.</description>
    <import file="nbproject/build-impl.xml"/>
    <property name="lib.dir" location="../lib" />
    <property name="xdoclet.dir" location="../lib/xdoclet-1.3-SNAPSHOT" />

    <path id="xdoclet.classpath">
        <fileset dir="${lib.dir}" includes="*.jar"/>
        <fileset dir="${xdoclet.dir}" includes="*.jar"/>
    </path>
    <!--

    There exist several targets which are by default empty and which can be
    used for execution of your tasks. These targets are usually executed
    before and after some main targets. They are:

    -pre-init:                 called before initialization of project properties
    -post-init:                called after initialization of project properties
    -pre-compile:              called before javac compilation
    -post-compile:             called after javac compilation
    -pre-compile-single:       called before javac compilation of single file
    -post-compile-single:      called after javac compilation of single file
    -pre-compile-test:         called before javac compilation of JUnit tests
    -post-compile-test:        called after javac compilation of JUnit tests
    -pre-compile-test-single:  called before javac compilation of single JUnit test
    -post-compile-test-single: called after javac compilation of single JUunit test
    -pre-jar:                  called before JAR building
    -post-jar:                 called after JAR building
    -post-clean:               called after cleaning build products

    (Targets beginning with '-' are not intended to be called on their own.)

    Example of inserting an obfuscator after compilation could look like this:

    <target name="-post-compile">
    <obfuscate>
    <fileset dir="${build.classes.dir}"/>
    </obfuscate>
    </target>

    For list of available properties check the imported
    nbproject/build-impl.xml file.


    Another way to customize the build is by overriding existing main targets.
    The targets of interest are:

    -init-macrodef-javac:     defines macro for javac compilation
    -init-macrodef-junit:     defines macro for junit execution
    -init-macrodef-debug:     defines macro for class debugging
    -init-macrodef-java:      defines macro for class execution
    -do-jar-with-manifest:    JAR building (if you are using a manifest)
    -do-jar-without-manifest: JAR building (if you are not using a manifest)
    run:                      execution of project
    -javadoc-build:           Javadoc generation
    test-report:              JUnit report generation

    An example of overriding the target for project execution could look like this:

    <target name="run" depends="SimpleWebSite_Dao-impl.jar">
    <exec dir="bin" executable="launcher.exe">
    <arg file="${dist.jar}"/>
    </exec>
    </target>

    Notice that the overridden target depends on the jar target and not only on
    the compile target as the regular run target does. Again, for a list of available
    properties which you can use, check the target you are overriding in the
    nbproject/build-impl.xml file.

    -->
    <!-- =================================================================== -->
    <!-- The "hibernatedoclet" target generates Hibernate mapping files      -->
    <!-- based on XDoclet marked-up Plain Old Java Object (POJO)             -->
    <!-- =================================================================== -->
    <target name="hibernatedoclet" depends="compile" unless="hibernatedoclet.unnecessary"
        description="Generate Hibernate mapping files">

        <taskdef name="hibernatedoclet"
        classname="xdoclet.modules.hibernate.HibernateDocletTask"
        classpathref="xdoclet.classpath"/>
       
        <!-- generate hibernate files -->
        <hibernatedoclet destdir="${build.classes.dir}"  mergedir="${build.classes.dir}"
            excludedtags="@version,@author" addedtags="@xdoclet-generated at ${TODAY}"
            force="${xdoclet.force}">
            <fileset dir="src"/>
            <hibernate validatexml="true" version="3.0"/>
        </hibernatedoclet>
    </target>
    <target name="jar" depends="init,hibernatedoclet,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR."/>
   
</project>

在ProjectsH口Q?#8220;Build Project”或?#8220;Clean and Build Project”Q?br /> 会看到用C我们修改后的jarq个targetq行的编译和打包?br /> XDoclet的功能很强大Q我会边学边在我的项目中利用它,可以省去很多~码工作?br />
看Appfuse的build.xmlQ数据库的表是用Hibernate提供的SchemaExportTask工具生成数据库徏表的SQLQ我们也来照做,q样只要在写POJO时加上注释,用ANT的target可以生?.hbm.xml文g和创建数据表的SQL语句。方便吧Q?br /> 对build.xmlq行修改Q把生成*.hbm.xml文g的目标\径改为SRC目录Q不再depends="compile"Q改为在jar的时候先“hibernatedoclet”?#8220;compile”Q增加create_tables_sql的targetQ修改后的build.xml文g为:
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<project name="SimpleWebSite_Dao" default="default" basedir=".">
    <description>Builds, tests, and runs the project SimpleWebSite_Dao.</description>
    <import file="nbproject/build-impl.xml"/>
    <property name="src.dir" location="./src" />
    <property name="lib.dir" location="../lib" />
    <property name="xdoclet.dir" location="../lib/xdoclet-1.3-SNAPSHOT" />

    <path id="xdoclet.classpath">
        <fileset dir="${lib.dir}" includes="*.jar"/>
        <fileset dir="${xdoclet.dir}" includes="*.jar"/>
    </path>
    <!--

    There exist several targets which are by default empty and which can be
    used for execution of your tasks. These targets are usually executed
    before and after some main targets. They are:

    -pre-init:                 called before initialization of project properties
    -post-init:                called after initialization of project properties
    -pre-compile:              called before javac compilation
    -post-compile:             called after javac compilation
    -pre-compile-single:       called before javac compilation of single file
    -post-compile-single:      called after javac compilation of single file
    -pre-compile-test:         called before javac compilation of JUnit tests
    -post-compile-test:        called after javac compilation of JUnit tests
    -pre-compile-test-single:  called before javac compilation of single JUnit test
    -post-compile-test-single: called after javac compilation of single JUunit test
    -pre-jar:                  called before JAR building
    -post-jar:                 called after JAR building
    -post-clean:               called after cleaning build products

    (Targets beginning with '-' are not intended to be called on their own.)

    Example of inserting an obfuscator after compilation could look like this:

    <target name="-post-compile">
    <obfuscate>
    <fileset dir="${build.classes.dir}"/>
    </obfuscate>
    </target>

    For list of available properties check the imported
    nbproject/build-impl.xml file.


    Another way to customize the build is by overriding existing main targets.
    The targets of interest are:

    -init-macrodef-javac:     defines macro for javac compilation
    -init-macrodef-junit:     defines macro for junit execution
    -init-macrodef-debug:     defines macro for class debugging
    -init-macrodef-java:      defines macro for class execution
    -do-jar-with-manifest:    JAR building (if you are using a manifest)
    -do-jar-without-manifest: JAR building (if you are not using a manifest)
    run:                      execution of project
    -javadoc-build:           Javadoc generation
    test-report:              JUnit report generation

    An example of overriding the target for project execution could look like this:

    <target name="run" depends="SimpleWebSite_Dao-impl.jar">
    <exec dir="bin" executable="launcher.exe">
    <arg file="${dist.jar}"/>
    </exec>
    </target>

    Notice that the overridden target depends on the jar target and not only on
    the compile target as the regular run target does. Again, for a list of available
    properties which you can use, check the target you are overriding in the
    nbproject/build-impl.xml file.

    -->
    <!-- =================================================================== -->
    <!-- The "hibernatedoclet" target generates Hibernate mapping files      -->
    <!-- based on XDoclet marked-up Plain Old Java Object (POJO)             -->
    <!-- =================================================================== -->
    <target name="hibernatedoclet" unless="hibernatedoclet.unnecessary"
        description="Generate Hibernate mapping files">

        <taskdef name="hibernatedoclet"
        classname="xdoclet.modules.hibernate.HibernateDocletTask"
        classpathref="xdoclet.classpath"/>
       
        <!-- generate hibernate files -->
        <hibernatedoclet destdir="${src.dir}"  mergedir="${src.dir}"
            excludedtags="@version,@author" addedtags="@xdoclet-generated at ${TODAY}"
            force="${xdoclet.force}">
            <fileset dir="${src.dir}"/>
            <hibernate validatexml="true" version="3.0"/>
        </hibernatedoclet>
    </target>
   
    <!-- =================================================================== -->
    <!-- The "create_tables_sql" target generates the database schema and    -->
    <!-- creates tables based on the mapping files                           -->
    <!-- =================================================================== -->
    <target name="create_tables_sql" depends="hibernatedoclet" description="creates database tables">
        <taskdef name="schemaexport"
        classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
        classpathref="xdoclet.classpath"/>
       
        <schemaexport quiet="yes" text="true" drop="no" delimiter=";"
            properties="src/database.properties" output="../database/sql/create-tables.sql">
            <fileset dir="${src.dir}" includes="**/*.hbm.xml"/>
        </schemaexport>
    </target>
    <target name="jar" depends="init,create_tables_sql,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR."/>
   
</project>

q样Q每?#8220;Build Project”或?#8220;Clean and Build Project”Ӟ都会先在源程序目录创?.hbm.xml文gQ再?./database/sql目录下生成创建数据表的SQL文gQ再q行~译Q打包?br />
用上面的CZ文g有几个问?br /> 1.CustomercM * @hibernate.class tables="customers"应该?* @hibernate.class table="customers"Q?br /> 2.生成的Customer.hbm.xml文g“create_tables_sql”时失败,提示信息为:
D:\ProjectNetBeans\SimpleWebSite\SimpleWebSite_Dao\build.xml:107: Schema text failed: Could not read mapping document from file: D:\ProjectNetBeans\SimpleWebSite\SimpleWebSite_Dao\src\hibernate\Customer.hbm.xml
BUILD FAILED (total time: 4 seconds)
为字D加上数据类型(type="java.lang.Long"Q后可以d文gQ但q是p|Q?br /> D:\ProjectNetBeans\SimpleWebSite\SimpleWebSite_Dao\build.xml:107: Schema text failed: Association references unmapped class: Order
因ؓ对XDoclet不熟Q对Hibernate的配|也快忘记差不多了,所以省点事儿,先把Order属性去掉?br />
“Clean and Build Project”Q哈哈,看看Q?.hbm.xml文g和徏数据库表的Sql语句都生成啦?br /> 不过q没有试qDebug{targetQ如果那些target依赖生成?.hbm.xml文g的话Q还要对相应的target加上depends...

剩下的就是要多看看XDoclet和Hibernate配置的文档啦?

CONAN 2008-06-24 21:02 发表评论
]]>
NetBeans的优化配|Ⅱhttp://www.aygfsteel.com/conans/articles/210178.htmlCONANCONANMon, 23 Jun 2008 14:39:00 GMThttp://www.aygfsteel.com/conans/articles/210178.htmlNetBeans 6.0 Beta1出来也有几天了,它徏议的内存大小?1G。稍加调整后Q就能其启动速度有明显提高?br />
一、模?br /> 用没有使用的模块:Tools》Plugins》Installed
选择不用的模块,Deactivate?br />
二?span class="hilite2">配置
~辑文gQ?br /> $NB_HOME/etc/netbeans.conf

修改 netbeans_default_options选项Q?br /> netbeans_default_options="xxxxxxxxxxxxxxx"
其中Q修改(-J-Xms的数g内存而定Q下面是512MB的例子)
-J-Xms64m -J-XX:PermSize=32m -J-XX:MaxPermSize=192m

再在末尾双引号前加入Q注意行首有个空|
-J-DuseGtk=true -J-Xverify:none -J-Djava.net.preferIPv4Stack=true

其中“-J-DuseGtk=true”是ؓ了界面用GTK风格Q这P字体已不?span class="hilite2">配置了。当然前提是用JDK6。而Fedora不用加这一,p动用GTK了,q是因ؓNetbeans的支持列表中没有ubuntulooks主题引擎

q是在版?.0beta2上的优化。经我实验,大大提高了NetBeans的启动速度.

1Q修改英文netbeans界面字体大小Q修?Netbeans_home%\etc\netbeans.conf
在netbeans_default_options里加?--fontsize 12

2Q修改JVM内存配置Q本机内?GQ不同内存大不同设|)
在netbeans_default_options里加?-J-Xmx512mQ同时修?J-Xms256m?br /> 【说明?J-Xms32m
此设|用于通知 Java 虚拟机将其初始堆大小讄?32 MB。通过通知 JVM 它最初应该ؓ堆分配多内存,我们可以防止它随着 IDE 使用更多的内存而将堆增大?
【说明?J-Xmx128m
此设|用于指?Java 虚拟机应该用于堆的最大内存。对此数D|硬性上限意味着 Java q程不能使用比可用的物理 RAM 更多的内存。对于具有更多内存的pȝ可以提升此限?- 128 MB 讄有助于确?IDE ?256MB 的系l上可靠地执行操作。注意:不要此D|ؓ接近或大于系l中的物?RAM 敎ͼ否则在主要回收过E中导致频J的交换I间操作?/p>

3Q在netbeans_default_options里修?-J-XX:PermSize=20m
q是一个较Ҏ?JVM 开养I但它也羃短了启动旉。此讄用于调整内存?#8220;怹区域”Q在q里保存c)的大。由于我们知道所?IDE cd占用特定数量的内存,因此我们?JVM 提示它将需要的内存数量。此讄消除了许多系l上启动q程中的主要垃圾回收事g。SunONE Studio 或包括更多模块的其他 IDE 的用户可能希望将此数D|得更高些?/p>

4Q在netbeans_default_options里加?J-Xverify:none
此开关用于关?Java 字节码验证,从而加快类加蝲Q以及消除在启动q程中仅为验证目的而加载类的需要。此开兛_显著~短启动旉?/p>

5Q在Tools-Plugins-installed里面把不需要的模块L
我这里去掉了 GlashfishQJSFQCVSQSubversion{。速度得到很大提高了。当然如果你的开发需要这些模块就不需要去掉了?/p>

6Q修改编辑器配置
把所有的Javadoc自动弹出H口LQ把所有自动完成g时设|ؓ0Q把所有自动完成大写敏感L?br /> 注:在netbeans6的JAVA代码~辑器设|里面默认没有设|代码自动完成的延时讄了。可以自己手动加入到配置文gC:\Documents and Settings\%USER_NAME%\.netbeans\6.0beta2\config\Editors\text\x-java下的properties.xmlQ加?br /> <property class="java.lang.Integer" name="completion-auto-popup-delay" value="1"/>
【说明?preperties.xml文g默认不存在,只有在你修改了编辑器配置以后才会出现q个文g

环境讄
q一步是在NetBeans IDE内部讄。在 工具--选项--高选项Q?br /> ?~辑器设|?中将 文本qx   LQ个Z喜欢q个QL觉选上后有些字母边~怪怪的Q?br /> ?~辑器设|?-java~辑器设|?中将 自动完成弹出H口延时 讄?,选中自动弹出javadocH口
?JAVA源代?中将 错误标注限制 ?自动解析延迟 讄?,另外 ~省~码 默认是GBK 可以Ҏ UTF-8.以便在移植源代码到非GBK~码q_的时候中文注释能正确昄?br /> ?IDE配置--框架 ??个gq时间都改ؓ 1

字体讄
默认情况下的NetBeans的字体真的很隄,可以非注解的字体与字符串类型的全部讄为Courier New 14号字体,注释与字W串cd的字体设|ؓ宋体 13受设|完后是不是觉得很漂亮(不要打开 文本qx 功能Q?/p>

CONAN 2008-06-23 22:39 发表评论
]]>
NetBeans的优化配|?/title><link>http://www.aygfsteel.com/conans/articles/210176.html</link><dc:creator>CONAN</dc:creator><author>CONAN</author><pubDate>Mon, 23 Jun 2008 14:37:00 GMT</pubDate><guid>http://www.aygfsteel.com/conans/articles/210176.html</guid><description><![CDATA[<p style="text-indent: 2em">Eclipse用户L在NetBeans炫耀Eclipse是多么的漂亮Q尤其会说NetBeans的字体丑陋,NetBeans的字体太,~辑器里的字体不好看Q字体边楞有锯ɽ{等。坦白的_q也是我刚从Eclipse转到NetBeans的第一印象。其实由于NetBeans使用Swing构徏界面Q这使得它缺省的使用Swing的缺省配|,其是中文,更不敢恭维。其实NetBeans提供了强大的配置工具Q完全可以将NetBeans配置的很漂亮。下面我׃Windows上的NetBeans安装ZQ说说如何配|字体?/p> <p style="text-indent: 2em">          1.NetBeans界面上的普通字体大,可以通过配置NetBeans安装目录下netbeans.conf启动文g来实玎ͼq个文g?lt;NetBeans>/etc目录下。缺省的NetBeans在用Swing的缺省字体,大小?1Q稍E嫌,如果要改?2Q可以将文g中的下面一行:</p> <p style="text-indent: 2em">netbeans_default_options="-J-Xms32m -J-Xmx256m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true"</p> <p style="text-indent: 2em">          Ҏ</p> <p style="text-indent: 2em">netbeans_default_options="-J-Xms32m -J-Xmx256m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true --fontsize 12"</p> <p style="text-indent: 2em">          另外Q也可以通过讄Swing的一个控制字体的pȝ属性swing.useSystemFontSetting来实玎ͼ</p> <p style="text-indent: 2em">netbeans_default_options="-J-Dswing.useSystemFontSettings=false -J-Xms32m -J-Xmx256m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true"</p> <p style="text-indent: 2em">          2.~辑器的字体可以通过选项讄来实玎ͼ具体是Tools->Options->Fonts & ColorsQ这儿可以设|包含字体、前后背景等讄。刚转到NetBeansӞ我就按照Eclipse和VS2003刚设|了一套设|,讄好了之后的NetBeans特别漂亮Q一炚w不输lEclipse?/p> <p style="text-indent: 2em">          3.字体锯问题Q解册个问题,首先你要使用Java6。Java6支持LCD和反走样(anti-alias)字体Q安装Java6后,修改etc/netbeans.conf让NetBeans使用Java6。需要注意的是在Windows下需要明打开操作pȝ的字体边~^滑设|后Q才起作用。设|方法是Q右键点L面,选择外观->效果->使用下列方式使字体的边缘qx->清晰Q然后启动NetBeans可以了?/p> <p style="text-indent: 2em">          另外Q我个h觉得NetBeans~省的工h按钮太大Q如果你和我有同h觉,可以右键点击工具栏,从下拉菜单中选择Small Toolbar Icons?/p> <p style="text-indent: 2em">你将~省字体改ؓDialogInput 12可以了?/p> <p style="text-indent: 2em">NetBeans使用心得二:内存和垃圾收集机刉|?/p> <p style="text-indent: 2em">        NetBeans的缺省的内存配置偏低Q只?28MQ实际上Eclipse的缺省配|ؓ256MQ对于NetBeansq样拥有如此之多的功能,却才使用128M是不太合适的。曾l在别h的博客上看到Q最佳的内存配置应该为物理内存的1/3Q如果小于这个|NetBeans难以发挥全效,如果大于q个值就会造成操作pȝ内存抖动。就NetBeans5.5来说Q官方网站上规定的最内存是512MQ推荐内?GQ这一点和其他Java IDE一P比如Eclipse官方规定的最内存居然是1G。这让我不得不叹息我们的电脑实在太落后了。我安的工作机?56MQ后来买?12MM去,d?68MQ因此按?/3原则Q我把NetBeans讄?56M。如何设|这个值呢Q同前文一栯讄启动文g <NetBeans>/etc/netbeans.confQ打开启动文gQ将netbeans_default_options一行中?J-Xmx选项讄?56M可以了Q如下:</p> <p style="text-indent: 2em">netbeans_default_options=="-J-Xms32m -J-Xmx256m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true"</p> <p style="text-indent: 2em">         使用NetBeans的缺省配|,在长旉的运行后Q往往会突焉僵住了,没有响应Q这是因为JVM~省的垃圾收集机制不使用增量式ƈ行收集,而是隔断旉后,{内存垃圄累到一定程度,完全锁定甚至暂停虚拟机,q行垃圾攉。可以将q种垃圾攉机制Ҏ增量式ƈ行收集,避免q种僉|。同h改动netbeans_default_optionsQ在行后加上Q?/p> <p style="text-indent: 2em">netbeans_default_options=="-J-Xms32m -J-Xmx256m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled"</p> <p style="text-indent: 2em">         ȝ来说Q如果你懒得惌些,采用下面的配|比较不错:</p> <p style="text-indent: 2em">netbeans_default_options="-J-Xms32m -J-Xmx256m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled --fontsize 12"</p> <p style="text-indent: 2em">netbeans_default_options=="-J-Xms32m -J-Xmx256m0.....</p> <p style="text-indent: 2em">J-Xms32m {于J-Xmx256mӞq行比较畅</p> <p style="text-indent: 2em">NetBeans使用心得三:保存配置和改变JDK</p> <p style="text-indent: 2em">          NetBeans升太快Q经帔R要下载新的版本安装,但一重新安装原来的辛辛苦苦的配置好了的东襉K没有了。另外需要用不同的JDKQ但是重新卸载和安装netbeans又比较麻烦。如何解册个问题?</p> <p style="text-indent: 2em">          原来netbeans用L配置攑֜用户目录下的.netbeans目录中,在Windows下,用户目录是:</p> <p style="text-indent: 2em">C:\Documents and Settings\<UserName></p> <p style="text-indent: 2em">          该目录备䆾保存Q可以避免重新配|的ȝQ安装新的NetBeans之后Q将.netbeans中对应版本的配置拯到目标版本的目录就可以了。比如我保存了NetBeans5.0的配|,现在安装?.5Q可以将原来.netbeans/5.0目录下的内容Q覆?netbeans/5.5下的内容Q你原来配置的内容包含当前workspace的状态就都{U过M?/p> <p style="text-indent: 2em"></p> <p style="text-indent: 2em">NetBeans使用心得四:Javaq_、NetBeansq_、类库配|管?/p> <p style="text-indent: 2em">         NetBeans目通常来说要针Ҏ个Java版本QNetBeans插g开发需要以来某个NetBeansq_Q这些项目如果要使用W三方类库,都需要引用这些类库。NetBeans中提供了所谓Javaq行时^台、NetBeansq_以及cd的配|管理。下面介l一下如何配|和理q些q_及类库:</p> <p style="text-indent: 2em">1.Javaq_理QTools->Java Platform ManagerQ缺省的有一个JDK的^収ͼ如果需要添加其他版本的JDKQ可以选择按钮Add Platform...Qƈ在右边的Classes, Sources和Javadoc选择需要添加的cR再选择Add Platformq个按钮ӞNetBeans会询问你JDK根目录,当找到ƈ且选中q个目录QNetBeans会自动将Classes,Sources和Javadoc内容填好。一般如果有Sources了,可以不必选JavadocQNetBeans会根据Sources自动生成Javadoc以便引用。Classes是用来编译和q行以及代码辅助使用的,Sources可以用于调试E序时跟t代码,而Javadoc会被NetBeansd索引到帮助系l?Help->Javadoc references)Q以及代码辅助中昄帮助。可以肯定的说这样配|要比Eclipse方便的多?/p> <p style="text-indent: 2em">2.和Javaq_理怼QNetBeansq_配置大体遵@上面步骤Q选择Tools->NetBeans Platform ManagerQ然后的q程和Javaq_配置一栗?/p> <p style="text-indent: 2em">3.和Javaq_和NetBeansq_配置cMQ选择Tools->Library Manager配置cd?/p> <p style="text-indent: 2em">配置好的Javaq行时^収ͼNetBeansq_以及cdQ可以通过右键选择目的属性,在Library一栏,选择Javaq_、NetBeansq_以及d和删除第三方cd。或者展开目树,在Libraries节点右键点击Q选择New Library或者New Module Dependency?/p> <p style="text-indent: 2em">NetBeans使用心得五:热键配置、模块管理及其他配置</p> <p style="text-indent: 2em">         刚从其他IDE转到NetBeans后,有个不顺手的地方是热键差别较大Q非常常用的主要是代码辅助,在Eclipse是Ctrl+/Q而这儿用的是Ctrl+SpaceQ很不幸的是大部分汉字输入法已经占用了这个热键。幸q的是NetBeans提供了修改热键的配置面板Tools->Options->Keymap。另外最新版本的NetBeans5.5q提供了Eclipse和Emacs的热键映,q对于从eclipse和Emacs转过来的人来说无疑是天大的好消息Q你不用在适应新的热键Q只要在q儿选择Eclipse或者Emacs可以了?/p> <p style="text-indent: 2em">          另外你也可以d新的热键Q比如,我就d了一个用于关闭工E的热键Q热键配|中Q选择File->Close ProjectQ然后选择Add...按钮Q选择Ctrl+Shift+BackspaceQ你定义关闭工E的热键为Ctrl+Shift+Backspace?/p> <p style="text-indent: 2em">NetBeans的模块管理负责各U插件的更新、下载、安装、卸载等。工具位于Tools->Module Manager和Update CenterQ这儿你可以很简单根据向导的提示更新、下载、安装以及卸载各U插件?/p> <p style="text-indent: 2em">          其他常见配置都能在Tools->Options扑ֈQ包括:</p> <p style="text-indent: 2em">1.General->View Java Packages as List/TreeQ让你选择树或者列表的方式l织cd?/p> <p style="text-indent: 2em">2.General->Web Browser配置~省的浏览器?/p> <p style="text-indent: 2em">3.General->Proxy配置Web代理Q主要用于更新管理器?/p> <p style="text-indent: 2em">4.General->Auto Update配置自动更新的方式以及频率?/p> <p style="text-indent: 2em">5.General->Editor->General->Code Folding配置代码折叠选项?/p> <p style="text-indent: 2em">6.General->Code Completion配置辅助代码选项Q是否自动弹出、自动插入单独选项、大写敏感、是否显C弃用代码?/p> <p style="text-indent: 2em">7.General->Indention配置代码~进选项?/p> <p style="text-indent: 2em">8.General->Code Templates->定义各种快捷模式的模?/p> <p style="text-indent: 2em">9.General->Macros配置宏变量?/p> <p style="text-indent: 2em">          另外一些杂可以在Miscellaneous和Advanced选项扑ֈ。常见的抱怨是辅助代码Z弹出那么慢,错误U正Z出现那么慢,q且被认为是NetBeans慢的表现Q实际这些都是可以配|的Qƈ不是NetBeans造成的,q些配置~省的gq时间太长,l用户造成NetBeans速度很慢地错觉。这些设|在Q?/p> <p style="text-indent: 2em">Tools->Options->Advanced Options->Editing->Editor Settings->Java Editor->Delay of Completion Window Auto Popup</p> <p style="text-indent: 2em">Tools->Options->Advanced Options->Editing->Java Sources->Automatic Parsing Delay</p> <p style="text-indent: 2em">           最后,如果你发现有些不想你预料的NetBeans行ؓQ千万不要马上抱怨NetBeans不能q个Q不能那个,很可能这又是一个不W合你以前习惯的地方Q在配置面板找一找,也许p扑ֈ你要的行为配|?/p> <p style="text-indent: 2em">netbeans也有一个类似的快捷键:Ctrl + \</p> <p style="text-indent: 2em">可以使用 IDE-HOME/etc/netbeans.conf</p> <p style="text-indent: 2em">下表定义了可用于 IDE 的开兟?/p> <p style="text-indent: 2em">--helpQ或 -hQ?/p> <p style="text-indent: 2em">打印常用启动参数的描q?/p> <p style="text-indent: 2em">--jdkhome jdk-home-dir</p> <p style="text-indent: 2em">使用指定?JavaTM 2 JDK 版本Q而不是缺省的 JDK。在 Microsoft Windows pȝ上,IDE 启动E序在缺省情况下会查找注册表Q用最新的可用 JDK?/p> <p style="text-indent: 2em">在升U?IDE 使用?JDK 之前Q应该备份用L录。如果以后需要恢复到先前?JDKQ可以切换到已备份的用户目录Q从而确保不丢失M讄?/p> <p style="text-indent: 2em">要切?IDE 的用L录,请?-userdir 开养I下面对其进行详l介l?/p> <p style="text-indent: 2em">--cp:p additional-classpath</p> <p style="text-indent: 2em">指定类路径|于 IDE 的类路径之前?/p> <p style="text-indent: 2em">--cp:a additional-classpath</p> <p style="text-indent: 2em">指定类路径附加?IDE 的类路径上?/p> <p style="text-indent: 2em">--open file</p> <p style="text-indent: 2em">在源代码~辑器中打开文g?/p> <p style="text-indent: 2em">--open file:line number</p> <p style="text-indent: 2em">在源代码~辑器中打开文gQƈ光标置于指定行上?/p> <p style="text-indent: 2em">--laf UI-class-name</p> <p style="text-indent: 2em">选择l定的类作ؓ IDE 的外观。以下是两个外观cȝCZQ?/p> <p style="text-indent: 2em">com.sun.java.swing.plaf.motif.MotifLookAndFeel</p> <p style="text-indent: 2em">javax.swing.plaf.metal.MetalLookAndFeel</p> <p style="text-indent: 2em">--fontsize size</p> <p style="text-indent: 2em">讄 IDE 用户界面中的字体大小Q以表C。如果未使用此选项Q则字体大小?11 ?/p> <p style="text-indent: 2em">--locale language[:country[:variant]]</p> <p style="text-indent: 2em">ȀzL定的语言环境?/p> <p style="text-indent: 2em">--userdir userdir</p> <p style="text-indent: 2em">明确指定用户目录Q该目录是存储用戯|的位置?/p> <p style="text-indent: 2em">如果?UNIX&reg; 环境中未使用此选项Q则~省情况下在 HOME 目录中设|用L录。如果在 Microsoft Windows pȝ上未讄此选项Q则用户目录是第一ơ启?IDE 时指定的目录?/p> <p style="text-indent: 2em">可以?#8220;关于”对话框中定当前用户目录。选择“帮助”>“关于”。然后单?#8220;详细信息”标签Qƈ查看“用户目录”字段?/p> <p style="text-indent: 2em">-J jvm-flags</p> <p style="text-indent: 2em">指定标记直接传递给 JVM 软g?/p> <p style="text-indent: 2em">-J-Dsun.java2d.noddraw=true</p> <p style="text-indent: 2em">防止使用 DirectX q行呈现。此开兛_能会防止在某些带有不合格囑Ş卡的 Microsoft Windows pȝ上出现问题?/p> <p style="text-indent: 2em">-J-Dorg.netbeans.spi.java.project.support.ui.packageView.USE_TREE_VIEW=true</p> <p style="text-indent: 2em">以基于目录的视图Q而不是基于包的视图)昄“目”H口中的包?/p> <p style="text-indent: 2em"></p> <hr /> <p> </p> <p style="text-indent: 2em">URL https://substance-netbeans.dev.java.net/files/documents/4104/35292/org-jvnet-substance-netbeans.nbm</p> <p style="text-indent: 2em">下蝲之后</p> <p style="text-indent: 2em">工具-〉更C?〉手动下载安装的模块-〉添?〉加入你刚下载文?〉下一步知道结?/p> <p style="text-indent: 2em">安装完毕之后单击视图菜单里面会多出几个子菜单Q然后自己去看吧</p> <hr /> <p> </p> <p style="text-indent: 2em">如果我要设成java默认的风D怎么栯Q?/p> <p style="text-indent: 2em">能不能说清楚一?/p> <hr /> <p> </p> <p style="text-indent: 2em">扑ֈ文g nb安装目录/etc/netbeans.conf</p> <p style="text-indent: 2em">-laf UI-class-name</p> <p style="text-indent: 2em">选择l定的类作ؓ IDE 的外观。以下是两个外观cȝCZQ?/p> <p style="text-indent: 2em">com.sun.java.swing.plaf.motif.MotifLookAndFeel</p> <p style="text-indent: 2em">javax.swing.plaf.metal.MetalLookAndFeel</p> <p style="text-indent: 2em">默认的是windowspȝ风格不用讄</p> <p style="text-indent: 2em">javax.swing.plaf.metal.MetalLookAndFeelq个市金属的风格Q是swing的风?/p> <p style="text-indent: 2em">看看那一D,已经很清楚了</p> <p style="text-indent: 2em"></p> <hr /> <p>   原来一个再eclipse 下的web目因ؓl常出兼定w?打算转到Netbeans下,目~码使用utfQ?Q再|上找了些资料,l于搞定了netbeans的编码设|:</p> <p> </p> <p style="text-indent: 2em">  </p> <p style="text-indent: 2em">  1》打开目的属性,讄~译参数Q?-encoding utf-8</p> <p style="text-indent: 2em">  </p> <p style="text-indent: 2em">   Project Properties -> Build -> Compiling Sources -> Additional Compiler Options -> "-encoding utf-8"</p> <p style="text-indent: 2em">  </p> <p style="text-indent: 2em">  2》设|项目源文g的编码是 utf-8</p> <p style="text-indent: 2em">  </p> <p style="text-indent: 2em">   Select files, Window -> Properties -> Text -> Encoding -> "UTF-8".</p> <p style="text-indent: 2em">  </p> <p style="text-indent: 2em">  3》设|?选项Q-》高U?-->java源文件设为utf-8</p> <p style="text-indent: 2em">  </p> <p style="text-indent: 2em">   Tools -> Options -> Options -> Editing -> Java Sources -> Export -> Default Encoding -> UTF-8.</p> <p style="text-indent: 2em">  </p> <p style="text-indent: 2em">  搞定!</p> <p style="text-indent: 2em"></p> <p style="text-indent: 2em">JDK6在Swing桌面E序上的改进很大(不说大家也知?)</p> <p style="text-indent: 2em">但默认配|下的NetBeans仍然 q是很慢?/p> <p style="text-indent: 2em">下面讲讲我对NetBeans的配|看?/p> <p style="text-indent: 2em">W一 调优JVM</p> <p style="text-indent: 2em">    针对JVM的调优其实是最关键的一?配置netbeans-5.5\etc\目录下的netbeans.conf文g,netbeans_default_options替换如下</p> <p style="text-indent: 2em">netbeans_default_options="-J-Xverify:none -J-Xms128m   -J-Xmx128m     -J-XX:CompileThreshold=10000   -J-XX:ReservedCodeCacheSize=100m   -J-XX:PermSize=120m    -J-XX:+UseConcMarkSweepGC -J-XX:+UseParNewGC     -J-XX:+UseFastAccessorMethods -J-XX:+UseThreadPriorities   -J-XX:+AggressiveOpts     -J-Dapple.laf.useScreenMenuBar=true     --fontsize 14 "</p> <p style="text-indent: 2em">好长哦o(∩_∩)o...随便讲讲含义?/p> <p style="text-indent: 2em">-J-XX:CompileThreshold=10000   Q将10000个方法编译成本地代码Q不利用JITQ?/p> <p style="text-indent: 2em">-J-XX:ReservedCodeCacheSize=100m Q设|缓存大?/p> <p style="text-indent: 2em">-J-XX:+UseFastAccessorMethods   Q将所有getter / setter 转换成本C?/p> <p style="text-indent: 2em">W二 环境讄</p> <p style="text-indent: 2em">   q一步是在NetBeans IDE内部讄。在 工具--选项--高选项Q?/p> <p style="text-indent: 2em">   ?~辑器设|?中将 文本qx    LQ个Z喜欢q个QL觉选上后有些字母边~怪怪的Q?/p> <p style="text-indent: 2em">   ?~辑器设|?-java~辑器设|?中将 自动完成弹出H口延时 讄?,选中自动弹出javadocH口</p> <p style="text-indent: 2em">   ?JAVA源代?中将 错误标注限制 ?自动解析延迟 讄?,另外 ~省~码 默认是GBK 可以Ҏ UTF-8.以便在移植源代码到非GBK~码q_的时候中文注释能正确昄?/p> <p style="text-indent: 2em">   ?IDE配置--框架 ??个gq时间都改ؓ 1</p> <p style="text-indent: 2em">W三 字体讄</p> <p style="text-indent: 2em">默认情况下的NetBeans的字体真的很隄,可以非注解的字体与字符串类型的全部讄为Courier New 14号字体,注释与字W串cd的字体设|ؓ宋体 13受设|完后是不是觉得很漂亮(不要打开 文本qx 功能Q?/p> <img src ="http://www.aygfsteel.com/conans/aggbug/210176.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/conans/" target="_blank">CONAN</a> 2008-06-23 22:37 <a href="http://www.aygfsteel.com/conans/articles/210176.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank">ʮ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank">˳</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ԫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ǡ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ϫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ij</a>| <a href="http://" target="_blank">ض</a>| <a href="http://" target="_blank">º</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">¦</a>| <a href="http://" target="_blank">«ɽ</a>| <a href="http://" target="_blank">Ϊ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʡ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank">Ӣɳ</a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʹ</a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>