如何在eclipse 3.4中使用uml2插件(转)

http://xay0.blog.163.com/blog/static/439253382008101985637586/

Getting Started with UML2

Summary

This article describes how to get started with the UML2 plug-ins for Eclipse. In particular, it gives an overview of how to create models (and their contents) both programmatically and by using the sample UML editor.

By Kenn  Hussey, IBM
July 18, 2006     (Updated: July 11, 2008 for Eclipse 3.4; James Bruck )


Prerequisites

To start using UML2 (and to follow along with the example in this article), you must have Eclipse 3.4 EMF 2.4 , and UML2 2.2  installed. 

You can either download the zips individually and expand them out or follow the steps below:  

1)   Download and run Eclipse 3.4

2)   Select the Help  > Software Updates …  menu

3)   Select the Available Software  tab and expand the Ganymede/Model and Model Development  tree item.

4)   Select UML2 End-User Features  and UML2 Extender SDK .  The version should indicate 2.2.0 (or later).

5)   Click Install… .

At this stage, UML2 2.2 and all dependencies should be installed.

 

Introduction

This article will walk you through the basics of creating models using UML2. Using a simple model (the ExtendedPO2 model, shamelessly “borrowed” from the EMF “bible” [1]) as an example, we’ll look at what’s involved in creating some of the more common elements that make up a model. For each type of element, we’ll first explain the creation process using the sample UML editor and then explore how to accomplish the same thing using Java code. The ExtendedPO2 model is shown below.

Getting Started

Before getting started, you’ll need to create a simple project in your workspace. This project will serve as the container for the model that we’ll create using the UML editor. To create a simple project for this article, follow these steps:

1) Select the Window > Open Perspective > Other …  menu item.

2) Select the Resource  perspective and press the OK  button.

3) Select the File > New > Project...  menu item.

4) Select the Project  wizard from the General  category and press the Next >  button.

5) Enter a project name (i.e. “Getting Started with UML2”) and press the Finish  button.

At this point your workspace should look something like this:

OK, that should be enough to get us going with the UML editor. Now, to follow along with the programmatic approach to creating models, we’ll assume that you’ve created a class (named, say, “GettingStartedWithUML2”) in which you can write some code to construct our sample model. The code snippets we’ll show assume you’ve defined the following utility methods to give the user information on the program’s status:



  public
static boolean
DEBUG = true;
 
     protected
static void out(String output) {
 
            if
(DEBUG) {


                 System.out.println

(
output);
            }
     }
 
     protected
static void err(String error) {


         System.err.println

(
error);
     }

A static debug flag   can be used to enable or disable verbose information printed to the system’s output stream  . Errors will always be printed to the system’s error stream  .

All righty  then! In each of the following subsections, we’ll look at how to create a different kind of UML element, starting with models.

Creating Models

At the root of a typical UML model is a model element. It contains a (hierarchical) set of elements that together describe the physical system being modeled. To create a model using the UML editor, follow these steps:

1) Select a project (i.e. Getting Started with UML2 ) in the Project Explorer  view and select the File > New > Other ...  menu item.

2) Select the UML Model  wizard from the Example EMF Model Creation Wizards  category and press the Next >  button.

3) Enter a file name (i.e. “ExtendedPO2.uml”) and press the Next >  button.

4) Select Model  for the model object and press the Finish  button.

5) Select the Window > Show View > Properties  menu item.

6) Select  the <Model>  element in the UML editor.

7) Enter a value (i.e. “epo2”) for the Name  property in the Properties  view.

At this point your workspace should look something like this:

Let’s look at how to perform the same task using Java code. The code snippet below shows a method that programmatically creates and returns a model with a specified name.

     protected
static Model createModel
(String name) {


         Model model
= UMLFactory.eINSTANCE.createModel

(
);


         model.setName

(
name);
 


         out(
"Model '" + model.getQualifiedName
() + "' created.");
 


         return
model;
     }

First, we ask the UML factory singleton   to create a model, and we set its name  . Then, we output information   to the user to let them know that the model has been successfully created. Finally, we return   the model. You’ll notice most, if not all, of the code snippets in this article will follow this pattern – create the element (and set some properties on it), inform the user, and return it.

 All named elements (a model is a type of named element) have a “simple” name and a qualified name. The qualified name is the “simple” name prefixed with the “simple” names of all of the  named element’s containing namespaces. Note that the qualified name of a named element is only defined if all of its containing namespaces have non-empty “simple” names.

OK, let’s see this method in action. For example, we could create a model named ‘epo2’ as follows:

            Model epo2Model = createModel

(
"epo2");

Creating Packages

A package is a namespace for its members (packageable  elements ), and may contain other packages. A package can import either individual members of other packages, or all of the members of other packages. To create a package using the UML editor, follow these steps:

1) Select a package (e.g. <Package> foo ) in the UML editor.

2) Right-click and select the New Child > Packaged Element Package  option from the context menu.

3) Enter a value (e.g. “bar”) for the Name  property in the Properties  view.

We don’t actually need to create a package because our sample model doesn’t contain any… except of course for the root package (i.e. the model). That’s right – a model is a type of package.

Let’s look at how to perform the same task using Java code. The code snippet below shows a method that programmatically creates and returns a package with a specified name in a specified nesting package.

     protected
static org.eclipse.uml2.uml.Package createPackage
(
                    org.eclipse.uml2.uml.Package
nestingPackage
, String name) {


         org.eclipse.uml2.uml.Package package_ = nestingPackage
                    .createNestedPackage

(
name);
 
            out(
"Package '" + package_.getQualifiedName
() + "' created.");
 
            return
package_;
     }

Here, instead of asking the factory to create the package for us, we’re making use of one of the factory methods   in the UML2 API.

 In UML2, a factory method exists for every feature that can contain other elements (i.e. every containment feature). In addition, more convenient factory methods exist for commonly created types (like packages). In this case, the package has a feature (packagedElement ) that can contain packageable  elements, so we could obtain the Ecore  class of the type of (packageable ) element we want to create (i.e.Package ) from the UML Ecore  package singleton, and pass it to the createPackagedElement ( String, EClass )  factory method. Instead, we use the more convenient createNestedPackage ( String) factory method which implicitly creates a package and accepts the desired package name as an argument. Behind the scenes, the package will create a nested package, set its name, and add the package to its list of packaged elements.

OK, let’s see this method in action. For example, we could create a package named ‘bar’ in nesting package ‘foo ’ as follows:

            org.eclipse.uml2.uml.Package
