Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 java.desktop.jmod - Desktop Module
JDK 17 java.desktop.jmod is the JMOD file for JDK 17 Desktop module.
JDK 17 Desktop module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.desktop.jmod.
JDK 17 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Desktop module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.desktop.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/beans/editors/EnumEditor.java
/*
* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.beans.editors;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyEditor;
import java.util.ArrayList;
import java.util.List;
/**
* Property editor for java.lang.Enum subclasses.
*
* @see PropertyEditor
*
* @since 1.7
*
* @author Sergey A. Malenkov
*/
public final class EnumEditor implements PropertyEditor {
private final List<PropertyChangeListener> listeners = new ArrayList<PropertyChangeListener>();
@SuppressWarnings("rawtypes")
private final Class<? extends Enum> type;
private final String[] tags;
private Object value;
public EnumEditor(Class<?> type) {
Object[] values = type.getEnumConstants();
if ( values == null ) {
throw new IllegalArgumentException( "Unsupported " + type );
}
this.type = type.asSubclass(java.lang.Enum.class);
this.tags = new String[values.length];
for ( int i = 0; i < values.length; i++ ) {
this.tags[i] = ( ( Enum )values[i] ).name();
}
}
public Object getValue() {
return this.value;
}
public void setValue( Object value ) {
if ( ( value != null ) && !this.type.isInstance( value ) ) {
throw new IllegalArgumentException( "Unsupported value: " + value );
}
Object oldValue;
PropertyChangeListener[] listeners;
synchronized ( this.listeners ) {
oldValue = this.value;
this.value = value;
if ( ( value == null ) ? oldValue == null : value.equals( oldValue ) ) {
return; // do not fire event if value is not changed
}
int size = this.listeners.size();
if ( size == 0 ) {
return; // do not fire event if there are no any listener
}
listeners = this.listeners.toArray( new PropertyChangeListener[size] );
}
PropertyChangeEvent event = new PropertyChangeEvent( this, null, oldValue, value );
for ( PropertyChangeListener listener : listeners ) {
listener.propertyChange( event );
}
}
public String getAsText() {
return ( this.value != null )
? ( ( Enum )this.value ).name()
: null;
}
public void setAsText( String text ) {
@SuppressWarnings("unchecked")
Object tmp = ( text != null )
? Enum.valueOf( (Class)this.type, text )
: null;
setValue(tmp);
}
public String[] getTags() {
return this.tags.clone();
}
public String getJavaInitializationString() {
String name = getAsText();
return ( name != null )
? this.type.getName() + '.' + name
: "null";
}
public boolean isPaintable() {
return false;
}
public void paintValue( Graphics gfx, Rectangle box ) {
}
public boolean supportsCustomEditor() {
return false;
}
public Component getCustomEditor() {
return null;
}
public void addPropertyChangeListener( PropertyChangeListener listener ) {
synchronized ( this.listeners ) {
this.listeners.add( listener );
}
}
public void removePropertyChangeListener( PropertyChangeListener listener ) {
synchronized ( this.listeners ) {
this.listeners.remove( listener );
}
}
}
⏎ com/sun/beans/editors/EnumEditor.java
Or download all of them as a single archive file:
File name: java.desktop-17.0.5-src.zip File size: 9152233 bytes Release date: 2022-09-13 Download
⇒ JDK 17 java.instrument.jmod - Instrument Module
2023-09-16, ≈375🔥, 0💬
Popular Posts:
GJT (Giant Java Tree) implementation of XML Pull Parser. JAR File Size and Download Location: File n...
Java Servlet API 4.0.1 Source Code Files are important if you want to compile them with different JD...
JDK 11 jdk.localedata.jmod is the JMOD file for JDK 11 Localedata module. JDK 11 Locale Data module ...
kernel.jar is a component in iText Java library to provide low-level functionalities. iText Java lib...
What Is commons-collections4-4.4 .jar?commons-collections4-4.4 .jaris the JAR file for Apache Common...