001: /*
002: * @(#)PPCFileDialogPeer.java 1.8 06/10/10
003: *
004: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: */
026:
027: package sun.awt.pocketpc;
028:
029: import java.awt.*;
030: import sun.awt.ScreenUpdater;
031: import java.io.FilenameFilter;
032: import sun.awt.peer.*;
033:
034: public class PPCFileDialogPeer extends PPCWindowPeer implements
035: FileDialogPeer {
036: private static native void initIDs();
037:
038: static {
039: initIDs();
040: }
041:
042: private PPCComponentPeer parent;
043:
044: public void setDirectory(String dir) {
045: }
046:
047: public void setFile(String file) {
048: }
049:
050: public void setTitle(String title) {
051: }
052:
053: public void setFilenameFilter(FilenameFilter filter) {
054: // We can set the filter, but can't do anything with it yet.
055: System.err.println("setFilenameFilter not implemented\n");
056: }
057:
058: // Toolkit & peer internals
059: PPCFileDialogPeer(FileDialog target) {
060: super (target);
061: }
062:
063: void create(PPCComponentPeer parent) {
064: this .parent = parent;
065: }
066:
067: void initialize() {
068: FileDialog target = (FileDialog) this .target;
069: }
070:
071: /*
072: protected void disposeImpl() {
073: ScreenUpdater.updater.removeClient(this);
074: PPCToolkit.targetDisposedPeer(target, this);
075: }
076: */
077:
078: public native void show();
079:
080: // native callbacks
081: void handleSelected(String file) {
082: int index = file.lastIndexOf('\\');
083: String dir;
084:
085: if (index == -1) {
086: dir = ".\\";
087: ((FileDialog) target).setFile(file);
088: } else {
089: dir = file.substring(0, index + 1);
090: ((FileDialog) target).setFile(file.substring(index + 1));
091: }
092: ((FileDialog) target).setDirectory(dir);
093: ((FileDialog) target).setVisible(false);
094: }
095:
096: void handleCancel() {
097: ((FileDialog) target).setFile(null);
098: ((FileDialog) target).setVisible(false);
099: }
100:
101: // unused methods.
102: public void beginValidate() {
103: }
104:
105: public void endValidate() {
106: }
107:
108: public void toFront() {
109: }
110:
111: public void toBack() {
112: }
113:
114: public void setResizable(boolean resizable) {
115: }
116:
117: public void hide() {
118: }
119:
120: public void enable() {
121: }
122:
123: public void disable() {
124: }
125:
126: public void reshape(int x, int y, int width, int height) {
127: }
128:
129: public boolean handleEvent(Event e) {
130: return false;
131: }
132:
133: public void setForeground(Color c) {
134: }
135:
136: public void setBackground(Color c) {
137: }
138:
139: public void setFont(Font f) {
140: }
141:
142: public void requestFocus() {
143: }
144:
145: public void nextFocus() {
146: }
147:
148: public void setCursor(int cursorType) {
149: }
150:
151: void start() {
152: }
153:
154: void invalidate(int x, int y, int width, int height) {
155: }
156: }
|