barPackage
= createPackage
(fooPackage
, "bar");

Creating Primitive Types

A primitive type defines a predefined data type, without any relevant substructure. Primitive types used in UML? itself include BooleanIntegerUnlimitedNatural , and String . To create a primitive type using the UML editor, follow these steps:

1) Select a package (i.e. <Model> epo2 ) in the UML editor.

2) Right-click and select the New Child > Packaged Element > Primitive Type  option from the context menu.

3) Enter a value (i.e. “int ”) for the Name  property in the Properties  view.

 Create the remaining primitive types from the ExtendedPO2 model using the UML editor.

At this point your workspace should look something like this:

Let’s look at how to perform the same task using Java code. The code snippet below shows a method that programmatically creates and returns a primitive type with a specified name in a specified package.

     protected
static PrimitiveType
createPrimitiveType
(
                    org.eclipse.uml2.uml.Package package_, String name) {


         PrimitiveType
primitiveType
= (PrimitiveType
) package_
                    .createOwnedPrimitiveType

(
name);
 
            out(
"Primitive type '" + primitiveType.getQualifiedName
()
                    + "' created.");
 
            return
primitiveType
;
     }

Here we call the createOwnedPrimitiveType ( String)  convenience factory method   to ask the package to create a primitive type with the specified name as one of its packaged elements.

OK, let’s see this method in action. For example, we could create a primitive type named ‘int ’ in model ‘epo2’ as follows:

            PrimitiveType
intPrimitiveType
= createPrimitiveType

(
epo2Model, "int
");

 Write code to programmatically create the remaining primitive types from the ExtendedPO2 model.

Creating Enumerations

An enumeration is a kind of data type whose instances may be any of a number of user-defined enumeration literals. To create an enumeration using the UML editor, follow these steps:

1) Select a package (i.e. <Model> epo2 ) in the UML editor.

2) Right-click and select the New Child > Packaged Element > Enumeration  option from the context menu.

3) Enter a value (i.e. “OrderStatus ”) for the Name  property in the Properties  view.

At this point your workspace should look something like this:

Let’s look at how to perform the same task using Java code. The code snippet below shows a method that programmatically creates and returns an enumeration with a specified name in a specified package.

     protected
static Enumeration createEnumeration
(
                    org.eclipse.uml2.uml.Package package_, String name) {


         Enumeration enumeration
= (Enumeration) package_
                    .createOwnedEnumeraton

(
name);
 
            out(
"Enumeration '" + enumeration.getQualifiedName
() + "' created.");
 
            return
enumeration;
     }

Here we call the createOwnedEnumeration ( String)  convenience factory method   to ask the package to create a primitive type with the specified name as one of its packaged elements.

OK, let’s see this method in action. For example, we could create an enumeration named ‘OrderStatus ’ in model ‘epo2’ as follows:

            Enumeration orderStatusEnumeration
= createEnumeration

(
epo2Model,
                    "OrderStatus
");

Creating Enumeration Literals

An enumeration literal is a user-defined data value for an enumeration. To create an enumeration literal using the UML editor, follow these steps:

1) Select an enumeration (i.e. <Enumeration> OrderStatus ) in the UML editor.

2) Right-click and select the New Child > Owned Literal > Enumeration Literal  option from the context menu.

3) Enter a value (i.e. “Pending”) for the Name  property in the Properties  view.

 Create the remaining enumeration literals from the ExtendedPO2 model using the UML editor.

At this point your workspace should look something like this:

Let’s look at how to perform the same task using Java code. The code snippet below shows a method that programmatically creates and returns an enumeration literal with a specified name in a specified enumeration.

     protected
static EnumerationLiteral
createEnumerationLiteral
(
                    Enumeration enumeration
, String name) {


         EnumerationLiteral
enumerationLiteral
= enumeration
                    .createOwnedLiteral

(
name);
 
            out(
"Enumeration literal '" + enumerationLiteral.getQualifiedName
()
                    + "' created.");
 
            return
enumerationLiteral
;
     }

Here we call a createOwnedLiteral ( String)  convenience factory method   to ask the enumeration to create an enumeration literal with the specified name as one of its owned literals.

OK, let’s see this method in action. For example, we could create an enumeration literal named ‘Pending’ in enumeration ‘OrderStatus ’ as follows:

            createEnumerationLiteral

(
orderStatusEnumeration
, "Pending");

 Write code to programmatically create the remaining enumeration literals from the ExtendedPO2 model.

Creating Classes

A class is a kind of classifier whose features are attributes (some of which may represent the navigable ends of associations) and operations. To create a class using the UML editor, follow these steps:

1) Select a package (i.e. <Model> epo2 ) in the UML editor.

2) Right-click and select the New Child > Packaged Element > Class  option from the context menu.

3) Enter a value (i.e. “Supplier”) for the Name  property in the Properties  view.

 Create the remaining classes from the ExtendedPO2 model using the UML editor.

At this point your workspace should look something like this:

Let’s look at how to perform the same task using Java code. The code snippet below shows a method that programmatically creates and returns a( n) (abstract) class with a specified name in a specified package.

     protected
static org.eclipse.uml2.uml.Class createClass
(
                    org.eclipse.uml2.uml.Package package_, String name, boolean

isAbstract
) {


         org.eclipse.uml2.uml.Class class_ = package_.createOwnedClass

(
name,
                    isAbstract

);
 
            out(
"Class '" + class_.getQualifiedName
() + "' created.");
 
            return
class_;
     }

Here we call the createOwnedClass ( String, boolean )  convenience factory method   to ask the package to create a class with the specified name as one of its packaged elements, and set theisAbstract  attribute of the class based on the specified boolean  argument.

 You may have noticed that we have been fully qualifying references to the Package  and Class  interfaces. This is recommended so that these types are not confused with java.lang.Class  andjava.lang.Package , which are imported implicitly in Java.

OK, let’s see this method in action. For example, we could create a non-abstract class named ‘Supplier’ in model ‘epo2’ as follows:

            org.eclipse.uml2.uml.Class
supplierClass
= createClass
(epo2Model,
                    "Supplier", false);

 Write code to programmatically create the remaining classes from the ExtendedPO2 model.

Creating Generalizations

A generalization is a taxonomic relationship between a specific classifier and a more general classifier whereby each instance of the specific classifier is also an indirect instance of, and inherits the features of, the general classifier. To create a generalization using the UML editor, follow these steps:

1) Select a classifier (i.e. <Class> USAddress ) in the UML editor.

