diff options
author | Veronika Irvine <veronika> | 2003-03-05 15:00:14 +0000 |
---|---|---|
committer | Veronika Irvine <veronika> | 2003-03-05 15:00:14 +0000 |
commit | 281dc95420976f0ffb0cbab0dc7e5e4a8f3ac547 (patch) | |
tree | 7682936f0fef30a163a6b92d96ef435e09c564c1 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java | |
parent | 4d0b24a27232ff40c8169511178d0b60b9efdcc2 (diff) | |
download | eclipse.platform.swt-281dc95420976f0ffb0cbab0dc7e5e4a8f3ac547.tar.gz eclipse.platform.swt-281dc95420976f0ffb0cbab0dc7e5e4a8f3ac547.tar.xz eclipse.platform.swt-281dc95420976f0ffb0cbab0dc7e5e4a8f3ac547.zip |
Converting Binary files to ASCII
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java | 258 |
1 files changed, 129 insertions, 129 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java index 4d97d71115..b1b55d03c2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java @@ -1,17 +1,17 @@ -package org.eclipse.swt.widgets;
-
-/*
+package org.eclipse.swt.widgets; + +/* * Copyright (c) 2000, 2002 IBM Corp. All rights reserved. * This file is made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.internal.*;
-import org.eclipse.swt.internal.gtk.*;
-import org.eclipse.swt.graphics.*;
-
+ * http://www.eclipse.org/legal/cpl-v10.html + */ + +import org.eclipse.swt.*; +import org.eclipse.swt.internal.*; +import org.eclipse.swt.internal.gtk.*; +import org.eclipse.swt.graphics.*; + /** * Instances of this class represent a selectable user interface object * corresponding to a tab for a page in a tab folder. @@ -25,12 +25,12 @@ import org.eclipse.swt.graphics.*; * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> */ -public class TabItem extends Item {
- int labelHandle, imageHandle, pageHandle;
- Control control;
- TabFolder parent;
- String toolTipText;
-
+public class TabItem extends Item { + int labelHandle, imageHandle, pageHandle; + Control control; + TabFolder parent; + String toolTipText; + /** * Constructs a new instance of this class given its parent * (which must be a <code>TabFolder</code>) and a style value @@ -61,12 +61,12 @@ public class TabItem extends Item { * @see Widget#checkSubclass * @see Widget#getStyle */ -public TabItem (TabFolder parent, int style) {
- super (parent, style);
- this.parent = parent;
- parent.createItem (this, parent.getItemCount ());
-}
-
+public TabItem (TabFolder parent, int style) { + super (parent, style); + this.parent = parent; + parent.createItem (this, parent.getItemCount ()); +} + /** * Constructs a new instance of this class given its parent * (which must be a <code>TabFolder</code>), a style value @@ -98,12 +98,12 @@ public TabItem (TabFolder parent, int style) { * @see Widget#checkSubclass * @see Widget#getStyle */ -public TabItem (TabFolder parent, int style, int index) {
- super (parent, style);
- this.parent = parent;
- parent.createItem (this, index);
-}
-
+public TabItem (TabFolder parent, int style, int index) { + super (parent, style); + this.parent = parent; + parent.createItem (this, index); +} + /** * Returns the control that is used to fill the client area of * the tab folder when the user selects the tab item. If no @@ -116,17 +116,17 @@ public TabItem (TabFolder parent, int style, int index) { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ -public Control getControl () {
- checkWidget ();
- return control;
-}
-
-public Display getDisplay () {
- TabFolder parent = this.parent;
- if (parent == null) error (SWT.ERROR_WIDGET_DISPOSED);
- return parent.getDisplay ();
-}
-
+public Control getControl () { + checkWidget (); + return control; +} + +public Display getDisplay () { + TabFolder parent = this.parent; + if (parent == null) error (SWT.ERROR_WIDGET_DISPOSED); + return parent.getDisplay (); +} + /** * Returns the receiver's parent, which must be a <code>TabFolder</code>. * @@ -137,11 +137,11 @@ public Display getDisplay () { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ -public TabFolder getParent () {
- checkWidget ();
- return parent;
-}
-
+public TabFolder getParent () { + checkWidget (); + return parent; +} + /** * Returns the receiver's tool tip text, or null if it has * not been set. @@ -153,30 +153,30 @@ public TabFolder getParent () { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ -public String getToolTipText () {
- checkWidget ();
- return toolTipText;
-}
-
-void releaseChild () {
- super.releaseChild ();
- int index = parent.indexOf (this);
- if (index == parent.getSelectionIndex ()) {
- if (control != null) control.setVisible (false);
- }
- parent.destroyItem (this);
-}
-
-void releaseHandle () {
- super.releaseHandle ();
- pageHandle = labelHandle = imageHandle = 0;
-}
-
-void releaseWidget () {
- super.releaseWidget ();
- parent = null;
-}
-
+public String getToolTipText () { + checkWidget (); + return toolTipText; +} + +void releaseChild () { + super.releaseChild (); + int index = parent.indexOf (this); + if (index == parent.getSelectionIndex ()) { + if (control != null) control.setVisible (false); + } + parent.destroyItem (this); +} + +void releaseHandle () { + super.releaseHandle (); + pageHandle = labelHandle = imageHandle = 0; +} + +void releaseWidget () { + super.releaseWidget (); + parent = null; +} + /** * Sets the control that is used to fill the client area of * the tab folder when the user selects the tab item. @@ -192,60 +192,60 @@ void releaseWidget () { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ -public void setControl (Control control) {
- checkWidget ();
- Control oldControl = this.control, newControl = control;
- this.control = control;
- int index = parent.indexOf (this);
- if (index != parent.getSelectionIndex ()) {
- if (newControl != null) newControl.setVisible (false);
- return;
- }
- if (newControl != null) {
- newControl.setBounds (parent.getClientArea ());
- newControl.setVisible (true);
- }
- if (oldControl != null) oldControl.setVisible (false);
-}
-
-void setFontDescription (int font) {
- OS.gtk_widget_modify_font (labelHandle, font);
- OS.gtk_widget_modify_font (imageHandle, font);
-}
-
-void setForegroundColor (GdkColor color) {
- OS.gtk_widget_modify_fg (labelHandle, 0, color);
- OS.gtk_widget_modify_fg (imageHandle, 0, color);
-}
-
-public void setImage (Image image) {
- checkWidget ();
- super.setImage (image);
- if (image != null) {
- OS.gtk_image_set_from_pixmap (imageHandle, image.pixmap, image.mask);
- OS.gtk_widget_show (imageHandle);
- } else {
- OS.gtk_image_set_from_pixmap (imageHandle, 0, 0);
- OS.gtk_widget_hide (imageHandle);
- }
- parent.fixPage ();
-}
-
-public void setText (String string) {
- checkWidget ();
- if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
- super.setText (string);
- char [] chars = fixMnemonic (string);
- byte [] buffer = Converter.wcsToMbcs (null, chars, false);
- OS.gtk_label_set_text_with_mnemonic (labelHandle, buffer);
- if (string.length () != 0) {
- OS.gtk_widget_show (labelHandle);
- } else {
- OS.gtk_widget_hide (labelHandle);
- }
- parent.fixPage ();
-}
-
+public void setControl (Control control) { + checkWidget (); + Control oldControl = this.control, newControl = control; + this.control = control; + int index = parent.indexOf (this); + if (index != parent.getSelectionIndex ()) { + if (newControl != null) newControl.setVisible (false); + return; + } + if (newControl != null) { + newControl.setBounds (parent.getClientArea ()); + newControl.setVisible (true); + } + if (oldControl != null) oldControl.setVisible (false); +} + +void setFontDescription (int font) { + OS.gtk_widget_modify_font (labelHandle, font); + OS.gtk_widget_modify_font (imageHandle, font); +} + +void setForegroundColor (GdkColor color) { + OS.gtk_widget_modify_fg (labelHandle, 0, color); + OS.gtk_widget_modify_fg (imageHandle, 0, color); +} + +public void setImage (Image image) { + checkWidget (); + super.setImage (image); + if (image != null) { + OS.gtk_image_set_from_pixmap (imageHandle, image.pixmap, image.mask); + OS.gtk_widget_show (imageHandle); + } else { + OS.gtk_image_set_from_pixmap (imageHandle, 0, 0); + OS.gtk_widget_hide (imageHandle); + } + parent.fixPage (); +} + +public void setText (String string) { + checkWidget (); + if (string == null) error (SWT.ERROR_NULL_ARGUMENT); + super.setText (string); + char [] chars = fixMnemonic (string); + byte [] buffer = Converter.wcsToMbcs (null, chars, false); + OS.gtk_label_set_text_with_mnemonic (labelHandle, buffer); + if (string.length () != 0) { + OS.gtk_widget_show (labelHandle); + } else { + OS.gtk_widget_hide (labelHandle); + } + parent.fixPage (); +} + /** * Sets the receiver's tool tip text to the argument, which * may be null indicating that no tool tip text should be shown. @@ -257,9 +257,9 @@ public void setText (String string) { * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ -public void setToolTipText (String string) {
- checkWidget ();
- toolTipText = string;
-}
-
-}
+public void setToolTipText (String string) { + checkWidget (); + toolTipText = string; +} + +} |