home *** CD-ROM | disk | FTP | other *** search
- package allaire.controls;
-
- import java.awt.Button;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Event;
- import java.awt.FlowLayout;
- import java.awt.Image;
- import java.awt.Panel;
- import java.awt.Rectangle;
-
- class CFGRIDActionbar extends Panel {
- public static final String INSERT_TEXT = " Insert ";
- public static final String DELETE_TEXT = "Delete";
- public static final String SORTASCENDING_TEXT = "A -> Z";
- public static final String SORTDESCENDING_TEXT = "Z -> A";
- public static final int NO_ACTIONBUTTONS = 0;
- public static final int INSERT_BUTTON = 1;
- public static final int DELETE_BUTTON = 2;
- public static final int SORT_BUTTON = 4;
- public static final int FILTER_BUTTON = 16;
- private static final int HGAP_BUTTON = 10;
- private static final int VGAP_BUTTON = 5;
- private static final int WIDTH_BUTTON = 24;
- private static final int HEIGHT_BUTTON = 24;
- // $FF: renamed from: gs allaire.controls.CFGRID
- private CFGRID field_0;
- private String insert;
- private String delete;
- private String sortascending;
- private String sortdescending;
-
- CFGRIDActionbar(CFGRID var1) {
- this.field_0 = var1;
- var1.actionBar = true;
- this.insert = " Insert ";
- this.delete = "Delete";
- this.sortascending = "A -> Z";
- this.sortdescending = "Z -> A";
- ((Container)this).setLayout(new FlowLayout(0, 10, 5));
- ((Container)this).add(new Button(" Insert "));
- ((Container)this).add(new Button("Delete"));
- }
-
- CFGRIDActionbar(CFGRID var1, int var2, String var3, String var4, String var5, String var6) {
- this.field_0 = var1;
- var1.actionBar = true;
- this.insert = var3 == null ? " Insert " : var3;
- this.delete = var4 == null ? "Delete" : var4;
- this.sortascending = var5 == null ? "A -> Z" : var5;
- this.sortdescending = var6 == null ? "Z -> A" : var6;
- ((Container)this).setLayout(new FlowLayout(0, 10, 5));
- if ((var2 & 1) == 1) {
- ((Container)this).add(new Button(this.insert));
- }
-
- if ((var2 & 2) == 2) {
- ((Container)this).add(new Button(this.delete));
- }
-
- if ((var2 & 4) == 4) {
- ((Container)this).add(new Button(this.sortascending));
- ((Container)this).add(new Button(this.sortdescending));
- }
-
- }
-
- CFGRIDActionbar(CFGRID var1, Image var2, Image var3, Image var4, Image var5) {
- this.field_0 = var1;
- var1.actionBar = true;
- this.insert = " Insert ";
- this.delete = "Delete";
- this.sortascending = "A -> Z";
- this.sortdescending = "Z -> A";
- ((Container)this).setLayout(new FlowLayout(0, 10, 5));
- if (var2 != null) {
- CFGRIDActionButton var6 = new CFGRIDActionButton(this.insert, var2);
- ((Component)var6).resize(24, 24);
- ((Container)this).add(var6);
- }
-
- if (var3 != null) {
- CFGRIDActionButton var7 = new CFGRIDActionButton(this.delete, var3);
- ((Component)var7).resize(24, 24);
- ((Container)this).add(var7);
- }
-
- if (var4 != null) {
- CFGRIDActionButton var8 = new CFGRIDActionButton(this.sortascending, var4);
- ((Component)var8).resize(24, 24);
- ((Container)this).add(var8);
- }
-
- if (var5 != null) {
- CFGRIDActionButton var9 = new CFGRIDActionButton(this.sortdescending, var5);
- ((Component)var9).resize(24, 24);
- ((Container)this).add(var9);
- }
-
- }
-
- public boolean action(Event var1, Object var2) {
- if (this.field_0.caller == null) {
- return false;
- } else if (var2.equals(this.insert)) {
- this.field_0.caller.CFGRIDMessage(this.field_0, 560, (Rectangle)null);
- return true;
- } else if (var2.equals(this.delete)) {
- this.field_0.caller.CFGRIDMessage(this.field_0, 570, (Rectangle)null);
- return true;
- } else if (var2.equals(this.sortascending)) {
- this.field_0.caller.CFGRIDMessage(this.field_0, 580, (Rectangle)null);
- return true;
- } else if (var2.equals(this.sortdescending)) {
- this.field_0.caller.CFGRIDMessage(this.field_0, 581, (Rectangle)null);
- return true;
- } else {
- return false;
- }
- }
- }
-