2) Right-click and select the New Child > Generalization > Generalization  option from the context menu.

3) Select a value (i.e. epo2::Address ) for the General  property in the Properties  view.

 Create the remaining generalizations from the ExtendedPO2 model using the UML editor.

At this point your workspace should look something like this:

Let’s look at how to perform the same task using Java code. The code snippet below shows a method that programmatically creates and returns a generalization between specified specific and general classifiers.

     protected
static Generalization createGeneralization
(
                    Classifier specificClassifier
, Classifier generalClassifier
) {
            Generalization generalization
= specificClassifier


                 .createGeneralization

(
generalClassifier
);
 
            out(
"Generalization " + specificClassifier.getQualifiedName
() + " ->> "
                    + generalClassifier.getQualifiedName

(
) + " created.");
 
            return
generalization;
     }

Here we call a convenience factory method on the specific classifier that creates a generalization   as one of its children and sets the general classifier to the specified argument.

OK, let’s see this method in action. For example, we could create a generalization between specific class ‘USAddress ’ and general class ‘Address’ as follows:

            createGeneralization

(
usAddressClass
, addressClass
);

 Write code to programmatically create the remaining generalizations from the ExtendedPO2 model.

Creating Attributes

When a property is owned by a classifier it represents an attribute; in this case is relates an instance of the classifier to a value or set of values of the type of the attribute.

 The types of Classifier  that can own attributes in UML2 include ArtifactDataTypeInterfaceSignal , and StructuredClassifier  (and their subtypes).

To create an attribute using the UML editor, follow these steps:

1) Select a classifier (i.e. <Class> Address ) in the UML editor.

2) Right-click and select the New Child > Owned Attribute > Property  option from the context menu.

3) Enter a value (i.e. "name”) for the Name  property in the Properties  view.

4) Select a value (i.e. epo2::String ) for the Type  property in the Properties  view.

5) Enter a value (i.e. 0) for the Lower  property in the Properties  view.

 Lower and upper values for multiplicity elements (like properties) are represented as value specifications (first-class objects) in UML? 2.x. The default value for lower and upper bounds is 1, unless a child value specification exists, in which case its value is used. Specifying a value for the lower or upper property will create a child value specification if none exists, or update its value if one does. Note that, to be treated as a bound, the lower value must be an integer and the upper value must be an unlimited natural.

 Create the remaining attributes from the ExtendedPO2 model using the UML editor.

At this point your workspace should look something like this:

Let’s look at how to perform the same task using Java code. The code snippet below shows a method that programmatically creates and returns an attribute with a specified upper bound, lower bound, type, and name in a specified class.

     protected
static Property createAttribute
(org.eclipse.uml2.uml.Class class_,
                    String name, Type type
, int
lowerBound
, int
upperBound
) {


         Property attribute = class_.createOwnedAttribute

(
name, type,
                    lowerBound

, upperBound
);
 
            StringBuffer
sb
= new StringBuffer

(
);
 
            sb.append

(
"Attribute '");
 
            sb.append

(
attribute.getQualifiedName
());
 
            sb.append

(
"' : ");
 
            sb.append

(
type.getQualifiedName
());
 
            sb.append

(
" [");
            sb.append

(
lowerBound
);
            sb.append

(
"..");
            sb.append

(
LiteralUnlimitedNatural.UNLIMITED
== upperBound
                    ? "*"
                    : String.valueOf

(
upperBound
));
            sb.append

(
"]");
 
            sb.append

(
" created.");
 
            out(
sb.toString
());
 
            return
attribute;
     }

Here we call a createOwnedAttribute (String, Type, int , int )  convenience factory method   to ask the class to create a property as one of its owned attributes, set the type of the attribute to the specified type, and set the lower and upper bounds of the attribute (the factory method indirectly creates a literal integer and literal unlimited natural, respectively, and sets their values to the specified integer values).

 The LiteralUnlimitedNatural.UNLIMITED  constant represents the unlimited value for upper bounds (-1), as it does in EMF; when setting this value in the Properties  view, an asterisk (‘*’) can alternatively be specified.

OK, let’s see this method in action. For example, we could create an attribute with multiplicity 0..1  of type ‘String’ named ‘name’ in class ‘Supplier’ as follows:

            createAttribute

(
supplierClass
, "name", stringPrimitiveType
, 0, 1);

 Write code to programmatically create the remaining attributes from the ExtendedPO2 model.

Creating Associations

An association specifies a semantic relationship that can occur between two or more typed instances; its ends are represented by properties, each of which is connected to the type of the end. When a property is owned by an association it represents a non-navigable end of the association, in which case the type of the property is the type of the association end.

 The notion of association end navigability was separated from that of ownership in the UML? 2.0 specification , so a property that is owned by an association isn’t necessarily non-navigable as of UML2 2.0.

To create an association using the UML editor, follow these steps:

1) Select a package (i.e. <Model> epo2 ) in the UML editor.

2) Right-click and select the New Child > Packaged Element > Association  option from the context menu.

3) Enter a value (e.g. “A_orders_supplier ”) for the Name  property in the Properties  view.

4) Select  the association (i.e. <Association> A_orders_supplier ) in the UML editor.

5) Right-click and select the New Child > Owned End > Property  option from the context menu.

6) Select a value (i.e. epo2::Supplier ) for the Type  property in the Properties  view.

7) Select  a class (i.e. <Class> Supplier ) in the UML editor.

8) Right-click and select the New Child > Owned Attribute > Property  option from the context menu.

9) Select a value (i.e. Composite ) for the Aggregation  property in the Properties  view.

10) Select a value (i.e. epo2::A_orders_supplier ) for the Association  property in the Properties  view.

11) Enter a value (i.e. "orders") for the Name  property in the Properties  view.

12) Select a value (i.e. epo2::PurchaseOrder ) for the Type  property in the Properties  view.

13) Enter a value (i.e. 0) for the Lower  property in the Properties  view.

14) Enter a value (i.e. *) for the Upper  property in the Properties  view.

 Create the remaining associations from the ExtendedPO2 model using the UML editor.

At this point your workspace should look something like this:

Let’s look at how to perform the same task using Java code. The code snippet below shows a method that programmatically creates and returns an association between two specified types, with ends that have the specified upper bounds, lower bounds, role names, aggregation kinds, and navigabilities .

     protected
static Association createAssociation
(Type type1,
                    boolean

end1IsNavigable, AggregationKind
end1Aggregation,
                    String end1Name, int
end1LowerBound, int
end1UpperBound,
                    Type type2, boolean

end2IsNavigable,
                    AggregationKind
end2Aggregation, String end2Name,
                    int

end2LowerBound, int
end2UpperBound) {
 


         Association association
= type1.createAssociation(
end1IsNavigable,
                    end1Aggregation, end1Name, end1LowerBound, end1UpperBound, type2,
                    end2IsNavigable, end2Aggregation, end2Name, end2LowerBound,
                    end2UpperBound);
 
            StringBuffer
sb
= new StringBuffer

(
);
 
            sb.append

(
"Association ");
 
            if
(null == end1Name || 0 == end1Name.length()) {
                    sb.append

(
'{');
                    sb.append

(
type1.getQualifiedName());
                    sb.append

(
'}');
            } else {
                    sb.append

(
"'");
                    sb.append

(
type1.getQualifiedName());
                    sb.append

(
NamedElement.SEPARATOR
);
                    sb.append

(
end1Name);
                    sb.append

(
"'");
            }
 
            sb.append

(
" [");
            sb.append

(
end1LowerBound);
            sb.append

(
"..");
            sb.append

(
LiteralUnlimitedNatural.UNLIMITED
== end1UpperBound
                    ? "*"
                    : String.valueOf

(
end1UpperBound));
            sb.append

(
"] ");
 
            sb.append

(
end2IsNavigable
                    ? '<'
                    : '-');
            sb.append

(
'-');
            sb.append

(
end1IsNavigable
                    ? '>'
                    : '-');
            sb.append

(
' '
);
 
            if
(null == end2Name || 0 == end2Name.length()) {
                    sb.append

(
'{');
                    sb.append

(
type2.getQualifiedName());
                    sb.append

(
'}');
            } else {
                    sb.append

(
"'");
                    sb.append

(
type2.getQualifiedName());
                    sb.append

(
NamedElement.SEPARATOR
);
                    sb.append

(
end2Name);
                    sb.append

(
"'");
            }
 
            sb.append

(
" [");
            sb.append

(
end2LowerBound);
            sb.append

(
"..");
            sb.append

(
LiteralUnlimitedNatural.UNLIMITED
== end2UpperBound
                    ? "*"
                    : String.valueOf

(
end2UpperBound));
            sb.append

(
"]");
 
            sb.append

(
" created.");
 
            out(
sb.toString
());
 
            return
association;
     }

Here we call a convenience factory method on the first end type that creates an association (and its ends) between it and another type   as one of its siblings (i.e. as a child of its package namespace) and with the specified upper bounds, lower bounds, role names, aggregation kinds, and navigabilities . The owners of the association ends (properties) are based on the specified navigabilities  – navigable ends are owned by the end type if allowed, otherwise they are owned by the association; non-navigable ends are owned by the association.

 The NamedElement.SEPARATOR  constant represents the standard separator (:: ) used in qualified names.

OK, let’s see this method in action. For example, we could create a unidirectional composition (composite association) between classes ‘Supplier’ and ‘PurchaseOrder ’ in model ‘epo2’ as follows:

            createAssociation

(
supplierClass
, true,
                    AggregationKind.COMPOSITE_LITERAL
, "orders", 0,
                    LiteralUnlimitedNatural.UNLIMITED
, purchaseOrderClass
,
                    false, AggregationKind.NONE_LITERAL
, "", 1, 1);

 Write code to programmatically create the remaining associations from the ExtendedPO2 model.

Saving Models

Now that we’ve spent all this time creating a model, we’d better save our work. When we created our model using the UML model wizard, a UML resource was created for us, so now all that needs to be done is to serialize the contents of our model as XMI to our file on disk (i.e. ExtendedPO2.uml ). To save a model using the UML editor, follow these steps:

1) Select the File > Save  menu item.

It’s that simple. Programmatically, we have a bit more work to do because so far, we’ve been creating our model in a vacuum, i.e. without a containing resource. The code snippet below shows a method that saves a specified package to a resource with a specified URI.

     protected
static void save(org.eclipse.uml2.uml.Package package_, URI uri
) {


         Resource resource
= new ResourceSetImpl

(
).createResource
(uri
);


         resource.getContents

(
).add(package_);
 
            try
{


                 resource.save

(
null);
                    out(
"Done.");
            } catch (IOException
ioe
) {


                 err(
ioe.getMessage
());
            }
     }

Here we create a resource set   and a resource with the specified URI, add the package to the resource’s contents  , and ask the resource to save itself   using the default options. If an exception occurs, we notify the user   via our handy utility method.

OK, let’s see this method in action. For example, we could save the ‘epo2’ model to a resource with URI ‘ExtendedPO2.uml’ (relative to a URI passed in as an argument) as follows:

            save(
epo2Model, URI.createURI
(args
[0]).appendSegment
("ExtendedPO2")
                    .appendFileExtension

(
UMLResource.FILE_EXTENSION
));

 The UMLResource.FILE_EXTENSION  constant represents the file extension for UML resources (.uml ). Note that the UMLResource  interface contains a number of constants that you will find useful when working with UML resources.

Conclusion

Congratulations! If you’ve made it this far, you’ve successfully created a simple model programmatically and/or using the UML editor. There’s a whole lot more that could be said, but the purpose of this article was just to get you started. Stay tuned for more articles on how to develop tools with UML2.

For more information on UML2, visit the home page  or join the newsgroup .

References

[1] F. Budinsky , D. Steinberg, E. Merks , R. Ellersick , and T. J. Grose .  Eclipse Modeling Framework . Pearson Education, Inc., Boston, MA, 2003.

Source Code

To run the example or view the source code for this article, unzip uml2.articles_200607181325.zip  into your Eclipse home directory and import the com.ibm.uml2.articles  plug-in into your workspace as a binary project with linked content (File > Import… > External Plug-ins and Fragments ). You can run the GettingStartedWithUML2  class as a Java application with a file URI (e.g. “file:/C:/Getting Started  with UML2”) as a program argument.

Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
第1章 Java语言的GUI历史 2 1.1 最初的AWT 2 1.2 Swing工具包 3 1.3 Eclipse的诞生 3 1.4 Eclipse贡献SWT工具包 5 1.4.1 SWT的结构 6 1.4.2 SWT所支持的操作系统 6 1.5 Sun AWT/Swing与Eclipse SWT 7 1.5.1 Swing与SWT的比较 7 1.5.2 SWT的优势和不足 8 1.6 SWT与JFace、Eclipse 9 1.6.1 JFace是SWT的扩展 9 1.6.2 Eclipse的UI界面基于JFace 10 1.7 本章小结 10 第2章 配置SWT开发环境 11 2.1 下载和安装Eclipse 11 2.1.1 Eclipse下载页面介绍 11 2.1.2 下载Eclipse 12 2.1.3 安装Eclipse语言包 14 .2.1.4 在不同的语言切换 15 2.2 直接获取SWT工具包 16 2.3 下载和安装Visual Editor 17 2.3.1 Visual Editor的下载 17 2.3.2 Visual Editor的安装 18 2.4 第一个SWT程序 19 2.4.1 创建SWT程序 19 2.4.2 编译和运行程序 20 2.5 本章小结 21 第3章 Eclipse开发环境概述 22 3.1 Eclipse界面一览 22 3.2 Eclipse项目的文件结构 23 3.2.1 设置编译后.class文件的保存目录 23 3.2.2 导入项目使用的包 25 3.2.3 设置编译方式 26 3.2.4 运行程序 27 3.3 常用的代码编辑功能 28 3.3.1 添加注释 28 3.3.2 自定义格式化代码 28 3.3.3 自动生成getter和setter代码 30 3.3.4 代码的重构 31 3.3.5 查看源代码 31 3.3.6 代码的展开和折叠 32 3.3.7 代码比较 33 3.3.8 子类覆盖父类的方法 34 3.4 代码错误提示 34 3.4.1 如何定位错误 34 3.4.2 自动修正错误 35 3.5 文件查找 35 3.5.1 文件内部查找 35 3.5.2 项目内查找 36 3.6 使用快捷键 36 3.6.1 显示快捷键说明 37 3.6.2 自定义快捷键 37 3.7 本章小结 38 第2篇 SWT进阶篇 第4章 SWT开发基础 40 4.1 SWT应用程序基本结构 40 4.2 Display类 42 4.2.1 Display类概述 42 4.2.2 Display类常用方法 42 4.3 Shell类 45 4.3.1 Shell类概述 45 4.3.2 不同窗口的样式 46 4.3.3 应用多个样式 47 4.3.4 Shell类的主要方法 47 4.3.5 创建多个窗口 49 4.4 SWT包类结构 51 4.5 本章小结 52 第5章 SWT基本组件 53 5.1 SWT控件类概述 53 5.1.1 窗口小部件:Widget 53 5.1.2 Widget的继承关系 53 5.1.3 SWT的子类 54 5.1.4 控件(Controls)与面板(Composites) 55 5.1.5 Widgets不是Controls 55 5.2 按钮(Button) 58 5.2.1 普通按钮(SWT.PUSH) 58 5.2.2 切换按钮(SWT.TOGGLE) 59 5.2.3 箭头按钮(SWT.ARROW) 60 5.2.4 单选按钮(SWT.RADIO) 60 5.2.5 多选按钮(SWT.CHECK) 61 5.2.6 常用的方法 63 5.3 标签(Label) 64 5.3.1 文本标签 64 5.3.2 分割线标签 64 5.3.3 自定义标签(CLabel) 65 5.4 文本框(Text) 65 5.4.1 文本框的样式 66 5.4.2 文本框程序示例 66 5.4.3 常用的方法 68 5.5 列表框(List) 69 5.5.1 列表框的样式 69 5.5.2 列表框程序示例 70 5.5.3 常用的方法 73 5.6 组合框(Combo) 74 5.6.1 组合框的样式 75 5.6.2 组合框程序示例 75 5.6.3 组合框的常用方法 77 5.6.4 自定义组合框CCombo类 77 5.7 本章小结 78 第6章 面板容器类 79 6.1 面板类(Composite) 79 6.1.1 面板类的样式 79 6.1.2 面板类的常用方法 80 6.2 分组框(Group) 80 6.3 选项卡(TabFolder) 81 6.3.1 选项卡的基本构成 81 6.3.2 设置底部显示选项卡 82 6.3.3 设置选项卡图标 82 6.3.4 选项卡的常用方法 83 6.4 自定义选项卡(CTabFolder ) 83 6.4.1 带有“关闭”按钮的选项卡 84 6.4.2 带有边框的选项卡 85 6.4.3 显示“最大化/最小化”按钮 85 6.4.4 设置选项卡的颜色和背景图片 85 6.4.5 仿Eclipse编辑区的选项卡 87 6.4.6 限制选项卡文字的长度 90 6.4.7 设置右上角控件 91 6.4.8 自定义选项的常用方法 91 6.5 分割窗框(SashForm) 92 6.5.1 分割窗框的样式 92 6.5.2 设置窗框显示的比例 93 6.5.3 设置窗框最大化所显示的控件 93 6.6 自定义分割框(CBanner) 94 6.6.1 改变分割线的外观 95 6.6.2 Eclipse的CBanner 95 6.7 滚动面板(ScrolledComposite) 95 6.7.1 设置滚动条的样式 96 6.7.2 滚动面板的其他方法 97 6.8 本章小结 97 第7章 SWT布局管理器 98 7.1 布局管理器概述 98 7.1.1 绝对定位 98 7.1.2 托管定位 98 7.1.3 常见的布局管理器 100 7.2 FillLayout(充满式布局) 100 7.2.1 水平填充(默认)和垂直填充 101 7.2.2 设置四周补白 102 7.3 RowLayout(行列式布局) 102 7.3.1 设置折行显示:wrap属性 103 7.3.2 设置空间大小:pack属性 103 7.3.3 设置填充方式:type属性 103 7.3.4 设置是否充满整行:justify属性 104 7.3.5 设置补白和间隔 104 7.3.6 设置控件的大小RowData 105 7.3.7 设置是否等宽或等高:fill属性 105 7.4 GridLayout(网格式布局) 106 7.4.1 设置网格的列数:numColumns属性 106 7.4.2 设置网格等宽:makeColumnsEqualWidth属性 107 7.4.3 设置补白和间隔 107 7.4.4 使用GridData对象 107 7.4.5 设置单元格对齐方式:horizontalAlignment和verticalAlignment属性 108 7.4.6 设置缩进大小:horizontalIndent和verticalIndent属性 109 7.4.7 设置单元格跨行和跨列显示:horizontalSpan和verticalSpan属性 109 7.4.8 设置单元格空间的抢占方式:grabExcessHorizontalSpace和 grabExcessVerticalSpace属性 110 7.4.9 设置的控件大小:minimumWidth和minimumHeight属性 111 7.4.10 设置控件大小:widthHint和heightHint属性 111 7.4.11 样式常量对照表 112 7.5 FormLayout(表格式布局) 112 7.5.1 设置补白和间隔 113 7.5.2 使用FormData对象 113 7.5.3 使用FormAttachment对象 114 7.5.4 设置控件的相对位置 115 7.6 StackLayout(堆栈式布局) 115 7.7 自定义布局管理器 117 7.7.1 布局的基本原理 117 7.7.2 布局计算的常用方法 118 7.7.3 自定义布局类(BorderLayout) 119 7.8 使用VE可视化布局 123 7.8.1 创建可视化的类 123 7.8.2 进行布局设置 124 7.9 本章小结 125 第8章 SWT的事件模型 126 8.1 事件模型概述 126 8.1.1 监听器(Listener) 126 8.1.2 事件(Event) 127 8.1.3 注册监听器 127 8.1.4 适配器 128 8.1.5 常见的事件 128 8.2 事件处理的常用写法 130 8.2.1 内部匿名类 130 8.2.2 内部类 130 8.2.3 实现接口的类 131 8.2.4 继承的类的方法 132 8.3 键盘事件 132 8.3.1 键盘事件程序示例 132 8.3.2 键盘事件的各种属性 134 8.4 鼠标事件 136 8.4.1 鼠标事件程序示例 136 8.4.2 鼠标事件的各种属性 139 8.5 其他常用的事件 139 8.5.1 选事件 139 8.5.2 文本修改程序示例 140 8.5.3 文本修改事件:VerifyEvent的各种属性 142 8.5.4 文本修改事件:VerifyEvent和ModifyEvent的区别 143 8.6 无类型的事件 144 8.6.1 注册无类型事件监听器 144 8.6.2 无类型事件程序示例 145 8.7 本章小结 146 第3篇 SWT高级篇 第9章 SWT高级控件 148 9.1 链接文本(Link) 148 9.2 菜单(Menu和MenuItem) 149 9.2.1 菜单与菜单项之间的关系 150 9.2.2 菜单的样式 151 9.2.3 菜单项的样式 152 9.2.4 设置菜单项的图标 152 9.2.5 设置菜单项快捷键 152 9.3 工具栏(ToolBar和ToolItem) 153 9.3.1 工具栏图片资源的管理 155 9.3.2 工具栏的不同样式 157 9.3.3 工具栏按钮的不同样式 158 9.3.4 工具栏常用的方法 160 9.4 可拖动的工具栏(CoolBar和CoolItem) 161 9.4.1 带有下拉选项的工具栏 163 9.4.2 常用的方法 163 9.5 系统托盘(Tray和TrayItem) 164 9.6 滑动组件 167 9.6.1 滑块(Slider) 167 9.6.2 刻度条(Scale) 168 9.6.3 微调按钮(Spinner) 168 9.7 进度条(ProgressBar) 169 9.8 对话框 170 9.8.1 消息提示框(MessageBox) 171 9.8.2 文件目录对话框(DirectoryDialog) 172 9.8.3 文件对话框(FileDialog) 173 9.8.4 颜色对话框(ColorDialog) 175 9.8.5 字体对话框(FontDialog) 176 9.8.6 打印对话框(PrintDialog) 177 9.9 表格(Table、TableItem和TableColumn) 178 9.9.1 Table、TableItem和TableColumn的关系 182 9.9.2 设置带有选择框的表格 182 9.9.3 设置可同时选多行表格 183 9.9.4 可拖动的表格 184 9.9.5 设置单元格的图标 184 9.9.6 改变选行高亮显示的颜色 185 9.9.7 带有上下文菜单的表格 186 9.9.8 可编辑的表格(TableEditor) 187 9.9.9 用键盘控制表格(TableCursor) 189 9.9.10 带有进度条的表格 191 9.9.11 表格小结 192 9.10 树(Tree) 192 9.10.1 不同样式的树 193 9.10.2 为树添加图标 193 9.10.3 可编辑的树 196 9.10.4 表格树 197 9.10.5 树小结 198 9.11 格式化文本(StyleText) 198 9.11.1 格式化对象(StyleRange) 199 9.11.2 格式化文本的事件处理 200 9.11.3 对选文本设置格式 201 9.11.4 自动为数字字符着色 203 9.11.5 换行自动设置背景颜色 204 9.12 浏览器 205 9.13 本章小结 210 第10章 SWT的拖放支持 211 10.1 可拖放的树 211 10.2 拖放原理概述 214 10.3 拖放源(DragSource) 215 10.3.1 创建拖放源对象 215 10.3.2 定义拖放源数据传输类型 215 10.3.3 处理拖放源事件 216 10.4 拖放目标(DragTarget) 218 10.4.1 定义目标对象 218 10.4.2 定义目标对象的数据传输类型 219 10.4.3 处理拖放目标事件 219 10.5 传输数据(Transfer) 221 10.6 综合示例:简单购物车 222 10.7 对剪贴板的操作 226 10.8 本章小结 229 第11章 SWT线程 230 11.1 线程概述 230 11.1.1 什么是线程 230 11.1.2 创建线程的两种方式 231 11.2 SWT的UI线程 234 11.3 其他线程访问UI线程 234 11.4 改进的进度条 236 11.5 多线程程序设计 238 11.6 本章小结 243 第12章 SWT系统资源 244 12.1 系统资源概述 244 12.1.1 什么是系统资源 244 12.1.2 释放资源的原则 245 12.1.3 访问资源的原则 246 12.1.4 何时释放资源 246 12.2 颜色(Color) 247 12.2.1 系统颜色 248 12.2.2 RGB颜色 249 12.3 字体(Font) 250 12.4 光标(Cursor) 251 12.5 图像(Image) 252 12.5.1 画布类(Canvas) 252 12.5.2 图像类(Image) 254 12.5.3 图像数据类(ImageData) 255 12.5.4 保存图像类(ImageLoader) 256 12.5.5 Eclipse的图标 256 12.6 SWT绘图 257 12.6.1 使用绘制对象的方法 257 12.6.2 绘制线条 258 12.6.3 绘制字符 259 12.6.4 绘制填充图形 260 12.6.5 绘制图像 261 12.7 本章小结 261 第13章 SWT的高级应用.. 262 13.1 打印支持 262 13.1.1 打印类(Printer)和打印数据类(PrinterData) 262 13.1.2 打印程序示例概述 265 13.1.3 打印程序示例:主窗口程序 265 13.1.4 打印程序示例:打开文件程序 268 13.1.5 打印程序示例:设置字体和颜色程序 268 13.1.6 打印程序示例:打印文本的程序 269 13.1.7 打印程序示例:打印文件后的效果预览 273 13.2 使用应用程序 274 13.3 对AWT/Swing程序的支持 275 13.4 OLE和ActiveX控件的支持 275 13.4.1 OLE控件的面板类(OleFrame) 276 13.4.2 OLE控件类(OleClientSite和OleControlSite) 277 13.4.3 OLE 程序示例 278 13.5 Pocket PC应用 280 13.6 Web应用SWT 282 13.7 本章小结 282 第4篇 JFace篇 第14章 JFace概述 284 14.1 配置JFace运行环境 284 14.2 第一个JFace程序 285 14.3 JFace框架概述 287 14.4 JFace的包结构 287 14.5 本章小结 289 第15章 应用程序窗口 290 15.1 JFace的窗口类(Window类) 290 15.2 应用程序窗口ApplicationWindow类 292 15.3 带有菜单栏的主程序窗口 293 15.3.1 简单写字板程序示例 293 15.3.2 添加菜单栏的基本步骤 297 15.3.3 创建菜单项 297 15.3.4 菜单项的事件处理 298 15.4 带有工具栏的主程序窗口 299 15.5 带有状态栏的主程序窗口 300 15.6 其他处理事件的方法 304 15.6.1 “新建”操作 304 15.6.2 “保存”操作 305 15.6.3 “另存为”操作 306 15.6.4 “复制”、“剪切”和“粘贴”操作 307 15.7 本章小结 310 第16章 JFace对话框 311 16.1 JFace对话框概述 311 16.2 信息提示对话框(MessageDialog) 312 16.2.1 创建信息提示对话框 312 16.2.2 错误消息对话框 314 16.2.3 确认消息对话框 315 16.2.4 消息对话框 315 16.2.5 询问对话框 316 16.2.6 警告对话框 316 16.2.7 JFace的本地化 317 16.3 输入对话框(InputDialog) 318 16.3.1 创建输入对话框 319 16.3.2 创建输入文本的验证类 320 16.4 带有提示信息的对话框(TitleAreaDialog) 321 16.5 错误提示对话框(ErrorDialog) 325 16.5.1 创建错误提示对话框 325 16.5.2 使用错误状态对象 327 16.5.3 同时显示多个错误信息 327 16.6 带有进度条的对话框(ProgressMonitorDialog) 329 16.7 自定义对话框 330 16.7.1 自定义对话框程序示例 331 16.7.2 自定义对话框的步骤 333 16.8 本章小结 334 第17章 向导式对话框 335 17.1 向导式对话框概述 335 17.1.1 向导式对话框所涉及的类 335 17.1.2 向导式对话框的常用方法 336 17.2 简单的向导式对话框示例 338 17.2.1 第一个问题向导页面 338 17.2.2 第二个问题向导页面 339 17.2.3 感谢向导页面 340 17.2.4 创建向导 341 17.2.5 创建测试程序 342 17.3 保存对话框状态 344 17.4 复杂的向导式对话框示例 345 17.4.1 自定义向导页面 346 17.4.2 为向导添加帮助 349 17.5 向导式对话框的事件处理 350 17.6 本章小结 350 第18章 首选项 351 18.1 首选项概述 351 18.2 保存首选项的设置 353 18.2.1 首选项值的设置和获取 353 18.2.2 保存首选项所涉及的事件 354 18.3 显示首选项页面 354 18.3.1 创建一个首选项页面 354 18.3.2 创建首选项页面所对应的节点 357 18.3.3 显示首选项对话框 358 18.4 创建树型的导航菜单 360 18.4.1 第一种方法 361 18.4.2 第二种方法 361 18.5 首选项的选项设置 361 18.5.1 字段编辑器概述 362 18.5.2 使用字段编辑器基本步骤 362 18.5.3 布尔型字段编辑器(BooleanFieldEditor) 364 18.5.4 颜色字段编辑器(ColorFieldEditor) 364 18.5.5 字体字段编辑器(FontFieldEditor) 364 18.5.6 路径列表字段编辑器(PathEditor) 365 18.5.7 单选分组字段编辑器(RadioGroupFieldEditor) 365 18.5.8 刻度条字段编辑器(ScaleFieldEditor) 366 18.5.9 整数型字段编辑器(IntegerFieldEditor) 366 18.5.10 选择路径字段编辑器(DirectoryFieldEditor) 366 18.5.11 选择文件字段编辑器(FileFieldEditor) 366 18.6 自定义首选项页面 367 18.7 首选项的事件处理 368 18.8 本章小结 369 第19章 MVC的表格、树和列表 370 19.1 MVC概述 370 19.2 表格(TableViewer) 371 19.2.1 创建表格控制器(Controller) 371 19.2.2 创建表格模型(Model) 373 19.2.3 创建组织表格视图(View) 375 19.2.4 添加和删除数据 376 19.2.5 增加表格排序功能 378 19.2.6 增加表格过滤功能 380 19.2.7 编辑表格单元 381 19.2.8 表格的事件处理 383 19.2.9 带有复选框表格(CheckBoxTableViewer) 383 19.3 树(TreeViewer) 384 19.3.1 树的基本性质 385 19.3.2 创建树(TreeViewer) 386 19.3.3 对树的操作 389 19.4 树和表格的综合示例 390 19.4.1 文件浏览器功能概述 391 19.4.2 程序的整体框架 391 19.4.3 初始化树 393 19.4.4 初始化表格 394 19.4.5 程序的事件处理 396 19.5 列表ListViewer 397 19.6 本章小结 398 第20章 JFace的工具类 399 20.1 JFace资源管理机制 399 20.1.1 图像描述符(ImageDescriptor) 399 20.1.2 图像注册器(ImageRegistry) 401 20.1.3 字体描述符和字体注册器 403 20.1.4 颜色描述符和颜色注册器 404 20.1.5 JFace的资源管理器(JFaceResources) 406 20.1.6 字符换工具类(StringConverter) 407 20.2 类型检查的工具类 407 20.3 本章小结 408 第21章 文本处理 409 21.1 文本处理概述 409 21.2 项目实战:JavaScript编辑器 409 21.2.1 主窗口预览 409 21.2.2 项目文件结构 410 21.3 主窗口模块 411 21.3.1 代码实现 411 21.3.2 主窗口程序代码分析 414 21.3.3 启动主窗口程序 416 21.4 代码着色 417 21.4.1 源代码配置类(SourceViewerConfiguration) 417 21.4.2 基于规则的代码扫描器类(RuleBasedScanner) 419 21.4.3 设置代码扫描规则 420 21.4.4 提取类(Token)和文本属性类(TextAttribute) 423 21.5 内容辅助 423 21.5.1 配置编辑器的内容助手 424 21.5.2 内容辅助类 424 21.5.3 辅助建议类(CompletionProposal) 426 21.6 文档的撤销与重复 427 21.6.1 文档管理器对象(DefaultUndoManager) 427 21.6.2 撤销操作的实现 427 21.6.3 恢复操作的实现 428 21.7 查找与替换窗口 429 21.7.1 窗口的界面设计 429 21.7.2 查找功能的实现 433 21.7.3 替换功能的实现 434 21.8 首选项的对话框 434 21.8.1 首选项页面的代码实现 435 21.8.2 打开首选项页面的代码 436 21.9 文件的打开、保存与打印 437 21.9.1 打开文件 437 21.9.2 保存文件 437 21.9.3 打印文件 438 21.10 帮助对话框 439 21.11 其他的一些工具类 440 21.11.1 事件管理类 440 21.11.2 资源管理类 441 21.11.3 程序使用的常量 443 21.12 本章小结 444 第5篇 RCP应用篇 第22章 富客户端平台(RCP)应用 446 22.1 RCP概述 446 22.1.1 什么是RCP 446 22.1.2 RCP应用的现状 447 22.2 第一个RCP项目 448 22.2.1 创建插件项目 449 22.2.2 运行RCP程序 450 22.2.3 插件的文件清单 451 22.2.4 MANIFEST.MF文件 452 22.2.5 build.properties文件 454 22.2.6 plugin.xml文件 454 22.3 RCP运行的基本原理 455 22.3.1 插件类MyRCPPlugin 455 22.3.2 应用程序类Application 456 22.3.3 工作台窗口类 458 22.3.4 操作类 459 22.3.5 透视图类 460 22.4 创建扩展的基本方法 460 22.4.1 使用扩展向导创建 460 22.4.2 手工创建 462 22.4.3 获取扩展点的帮助 463 22.5 本章小结 464 第23章 RCP开发 465 23.1 扩展操作集(Action Set) 465 23.1.1 操作集扩展点 465 23.1.2 编写代码创建操作对象 469 23.1.3 编写代码创建操作的步骤 471 23.1.4 其他与操作有关的扩展点 473 23.2 扩展视图 473 23.2.1 视图扩展点 474 23.2.2 视图类 475 23.2.3 视图之间的交互 477 23.2.4 添加视图的工具栏 480 23.2.5 添加上下文菜单 481 23.3 扩展编辑器 484 23.3.1 编辑器扩展点 485 23.3.2 编辑器类 485 23.3.3 打开编辑器 488 23.3.4 添加编辑器的菜单和工具栏 491 23.3.5 多页编辑器 493 23.4 透视图 495 23.4.1 透视图的布局 495 23.4.2 透视图扩展点 498 23.4.3 透视图类 499 23.5 首选项 500 23.5.1 首选项扩展点 500 23.5.2 首选项页面扩展点 501 23.6 帮助文档 503 23.6.1 联机帮助文档扩展点 504 23.6.2 扩展配置 505 23.6.3 联机帮助的目录结构 506 23.6.4 添加动态帮助 507 23.7 RCP产品的发布 508 23.7.1 Eclipse产品配置 508 23.7.2 导出RCP产品 510 23.7.3 运行RCP产品 510 23.8 本章小结 511 第24章 Eclipse表单 512 24.1 Eclipse 表单概述 512 24.1.1 什么是Eclipse 表单 512 24.1.2 Eclipse表单的特性 513 24.1.3 Eclipse表单使用的类包 513 24.2 表单开发基础 513 24.2.1 视图使用表单 513 24.2.2 多页编辑器使用表单 515 24.2.3 SWT程序使用表单 518 24.2.4 获得表单工具对象(FormToolkit)一般方法 519 24.3 表单的各种控件 519 24.3.1 可滚动的表单(ScrolledForm) 519 24.3.2 可折叠的面板(ExpandableComposite) 520 24.3.3 内容区(Section) 523 24.3.4 超链接(Hyperlink) 525 24.3.5 表单文本(FormText) 527 24.4 表单的布局管理器 531 24.4.1 表格布局(TableWrapLayout) 531 24.4.2 列布局(ColumnLayout) 534 24.5 表单的高级应用 536 24.5.1 Master/Details模式 536 24.5.2 实现Master/Detail示例程序 537 24.6 本章小结 544 第25章 项目实战——客户关系管理系统 545 25.1 系统概述 545 25.1.1 系统预览 545 25.1.2 基本概念介绍 546 25.1.3 系统的运行环境 547 25.1.4 系统文件结构的说明 547 25.2 UI界面设计 547 25.3 业务层设计 549 25.3.1 业务层服务的定义 549 25.3.2 业务层的实现 551 25.3.3 业务层服务的管理 552 25.3.4 业务层UML图 553 25.3.5 如何调用业务对象 554 25.4 数据库层设计 555 25.4.1 数据库接口类 556 25.4.2 实现了MySQL 数据库类 556 25.4.3 如何调用数据访问对象 561 25.4.4 应用多种数据库 562 25.4.5 数据库的初始化的脚本 563 25.4.6 表所对应的POJO类 564 25.5 登录模块 566 25.5.1 系统的上下文对象保存登录状态 566 25.5.2 登录验证的实现 567 25.5.3 登录窗口的实现 569 25.6 主窗口界面 572 25.6.1 工作台的实现 572 25.6.2 系统托盘的实现 573 25.6.3 菜单栏和工具栏的实现 575 25.6.4 操作管理类(ActionManager) 579 25.6.5 新建客户操作(NewCustomerAction) 580 25.6.6 打开视图操作(ShowViewAction) 581 25.7 各种视图和编辑器的实现 582 25.7.1 快速新建客户视图 583 25.7.2 客户列表视图 585 25.7.3 客户详细编辑器 590 25.7.4 联系人列表视图 595 25.7.5 快速新建联系人视图 597 25.7.6 搜索视图 600 25.7.7 导航视图 603 25.8 新建客户联系人向导 609 25.8.1 新建客户向导 609 25.8.2 新建联系人向导 615 25.9 首选项的实现 618 25.10 plugin.xml文件清单 623 25.11 本章小结... 626

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值