text:
// Generated by xsd compiler for android/java
// DO NOT CHANGE!
package ebay.apis.eblbasecomponents;

import java.io.Serializable;
import com.leansoft.nano.annotation.*;
import java.util.Date;

/**
 *
 * Returns an array of notifications sent to a given application identified by the appID
 * (comes in the credentials). The result can be used by third-party developers troubleshoot
 * issues with notifications.
 * Zero, one or many notifications can be returned in the array. The set of notifications
 * returned is limited to those that were sent between the StartTime and EndTime specified
 * in the request. If StartTime or EndTime filters were not found in the request, then
 * the response will contain the data for only one day (Now-1day). By default, maximum
 * duration is limited to 3 days (Now-3days). These min (1day) and max(3days) applies
 * to Notifications,MarkDownMarkUpHistory and NotificationStatistics.
 *
 * Notifications are sent only if the ItemID is included in the request. If there is no
 * ItemID, then only Statistics and MarkDownMarkUpHistory information is included.
 *
 */
@RootElement(name = "GetNotificationsUsageResponse", namespace = "urn:ebay:apis:eBLBaseComponents")
public class GetNotificationsUsageResponseType extends AbstractResponseType implements Serializable {

    private static final long serialVersionUID = -1L;

	@Element(name = "StartTime")
	private Date startTime;

	@Element(name = "EndTime")
	private Date endTime;

	@Element(name = "NotificationDetailsArray")
	private NotificationDetailsArrayType notificationDetailsArray;

	@Element(name = "MarkUpMarkDownHistory")
	private MarkUpMarkDownHistoryType markUpMarkDownHistory;

	@Element(name = "NotificationStatistics")
	private NotificationStatisticsType notificationStatistics;

	/**
     * public getter
     *
     *
     * Returns the start date and time for the notification information that is
     * returned by this call. The oldest date allowed for this field is Now-3days.
     * Default is Now-1day.
     *
     *
     * @returns java.util.Date
	 */
	public Date getStartTime() {
	    return this.startTime;
	}

	/**
	 * public setter
	 *
     *
     * Returns the start date and time for the notification information that is
     * returned by this call. The oldest date allowed for this field is Now-3days.
     * Default is Now-1day.
     *
     *
     * @param java.util.Date
	 */
	public void setStartTime(Date startTime) {
	    this.startTime = startTime;
	}
	/**
     * public getter
     *
     *
     * Returns the end date and time for the notification information that is
     * returned by this call. The default is Now.
     *
     *
     * @returns java.util.Date
	 */
	public Date getEndTime() {
	    return this.endTime;
	}

	/**
	 * public setter
	 *
     *
     * Returns the end date and time for the notification information that is
     * returned by this call. The default is Now.
     *
     *
     * @param java.util.Date
	 */
	public void setEndTime(Date endTime) {
	    this.endTime = endTime;
	}
	/**
     * public getter
     *
     *
     * List of notification objects representing the notifications sent to an
     * application for the given time period. It will only be returned if ItemID
     * was specified in the input request.
     *
     *
     * @returns ebay.apis.eblbasecomponents.NotificationDetailsArrayType
	 */
	public NotificationDetailsArrayType getNotificationDetailsArray() {
	    return this.notificationDetailsArray;
	}

	/**
	 * public setter
	 *
     *
     * List of notification objects representing the notifications sent to an
     * application for the given time period. It will only be returned if ItemID
     * was specified in the input request.
     *
     *
     * @param ebay.apis.eblbasecomponents.NotificationDetailsArrayType
	 */
	public void setNotificationDetailsArray(NotificationDetailsArrayType notificationDetailsArray) {
	    this.notificationDetailsArray = notificationDetailsArray;
	}
	/**
     * public getter
     *
     *
     * List of objects representing MarkUp or MarkDown history for a given appID
     * and for given StartTime and EndTime. This node will always be returned.
     *
     *
     * @returns ebay.apis.eblbasecomponents.MarkUpMarkDownHistoryType
	 */
	public MarkUpMarkDownHistoryType getMarkUpMarkDownHistory() {
	    return this.markUpMarkDownHistory;
	}

	/**
	 * public setter
	 *
     *
     * List of objects representing MarkUp or MarkDown history for a given appID
     * and for given StartTime and EndTime. This node will always be returned.
     *
     *
     * @param ebay.apis.eblbasecomponents.MarkUpMarkDownHistoryType
	 */
	public void setMarkUpMarkDownHistory(MarkUpMarkDownHistoryType markUpMarkDownHistory) {
	    this.markUpMarkDownHistory = markUpMarkDownHistory;
	}
	/**
     * public getter
     *
     *
     * Summary information about number of notifications that were successfully
     * delivered, queued, failed, connection attempts made, connection timeouts,
     * http errors for the given appID and given time period. By default, statistics
     * for only one day (Now-1day) is included. Maximum time duration allowed is 3 days
     * (Now-3days).
     *
     *
     * @returns ebay.apis.eblbasecomponents.NotificationStatisticsType
	 */
	public NotificationStatisticsType getNotificationStatistics() {
	    return this.notificationStatistics;
	}

	/**
	 * public setter
	 *
     *
     * Summary information about number of notifications that were successfully
     * delivered, queued, failed, connection attempts made, connection timeouts,
     * http errors for the given appID and given time period. By default, statistics
     * for only one day (Now-1day) is included. Maximum time duration allowed is 3 days
     * (Now-3days).
     *
     *
     * @param ebay.apis.eblbasecomponents.NotificationStatisticsType
	 */
	public void setNotificationStatistics(NotificationStatisticsType notificationStatistics) {
	    this.notificationStatistics = notificationStatistics;
	}

}


text:
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { CoreComponent } from './core.component';
import { HomeComponent } from 'app/core/home/home.component';

import { Error404Component } from 'app/core/error/404/error404.component';

const routes: Routes = [
    {
        path: '',
        component: CoreComponent,
        children: [
            {
                path: '',
                redirectTo: 'home',
                pathMatch: 'full'
            },
            {
                path: 'home',
                component: HomeComponent
            },
            {
                path: '404',
                component: Error404Component
            }
        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class CoreRoutingModule {

}

redpajama_set_name: RedPajamaGithub


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/aiplatform/v1/endpoint_service.proto

package com.google.cloud.aiplatform.v1;

public final class EndpointServiceProto {
  private EndpointServiceProto() {}

  public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}

  public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
  }

  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_CreateEndpointRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_CreateEndpointRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_CreateEndpointOperationMetadata_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_CreateEndpointOperationMetadata_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_GetEndpointRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_GetEndpointRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_ListEndpointsRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_ListEndpointsRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_ListEndpointsResponse_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_ListEndpointsResponse_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_UpdateEndpointRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_UpdateEndpointRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_DeleteEndpointRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_DeleteEndpointRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_DeployModelRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_DeployModelRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_DeployModelRequest_TrafficSplitEntry_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_DeployModelRequest_TrafficSplitEntry_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_DeployModelResponse_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_DeployModelResponse_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_DeployModelOperationMetadata_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_DeployModelOperationMetadata_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_UndeployModelRequest_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_UndeployModelRequest_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_UndeployModelRequest_TrafficSplitEntry_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_UndeployModelRequest_TrafficSplitEntry_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_UndeployModelResponse_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_UndeployModelResponse_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1_UndeployModelOperationMetadata_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1_UndeployModelOperationMetadata_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
    return descriptor;
  }

  private static com.google.protobuf.Descriptors.FileDescriptor descriptor;

  static {
    java.lang.String[] descriptorData = {
      "\n1google/cloud/aiplatform/v1/endpoint_se"
          + "rvice.proto\022\032google.cloud.aiplatform.v1\032"
          + "\034google/api/annotations.proto\032\027google/ap"
          + "i/client.proto\032\037google/api/field_behavio"
          + "r.proto\032\031google/api/resource.proto\032)goog"
          + "le/cloud/aiplatform/v1/endpoint.proto\032*g"
          + "oogle/cloud/aiplatform/v1/operation.prot"
          + "o\032#google/longrunning/operations.proto\032 "
          + "google/protobuf/field_mask.proto\"\251\001\n\025Cre"
          + "ateEndpointRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372"
          + "A#\n!locations.googleapis.com/Location\022;\n"
          + "\010endpoint\030\002 \001(\0132$.google.cloud.aiplatfor"
          + "m.v1.EndpointB\003\340A\002\022\030\n\013endpoint_id\030\004 \001(\tB"
          + "\003\340A\005\"q\n\037CreateEndpointOperationMetadata\022"
          + "N\n\020generic_metadata\030\001 \001(\01324.google.cloud"
          + ".aiplatform.v1.GenericOperationMetadata\""
          + "N\n\022GetEndpointRequest\0228\n\004name\030\001 \001(\tB*\340A\002"
          + "\372A$\n\"aiplatform.googleapis.com/Endpoint\""
          + "\335\001\n\024ListEndpointsRequest\0229\n\006parent\030\001 \001(\t"
          + "B)\340A\002\372A#\n!locations.googleapis.com/Locat"
          + "ion\022\023\n\006filter\030\002 \001(\tB\003\340A\001\022\026\n\tpage_size\030\003 "
          + "\001(\005B\003\340A\001\022\027\n\npage_token\030\004 \001(\tB\003\340A\001\0222\n\trea"
          + "d_mask\030\005 \001(\0132\032.google.protobuf.FieldMask"
          + "B\003\340A\001\022\020\n\010order_by\030\006 \001(\t\"i\n\025ListEndpoints"
          + "Response\0227\n\tendpoints\030\001 \003(\0132$.google.clo"
          + "ud.aiplatform.v1.Endpoint\022\027\n\017next_page_t"
          + "oken\030\002 \001(\t\"\212\001\n\025UpdateEndpointRequest\022;\n\010"
          + "endpoint\030\001 \001(\0132$.google.cloud.aiplatform"
          + ".v1.EndpointB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032"
          + ".google.protobuf.FieldMaskB\003\340A\002\"Q\n\025Delet"
          + "eEndpointRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\""
          + "aiplatform.googleapis.com/Endpoint\"\250\002\n\022D"
          + "eployModelRequest\022<\n\010endpoint\030\001 \001(\tB*\340A\002"
          + "\372A$\n\"aiplatform.googleapis.com/Endpoint\022"
          + "F\n\016deployed_model\030\002 \001(\0132).google.cloud.a"
          + "iplatform.v1.DeployedModelB\003\340A\002\022W\n\rtraff"
          + "ic_split\030\003 \003(\0132@.google.cloud.aiplatform"
          + ".v1.DeployModelRequest.TrafficSplitEntry"
          + "\0323\n\021TrafficSplitEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va"
          + "lue\030\002 \001(\005:\0028\001\"X\n\023DeployModelResponse\022A\n\016"
          + "deployed_model\030\001 \001(\0132).google.cloud.aipl"
          + "atform.v1.DeployedModel\"n\n\034DeployModelOp"
          + "erationMetadata\022N\n\020generic_metadata\030\001 \001("
          + "\01324.google.cloud.aiplatform.v1.GenericOp"
          + "erationMetadata\"\204\002\n\024UndeployModelRequest"
          + "\022<\n\010endpoint\030\001 \001(\tB*\340A\002\372A$\n\"aiplatform.g"
          + "oogleapis.com/Endpoint\022\036\n\021deployed_model"
          + "_id\030\002 \001(\tB\003\340A\002\022Y\n\rtraffic_split\030\003 \003(\0132B."
          + "google.cloud.aiplatform.v1.UndeployModel"
          + "Request.TrafficSplitEntry\0323\n\021TrafficSpli"
          + "tEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\005:\0028\001\"\027"
          + "\n\025UndeployModelResponse\"p\n\036UndeployModel"
          + "OperationMetadata\022N\n\020generic_metadata\030\001 "
          + "\001(\01324.google.cloud.aiplatform.v1.Generic"
          + "OperationMetadata2\200\r\n\017EndpointService\022\202\002"
          + "\n\016CreateEndpoint\0221.google.cloud.aiplatfo"
          + "rm.v1.CreateEndpointRequest\032\035.google.lon"
          + "grunning.Operation\"\235\001\202\323\344\223\0029\"-/v1/{parent"
          + "=projects/*/locations/*}/endpoints:\010endp"
          + "oint\332A\017parent,endpoint\332A\033parent,endpoint"
          + ",endpoint_id\312A+\n\010Endpoint\022\037CreateEndpoin"
          + "tOperationMetadata\022\241\001\n\013GetEndpoint\022..goo"
          + "gle.cloud.aiplatform.v1.GetEndpointReque"
          + "st\032$.google.cloud.aiplatform.v1.Endpoint"
          + "\"<\202\323\344\223\002/\022-/v1/{name=projects/*/locations"
          + "/*/endpoints/*}\332A\004name\022\264\001\n\rListEndpoints"
          + "\0220.google.cloud.aiplatform.v1.ListEndpoi"
          + "ntsRequest\0321.google.cloud.aiplatform.v1."
          + "ListEndpointsResponse\">\202\323\344\223\002/\022-/v1/{pare"
          + "nt=projects/*/locations/*}/endpoints\332A\006p"
          + "arent\022\312\001\n\016UpdateEndpoint\0221.google.cloud."
          + "aiplatform.v1.UpdateEndpointRequest\032$.go"
          + "ogle.cloud.aiplatform.v1.Endpoint\"_\202\323\344\223\002"
          + "B26/v1/{endpoint.name=projects/*/locatio"
          + "ns/*/endpoints/*}:\010endpoint\332A\024endpoint,u"
          + "pdate_mask\022\323\001\n\016DeleteEndpoint\0221.google.c"
          + "loud.aiplatform.v1.DeleteEndpointRequest"
          + "\032\035.google.longrunning.Operation\"o\202\323\344\223\002/*"
          + "-/v1/{name=projects/*/locations/*/endpoi"
          + "nts/*}\332A\004name\312A0\n\025google.protobuf.Empty\022"
          + "\027DeleteOperationMetadata\022\205\002\n\013DeployModel"
          + "\022..google.cloud.aiplatform.v1.DeployMode"
          + "lRequest\032\035.google.longrunning.Operation\""
          + "\246\001\202\323\344\223\002B\"=/v1/{endpoint=projects/*/locat"
          + "ions/*/endpoints/*}:deployModel:\001*\332A%end"
          + "point,deployed_model,traffic_split\312A3\n\023D"
          + "eployModelResponse\022\034DeployModelOperation"
          + "Metadata\022\222\002\n\rUndeployModel\0220.google.clou"
          + "d.aiplatform.v1.UndeployModelRequest\032\035.g"
          + "oogle.longrunning.Operation\"\257\001\202\323\344\223\002D\"?/v"
          + "1/{endpoint=projects/*/locations/*/endpo"
          + "ints/*}:undeployModel:\001*\332A(endpoint,depl"
          + "oyed_model_id,traffic_split\312A7\n\025Undeploy"
          + "ModelResponse\022\036UndeployModelOperationMet"
          + "adata\032M\312A\031aiplatform.googleapis.com\322A.ht"
          + "tps://www.googleapis.com/auth/cloud-plat"
          + "formB\330\001\n\036com.google.cloud.aiplatform.v1B"
          + "\024EndpointServiceProtoP\001ZDgoogle.golang.o"
          + "rg/genproto/googleapis/cloud/aiplatform/"
          + "v1;aiplatform\252\002\032Google.Cloud.AIPlatform."
          + "V1\312\002\032Google\\Cloud\\AIPlatform\\V1\352\002\035Google"
          + "::Cloud::AIPlatform::V1b\006proto3"
    };
    descriptor =
        com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
            descriptorData,
            new com.google.protobuf.Descriptors.FileDescriptor[] {
              com.google.api.AnnotationsProto.getDescriptor(),
              com.google.api.ClientProto.getDescriptor(),
              com.google.api.FieldBehaviorProto.getDescriptor(),
              com.google.api.ResourceProto.getDescriptor(),
              com.google.cloud.aiplatform.v1.EndpointProto.getDescriptor(),
              com.google.cloud.aiplatform.v1.OperationProto.getDescriptor(),
              com.google.longrunning.OperationsProto.getDescriptor(),
              com.google.protobuf.FieldMaskProto.getDescriptor(),
            });
    internal_static_google_cloud_aiplatform_v1_CreateEndpointRequest_descriptor =
        getDescriptor().getMessageTypes().get(0);
    internal_static_google_cloud_aiplatform_v1_CreateEndpointRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_CreateEndpointRequest_descriptor,
            new java.lang.String[] {
              "Parent", "Endpoint", "EndpointId",
            });
    internal_static_google_cloud_aiplatform_v1_CreateEndpointOperationMetadata_descriptor =
        getDescriptor().getMessageTypes().get(1);
    internal_static_google_cloud_aiplatform_v1_CreateEndpointOperationMetadata_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_CreateEndpointOperationMetadata_descriptor,
            new java.lang.String[] {
              "GenericMetadata",
            });
    internal_static_google_cloud_aiplatform_v1_GetEndpointRequest_descriptor =
        getDescriptor().getMessageTypes().get(2);
    internal_static_google_cloud_aiplatform_v1_GetEndpointRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_GetEndpointRequest_descriptor,
            new java.lang.String[] {
              "Name",
            });
    internal_static_google_cloud_aiplatform_v1_ListEndpointsRequest_descriptor =
        getDescriptor().getMessageTypes().get(3);
    internal_static_google_cloud_aiplatform_v1_ListEndpointsRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_ListEndpointsRequest_descriptor,
            new java.lang.String[] {
              "Parent", "Filter", "PageSize", "PageToken", "ReadMask", "OrderBy",
            });
    internal_static_google_cloud_aiplatform_v1_ListEndpointsResponse_descriptor =
        getDescriptor().getMessageTypes().get(4);
    internal_static_google_cloud_aiplatform_v1_ListEndpointsResponse_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_ListEndpointsResponse_descriptor,
            new java.lang.String[] {
              "Endpoints", "NextPageToken",
            });
    internal_static_google_cloud_aiplatform_v1_UpdateEndpointRequest_descriptor =
        getDescriptor().getMessageTypes().get(5);
    internal_static_google_cloud_aiplatform_v1_UpdateEndpointRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_UpdateEndpointRequest_descriptor,
            new java.lang.String[] {
              "Endpoint", "UpdateMask",
            });
    internal_static_google_cloud_aiplatform_v1_DeleteEndpointRequest_descriptor =
        getDescriptor().getMessageTypes().get(6);
    internal_static_google_cloud_aiplatform_v1_DeleteEndpointRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_DeleteEndpointRequest_descriptor,
            new java.lang.String[] {
              "Name",
            });
    internal_static_google_cloud_aiplatform_v1_DeployModelRequest_descriptor =
        getDescriptor().getMessageTypes().get(7);
    internal_static_google_cloud_aiplatform_v1_DeployModelRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_DeployModelRequest_descriptor,
            new java.lang.String[] {
              "Endpoint", "DeployedModel", "TrafficSplit",
            });
    internal_static_google_cloud_aiplatform_v1_DeployModelRequest_TrafficSplitEntry_descriptor =
        internal_static_google_cloud_aiplatform_v1_DeployModelRequest_descriptor
            .getNestedTypes()
            .get(0);
    internal_static_google_cloud_aiplatform_v1_DeployModelRequest_TrafficSplitEntry_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_DeployModelRequest_TrafficSplitEntry_descriptor,
            new java.lang.String[] {
              "Key", "Value",
            });
    internal_static_google_cloud_aiplatform_v1_DeployModelResponse_descriptor =
        getDescriptor().getMessageTypes().get(8);
    internal_static_google_cloud_aiplatform_v1_DeployModelResponse_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_DeployModelResponse_descriptor,
            new java.lang.String[] {
              "DeployedModel",
            });
    internal_static_google_cloud_aiplatform_v1_DeployModelOperationMetadata_descriptor =
        getDescriptor().getMessageTypes().get(9);
    internal_static_google_cloud_aiplatform_v1_DeployModelOperationMetadata_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_DeployModelOperationMetadata_descriptor,
            new java.lang.String[] {
              "GenericMetadata",
            });
    internal_static_google_cloud_aiplatform_v1_UndeployModelRequest_descriptor =
        getDescriptor().getMessageTypes().get(10);
    internal_static_google_cloud_aiplatform_v1_UndeployModelRequest_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_UndeployModelRequest_descriptor,
            new java.lang.String[] {
              "Endpoint", "DeployedModelId", "TrafficSplit",
            });
    internal_static_google_cloud_aiplatform_v1_UndeployModelRequest_TrafficSplitEntry_descriptor =
        internal_static_google_cloud_aiplatform_v1_UndeployModelRequest_descriptor
            .getNestedTypes()
            .get(0);
    internal_static_google_cloud_aiplatform_v1_UndeployModelRequest_TrafficSplitEntry_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_UndeployModelRequest_TrafficSplitEntry_descriptor,
            new java.lang.String[] {
              "Key", "Value",
            });
    internal_static_google_cloud_aiplatform_v1_UndeployModelResponse_descriptor =
        getDescriptor().getMessageTypes().get(11);
    internal_static_google_cloud_aiplatform_v1_UndeployModelResponse_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_UndeployModelResponse_descriptor,
            new java.lang.String[] {});
    internal_static_google_cloud_aiplatform_v1_UndeployModelOperationMetadata_descriptor =
        getDescriptor().getMessageTypes().get(12);
    internal_static_google_cloud_aiplatform_v1_UndeployModelOperationMetadata_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1_UndeployModelOperationMetadata_descriptor,
            new java.lang.String[] {
              "GenericMetadata",
            });
    com.google.protobuf.ExtensionRegistry registry =
        com.google.protobuf.ExtensionRegistry.newInstance();
    registry.add(com.google.api.ClientProto.defaultHost);
    registry.add(com.google.api.FieldBehaviorProto.fieldBehavior);
    registry.add(com.google.api.AnnotationsProto.http);
    registry.add(com.google.api.ClientProto.methodSignature);
    registry.add(com.google.api.ClientProto.oauthScopes);
    registry.add(com.google.api.ResourceProto.resourceReference);
    registry.add(com.google.longrunning.OperationsProto.operationInfo);
    com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor(
        descriptor, registry);
    com.google.api.AnnotationsProto.getDescriptor();
    com.google.api.ClientProto.getDescriptor();
    com.google.api.FieldBehaviorProto.getDescriptor();
    com.google.api.ResourceProto.getDescriptor();
    com.google.cloud.aiplatform.v1.EndpointProto.getDescriptor();
    com.google.cloud.aiplatform.v1.OperationProto.getDescriptor();
    com.google.longrunning.OperationsProto.getDescriptor();
    com.google.protobuf.FieldMaskProto.getDescriptor();
  }

  // @@protoc_insertion_point(outer_class_scope)
}


text:
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>sap.m.UploadCollection for Pending Upload File List</title>

		<script src="shared-config.js"></script>
		<script id="sap-ui-bootstrap"
				src="../../../resources/sap-ui-core.js"
				data-sap-ui-async="true"
				data-sap-ui-compatVersion="edge"
				data-sap-ui-libs="sap.m"
				data-sap-ui-onInit="module:local/UploadCollectionForPendingUpload"
				data-sap-ui-resourceRoots='{
					"local": "./",
					"qunit.internal.acc": "../../../test-resources/sap/ui/core/qunit/internal/acc"
				}'>
		</script>
	</head>
	<body id="body" class="sapUiBody">
	</body>
</html>


text:
package com.aopphp.go.psi.impl;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.util.PsiTreeUtil;
import static com.aopphp.go.psi.PointcutTypes.*;
import com.intellij.extapi.psi.ASTWrapperPsiElement;
import com.aopphp.go.psi.*;
import com.aopphp.go.pointcut.Pointcut;

public class ConjugatedExpressionImpl extends ASTWrapperPsiElement implements ConjugatedExpression {

  public ConjugatedExpressionImpl(ASTNode node) {
    super(node);
  }

  public void accept(@NotNull PsiElementVisitor visitor) {
    if (visitor instanceof Visitor) ((Visitor)visitor).visitConjugatedExpression(this);
    else super.accept(visitor);
  }

  @Override
  @Nullable
  public ConjugatedExpression getConjugatedExpression() {
    return findChildByClass(ConjugatedExpression.class);
  }

  @Override
  @NotNull
  public NegatedExpression getNegatedExpression() {
    return findNotNullChildByClass(NegatedExpression.class);
  }

  public Pointcut resolveConjugatedExpression() {
    return PointcutQueryPsiUtil.resolveConjugatedExpression(this);
  }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />

  <title>Class: NumerosRacionales</title>

  <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />

          Home
          Classes
          Methods

In Files

lib/racionales.rb

Parent

Object

Methods

::new

#%

#*

#+

#-

#-@

#/

#<

#<=

#<=>

#==

#>

#>=

#abs

#coerce

#denom

#num

#reciprocal

#simplificar

#to_f

#to_s

Files

Gemfile

Guardfile

LICENSE

Rakefile

Rakefile~

Class/Module Index

        <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
        <fieldset>
          <legend>Quicksearch</legend>
          <input type="text" name="quicksearch" value=""
            class="quicksearch-field" />
        </fieldset>
        </form>

Matriz

Matriz_densa

Matriz_dispersa

NumerosRacionales

Object

Test_Matriz

No matching classes.

NumerosRacionales

Attributes

            a[R]

            b[R]

Public Class Methods

            new(a, b)
            click to toggle source

# File lib/racionales.rb, line 6
def initialize (a, b) # Crea un numero racional con numerador a y denominador b
  raise ZeroDivisionError, "Denominador igual a cero" if (b==0)
  if (a<0) and (b<0) #si los dos son negativos => nos queda positivo
    a,b= -a,-b
  end
  simplifica = gcd(a,b)
  @a,@b = a/simplifica,b/simplifica
end

Public Instance Methods

            %(other)
            click to toggle source

# File lib/racionales.rb, line 100
def %(other) # Halla el modulo de una fraccion
  tmp = (self/other).abs
  t = NumerosRacionales.new(1,1)
  tmp= t-tmp
  NumerosRacionales.new(tmp.num, tmp.denom)
end

            *(other)
            click to toggle source

# File lib/racionales.rb, line 74
def *(other)  # Calcula la multiplicaciones de dos racionales
  if (other.is_a?(Numeric))
    other=self.coerce(other)
    other=other[0]
  end
  num = @a*other.a
  deno = @b*other.b
  simplifica = gcd(num,deno)                  #averiguamos el valor para obtener el racional irreducible
  if ((num < 0) and (deno < 0)) or ((num > 0) and (deno < 0)) #corregimos el signo
    num = num * (-1)
    deno = deno * (-1)
  end
  NumerosRacionales.new(num/simplifica,deno/simplifica)
end

            +(other)
            click to toggle source

# File lib/racionales.rb, line 44
  def +(other) # Calcula la suma de racionales o racionales con enteros
    if (other.is_a?(Integer))
#       other=self.coerce(other)
      other=NumerosRacionales.new(other,1)
    end
    deno = mcm(@b, other.b)                     #MCM para hallar el denominador
    num = ((deno/@b) * @a) + ((deno/other.b) * other.a)
    simplifica = gcd(num,deno)                  #averiguamos el valor para obtener el racional irreducible
    if ((num < 0) and (deno < 0)) or ((num > 0) and (deno < 0)) #corregimos el signo
      num = num * (-1)
      deno = deno * (-1)
    end
    NumerosRacionales.new(num/simplifica,deno/simplifica)
  end

            -(other)
            click to toggle source

# File lib/racionales.rb, line 59
def -(other)  # Calcula la resta de racionales o racionales con enteros
  if (other.is_a?(Numeric))
    other=self.coerce(other)
    other=other[0]
  end
  deno = mcm(@b, other.b)                     #MCM para hallar el denominador
  num = ((deno/@b) * @a) - ((deno/other.b) * other.a)
  simplifica = gcd(num,deno)                  #averiguamos el valor para obtener el racional irreducible
  if ((num < 0) and (deno < 0)) or ((num > 0) and (deno < 0)) #corregimos el signo
    num = num * (-1)
    deno = deno * (-1)
  end
  NumerosRacionales.new(num/simplifica,deno/simplifica)
end

            -@()
            click to toggle source

# File lib/racionales.rb, line 168
def -@ # Calcula el opuesto de un racional
    NumerosRacionales.new(-self.num,self.denom)
end

            /(other)
            click to toggle source

# File lib/racionales.rb, line 89
def /(other) # Calcula la division de dos racionales
  num = @a*other.b
  deno = @b*other.a
  simplifica = gcd(num,deno)                 #averiguamos el valor para obtener el racional irreducible
 if ((num < 0) and (deno < 0)) or ((num > 0) and (deno < 0)) #corregimos el signo
   num = num * (-1)
   deno = deno * (-1)
 end
  NumerosRacionales.new(num/simplifica,deno/simplifica)
end

            <(other)
            click to toggle source

# File lib/racionales.rb, line 121
def <(other) # Compara si un numero racional es menor que otro
  if (self.to_f < other.to_f)
    true
  else
    false
  end
end

            <=(other)
            click to toggle source

# File lib/racionales.rb, line 129
def <=(other) # Compara si un numero racional es menor o igual que otro
  if (self.to_f <= other.to_f)
    true
  else
    false
  end
end

            <=>(other)
            click to toggle source

# File lib/racionales.rb, line 153
def <=>(other) # Compara si un numero racional distinto otro
  self.to_f <=> other.to_f
end

            ==(other)
            click to toggle source

# File lib/racionales.rb, line 113
def ==(other) # Compara si dos numeros racionales son iguales
  if (self.to_f == other.to_f)
    true
  else
    false
  end
end

            >(other)
            click to toggle source

# File lib/racionales.rb, line 137
def >(other) # Compara si un numero racional es mayor que otro
  if (self.to_f > other.to_f)
    true
  else
    false
  end
end

            >=(other)
            click to toggle source

# File lib/racionales.rb, line 145
def >=(other) # Compara si un numero racional es mayor o igual que otro
  if (self.to_f >= other.to_f)
    true
  else
    false
  end
end

            abs()
            click to toggle source

# File lib/racionales.rb, line 157
def abs # Calcula el valor absoluto de un racional
  n, d = @a.abs, @b.abs
  NumerosRacionales.new(n,d)
end

            coerce(other)
            click to toggle source

# File lib/racionales.rb, line 107
def coerce(other) # Hace una conversion de enteros a racionales
  if (other.is_a?(Integer))
    [NumerosRacionales.new(other.to_i,1),self]
  end
end

            denom()
            click to toggle source

# File lib/racionales.rb, line 19
def denom()# Devuelve el valor del denominador
  @b
end

            num()
            click to toggle source

# File lib/racionales.rb, line 15
def num() # Devuelve el valor del numerador
  @a
end

            reciprocal()
            click to toggle source

# File lib/racionales.rb, line 162
def reciprocal # Calcula el inverso de un racional
  inv = NumerosRacionales.new(1,1)
  tmp = inv/self
  NumerosRacionales.new(tmp.num,tmp.denom)
end

            simplificar()
            click to toggle source

# File lib/racionales.rb, line 39
def simplificar # Simplifica el numero racional
  simplifica = gcd(@a,@b)
  NumerosRacionales.new(@a/simplifica,@b/simplifica)
end

            to_f()
            click to toggle source

# File lib/racionales.rb, line 33
def to_f # Pasa a flotante un numero racional
  tmp=@a.to_f/@b.to_f
  return tmp
end

            to_s()
            click to toggle source

# File lib/racionales.rb, line 23
def to_s # Muestra por pantalla el racional
  if (@a == 0) #numerador = 0, racional = 0. El denominador lo controlamos en el constructor
    "0"
  elsif (@b==1)
    "#{@a}"
  else
    "#{@a}/#{@b}"
  end
end

[Validate]

Generated with the Darkfish
      Rdoc Generator 2.


text:
Template.collaboratorSubmit.events({
  'submit form': function(e) {
    e.preventDefault();

    var collaborator = {
      collaborator_name: $(e.target).find('[name=collaborator_name]').val(),
      email: $(e.target).find('[name=email]').val(),
      projectId: Session.get('currentProject')
    };

    Meteor.call('collaboratorInsert', collaborator, function(error, result) {
      if (error) {
        return throwError(error.reason);
      }

      Projects.update(collaborator.projectId, {$inc: {collaboratorsCount: 1}});

      throwNotification('Collaborator has been added successfully');
      Router.go('collaboratorsList', {projectId: collaborator.projectId});
    });
  }
});

Template.collaboratorSubmit.created = function() {
  Session.set('collaboratorSubmitErrors', {});
}

Template.collaboratorSubmit.helpers({
  errorMessage: function(field) {
    return Session.get('collaboratorSubmitErrors')[field];
  },
  errorClass: function (field) {
    return !!Session.get('collaboratorSubmitErrors')[field] ? 'has-error' : '';
  },
  currentProject: function() {
    return Session.get('currentProject');
  }
});


text:
import logging
import gh
import storage
import event
import monitoring
import policy
from config import GetCtx

def create_client(ctx):
    return gh.Client(ctx.get('github', {}))

def create_storage(ctx):
    return storage.BuildStorage(ctx.get('storage', {}))

def setup_database(ctx):
    monitoring.ConfigureMonitoring(ctx.get('database', {}))

def setup_logging(ctx):
    lctx = ctx.get('logging', {})
    level = lctx.get('level', 'INFO')

    logging.basicConfig(
        format='%(asctime)-15s %(name)-12s %(levelname)-8s: %(message)s',
        level=level
    )

def setup_events(ctx):
    event.ConfigureHandlers(ctx.get('event', {}))

def setup_policies(ctx):
    policy.ConfigurePolicies(ctx.get('policy', {}))

def main():
    ctx = GetCtx()

    setup_logging(ctx)
    setup_database(ctx)
    setup_events(ctx)
    setup_policies(ctx)

    g = create_client(ctx)

    s = create_storage(ctx)

    g.rate_limit()
    event.ProcessEvents(g, s)
    policy.ApplyPolicies(g)

    logging.info('Flushing ops...')
    monitoring.FlushDatabaseWrites(align_points=True)
    logging.info('...done')

if __name__ == '__main__':
    main()


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TradeHub.NotificationEngine.Common.Constants
{
    /// <summary>
    /// Types of notifications supported
    /// </summary>
    public enum NotificationType
    {
        Email
    }
}


text:
This guide will show you step by step how to get started with `fastlane` for your Android project.

## Initial setup

Install `fastlane` if you haven't already

    sudo gem install fastlane --verbose

Navigate your terminal to your project directory and run

```
fastlane init
```

Feel free to skip any of these inputs by submitting with empty without entering anything.

### Package Name

That's your package name, which usually looks something like `com.krausefx.app`

### Google Play Access

To enable `fastlane` to access Google Play you have to follow these steps:

- Open the [Google Play Console](https://play.google.com/apps/publish/)
- Select **Settings** tab, followed by the **API access** tab
- Click the **Create Service Account** button and follow the **Google Developers Console** link in the dialog
- Click the **Create Service account** button at the top of the developers console screen
- Provide a name for the service account
- Click **Select a role** and choose **Project > Service Account Actor**
- Check the **Furnish a new private key** checkbox
- Select **JSON** as the Key type
- Click **Create** to close the dialog
- Make a note of the file name of the JSON file downloaded to your computer
- Back on the Google Play developer console, click **Done** to close the dialog
- Click on **Grant Access** for the newly added service account
- Choose **Release Manager** from the **Role** dropdown
- Click **Add user** to close the dialog

### JSON Key

The path to the json secret file that you're asked for should be the JSON file you downloaded from Google Play Console

### Finishing up

You'll be asked if you want to start using [supply](https://github.com/fastlane/fastlane/tree/master/supply). Do it if you plan on upload screenshots or binaries to Google Play.

### Editing the configuration files

`fastlane` created 2 important files and a metadata folder for you

##### `fastlane/Fastfile`

This file contains the actual deployment process. It defines which steps to run in which order. Check out [Actions.md](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md) for a list of all available integrations.

##### `fastlane/Appfile`

Contains basic metadata of your app that can be used by the actions you define in your `Fastfile`

##### `fastlane/metadata/android`

This folder contains the metadata fetched from Google Play. You can modify any values here and run `supply` to upload the updated metadata.

### Next Steps

Go ahead and modify the `Fastfile` to fit your needs. You might want to add the API Keys to your `crashlytics` action or your Slack URL to show notifications in your Slack room.

To get a list of all available integrations run

```
fastlane actions --platform android
```

and to get more information about what a specific action does and the available parameters use

```
fastlane action [action_name]
```

For more information, visit [Actions.md](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md).


text:
package com.github.why168.baseview.widget;

import java.util.ArrayList;

/**
 * GroupDescriptor
 *
 * @author Edwin.Wu
 * @version 2016/5/27 23:54
 * @since JDK1.8
 */
public class GroupDescriptor {
    public String title;
    public ArrayList<BaseRowDescriptor> descriptors;

    public GroupDescriptor(ArrayList<BaseRowDescriptor> descriptors) {
        this.descriptors = descriptors;
    }

    public GroupDescriptor(String title, ArrayList<BaseRowDescriptor> descriptors) {
        this.title = title;
        this.descriptors = descriptors;
    }
}


text:
/*
 * David Bismut, davidou@mageos.com
 * Intern, SETLabs, Infosys Technologies Ltd. May 2004 - Jul 2004
 * Ecole des Mines de Nantes, France
 */

/*
 *
 * Extended from
 * @(#)BasicTabbedPaneUI.java	1.126 03/01/23
 *
 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

package gov.nih.nci.restgen.ui.main;

import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Event;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.LayoutManager;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ContainerEvent;
import java.awt.event.ContainerListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.image.BufferedImage;
import java.util.Hashtable;
import java.util.Vector;

import javax.swing.AbstractAction;
import javax.swing.ActionMap;
import javax.swing.Icon;
import javax.swing.InputMap;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JTabbedPane;
import javax.swing.JViewport;
import javax.swing.KeyStroke;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.SoftBevelBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.ActionMapUIResource;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.InputMapUIResource;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.basic.BasicArrowButton;
import javax.swing.plaf.basic.BasicHTML;
import javax.swing.plaf.basic.BasicTabbedPaneUI;
import javax.swing.text.View;

import com.sun.java.swing.plaf.windows.WindowsIconFactory;

/**
 * UI for CloseAndMaxTabbedPane.
 *

 * Credits to:
 *
 * @author Amy Fowler
 * @author Philip Milne
 * @author Steve Wilson
 * @author Tom Santos
 * @author Dave Moore
 */
public class CloseTabPaneUI extends BasicTabbedPaneUI {

	// Instance variables initialized at installation

	private ContainerListener containerListener;

	private Vector htmlViews;

	private Hashtable mnemonicToIndexMap;

	/**
	 * InputMap used for mnemonics. Only non-null if the JTabbedPane has
	 * mnemonics associated with it. Lazily created in initMnemonics.
	 */
	private InputMap mnemonicInputMap;

	// For use when tabLayoutPolicy = SCROLL_TAB_LAYOUT
	protected ScrollableTabSupport tabScroller;

	private int tabCount;

	protected MyMouseMotionListener motionListener;

	// UI creation

	private static final int INACTIVE = 0;

	private static final int OVER = 1;

	private static final int PRESSED = 2;

	protected static final int BUTTONSIZE = 15;

	protected static final int WIDTHDELTA = 5;

	private static final Border PRESSEDBORDER = new SoftBevelBorder(
			SoftBevelBorder.LOWERED);

	private static final Border OVERBORDER = new SoftBevelBorder(
			SoftBevelBorder.RAISED);

	private BufferedImage closeImgB;

	private BufferedImage maxImgB;

	private BufferedImage closeImgI;

	private BufferedImage maxImgI;

	private JButton closeB;

	private JButton maxB;

	private int overTabIndex = -1;

	private int closeIndexStatus = INACTIVE;

	private int maxIndexStatus = INACTIVE;

	private boolean mousePressed = false;

	private boolean isCloseButtonEnabled = true;

	private boolean isMaxButtonEnabled = false;

	protected JPopupMenu actionPopupMenu;

	protected JMenuItem maxItem;

	protected JMenuItem closeItem;

	public CloseTabPaneUI() {

		super();

		closeImgB = new BufferedImage(BUTTONSIZE, BUTTONSIZE,
				BufferedImage.TYPE_4BYTE_ABGR);

		maxImgB = new BufferedImage(BUTTONSIZE, BUTTONSIZE,
				BufferedImage.TYPE_4BYTE_ABGR);

		closeImgI = new BufferedImage(BUTTONSIZE, BUTTONSIZE,
				BufferedImage.TYPE_4BYTE_ABGR);

		maxImgI = new BufferedImage(BUTTONSIZE, BUTTONSIZE,
				BufferedImage.TYPE_4BYTE_ABGR);

		closeB = new JButton();
		closeB.setSize(BUTTONSIZE, BUTTONSIZE);

		maxB = new JButton();
		maxB.setSize(BUTTONSIZE, BUTTONSIZE);

		WindowsIconFactory.createFrameCloseIcon().paintIcon(closeB,
				closeImgI.createGraphics(), 0, 0);

		WindowsIconFactory.createFrameMaximizeIcon().paintIcon(maxB,
				maxImgI.createGraphics(), 0, 0);

		actionPopupMenu = new JPopupMenu();

		maxItem = new JMenuItem("Detach");
		closeItem = new JMenuItem("Close");

		maxItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				((CloseAndMaxTabbedPane) tabPane).fireMaxTabEvent(null, tabPane.getSelectedIndex());
			}
		});

		closeItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				((CloseAndMaxTabbedPane) tabPane).fireCloseTabEvent(null, tabPane.getSelectedIndex());

			}
		});

		setPopupMenu();
	}

	protected boolean isOneActionButtonEnabled() {
		return isCloseButtonEnabled || isMaxButtonEnabled;
	}

	public boolean isCloseEnabled() {
		return isCloseButtonEnabled;
	}

	public boolean isMaxEnabled() {
		return isMaxButtonEnabled;
	}

	public void setCloseIcon(boolean b) {
		isCloseButtonEnabled = b;
		setPopupMenu();
	}

	public void setMaxIcon(boolean b) {
		isMaxButtonEnabled = b;
		setPopupMenu();
	}

	private void setPopupMenu() {
		actionPopupMenu.removeAll();
		if (isMaxButtonEnabled)
			actionPopupMenu.add(maxItem);
		if (isMaxButtonEnabled && isCloseButtonEnabled)
			actionPopupMenu.addSeparator();
		if (isCloseButtonEnabled)
			actionPopupMenu.add(closeItem);
	}

	protected int calculateTabWidth(int tabPlacement, int tabIndex,
			FontMetrics metrics) {
		int delta = 2;
		if (!isOneActionButtonEnabled())
			delta += 6;
		else {
			if (isCloseButtonEnabled)
				delta += BUTTONSIZE + WIDTHDELTA;
			if (isMaxButtonEnabled)
				delta += BUTTONSIZE + WIDTHDELTA;
		}

		return super.calculateTabWidth(tabPlacement, tabIndex, metrics) + delta;
	}

	protected int calculateTabHeight(int tabPlacement, int tabIndex,
			int fontHeight) {

		return super.calculateTabHeight(tabPlacement, tabIndex, fontHeight) + 5;
	}

	protected void layoutLabel(int tabPlacement, FontMetrics metrics,
			int tabIndex, String title, Icon icon, Rectangle tabRect,
			Rectangle iconRect, Rectangle textRect, boolean isSelected) {
		textRect.x = textRect.y = iconRect.x = iconRect.y = 0;

		View v = getTextViewForTab(tabIndex);
		if (v != null) {
			tabPane.putClientProperty("html", v);
		}

		SwingUtilities.layoutCompoundLabel((JComponent) tabPane, metrics,
				title, icon, SwingUtilities.CENTER, SwingUtilities.LEFT,
				SwingUtilities.CENTER, SwingUtilities.CENTER, tabRect,
				iconRect, textRect, textIconGap);

		tabPane.putClientProperty("html", null);

		iconRect.x = tabRect.x + 8;
		textRect.x = iconRect.x + iconRect.width + textIconGap;
	}

	protected MouseListener createMouseListener() {
		return new MyMouseHandler();
	}

	protected ScrollableTabButton createScrollableTabButton(int direction) {
		return new ScrollableTabButton(direction);
	}

	protected Rectangle newCloseRect(Rectangle rect) {
		int dx = rect.x + rect.width;
		int dy = (rect.y + rect.height) / 2 - 6;
		return new Rectangle(dx - BUTTONSIZE - WIDTHDELTA, dy, BUTTONSIZE,
				BUTTONSIZE);
	}

	protected Rectangle newMaxRect(Rectangle rect) {
		int dx = rect.x + rect.width;
		int dy = (rect.y + rect.height) / 2 - 6;
		if (isCloseButtonEnabled)
			dx -= BUTTONSIZE;

		return new Rectangle(dx - BUTTONSIZE - WIDTHDELTA, dy, BUTTONSIZE,
				BUTTONSIZE);
	}

	protected void updateOverTab(int x, int y) {
		if (overTabIndex != (overTabIndex = getTabAtLocation(x, y)))
			tabScroller.tabPanel.repaint();

	}

	protected void updateCloseIcon(int x, int y) {

		if (overTabIndex != -1) {
			int newCloseIndexStatus = INACTIVE;

			Rectangle closeRect = newCloseRect(rects[overTabIndex]);
			if (closeRect.contains(x, y))
				newCloseIndexStatus = mousePressed ? PRESSED : OVER;

			if (closeIndexStatus != (closeIndexStatus = newCloseIndexStatus))
				tabScroller.tabPanel.repaint();
		}
	}

	protected void updateMaxIcon(int x, int y) {
		if (overTabIndex != -1) {
			int newMaxIndexStatus = INACTIVE;

			Rectangle maxRect = newMaxRect(rects[overTabIndex]);

			if (maxRect.contains(x, y))
				newMaxIndexStatus = mousePressed ? PRESSED : OVER;

			if (maxIndexStatus != (maxIndexStatus = newMaxIndexStatus))
				tabScroller.tabPanel.repaint();
		}
	}

	private void setTabIcons(int x, int y) {
		//if the mouse isPressed
		if (! mousePressed) {
			updateOverTab(x, y);
		}

		if (isCloseButtonEnabled)
			updateCloseIcon(x, y);
		if (isMaxButtonEnabled)
			updateMaxIcon(x, y);
	}

	public static ComponentUI createUI(JComponent c) {
		return new CloseTabPaneUI();
	}

	/**
	 * Invoked by installUI to create a layout manager object to
	 * manage the JTabbedPane.
	 *
	 * @return a layout manager object
	 *
	 * @see TabbedPaneLayout
	 * @see javax.swing.JTabbedPane#getTabLayoutPolicy
	 */
	protected LayoutManager createLayoutManager() {

		return new TabbedPaneScrollLayout();

	}

	/*
	 * In an attempt to preserve backward compatibility for programs which have
	 * extended BasicTabbedPaneUI to do their own layout, the UI uses the
	 * installed layoutManager (and not tabLayoutPolicy) to determine if
	 * scrollTabLayout is enabled.
	 */

	/**
	 * Creates and installs any required subcomponents for the JTabbedPane.
	 * Invoked by installUI.
	 *
	 * @since 1.4
	 */
	protected void installComponents() {

		if (tabScroller == null) {
			tabScroller = new ScrollableTabSupport(tabPane.getTabPlacement());
			tabPane.add(tabScroller.viewport);
			tabPane.add(tabScroller.scrollForwardButton);
			tabPane.add(tabScroller.scrollBackwardButton);
		}

	}

	/**
	 * Removes any installed subcomponents from the JTabbedPane. Invoked by
	 * uninstallUI.
	 *
	 * @since 1.4
	 */
	protected void uninstallComponents() {

		tabPane.remove(tabScroller.viewport);
		tabPane.remove(tabScroller.scrollForwardButton);
		tabPane.remove(tabScroller.scrollBackwardButton);
		tabScroller = null;

	}

	protected void installListeners() {
		if ((propertyChangeListener = createPropertyChangeListener()) != null) {
			tabPane.addPropertyChangeListener(propertyChangeListener);
		}
		if ((tabChangeListener = createChangeListener()) != null) {
			tabPane.addChangeListener(tabChangeListener);
		}
		if ((mouseListener = createMouseListener()) != null) {
			tabScroller.tabPanel.addMouseListener(mouseListener);
		}

		if ((focusListener = createFocusListener()) != null) {
			tabPane.addFocusListener(focusListener);
		}

		// PENDING(api) : See comment for ContainerHandler
		if ((containerListener = new ContainerHandler()) != null) {
			tabPane.addContainerListener(containerListener);
			if (tabPane.getTabCount() > 0) {
				htmlViews = createHTMLVector();
			}
		}

		if ((motionListener = new MyMouseMotionListener()) != null) {
			tabScroller.tabPanel.addMouseMotionListener(motionListener);
		}

	}

	protected void uninstallListeners() {
		if (mouseListener != null) {
			tabScroller.tabPanel.removeMouseListener(mouseListener);
			mouseListener = null;
		}

		if (motionListener != null) {
			tabScroller.tabPanel.removeMouseMotionListener(motionListener);
			motionListener = null;
		}

		if (focusListener != null) {
			tabPane.removeFocusListener(focusListener);
			focusListener = null;
		}

		// PENDING(api): See comment for ContainerHandler
		if (containerListener != null) {
			tabPane.removeContainerListener(containerListener);
			containerListener = null;
			if (htmlViews != null) {
				htmlViews.removeAllElements();
				htmlViews = null;
			}
		}
		if (tabChangeListener != null) {
			tabPane.removeChangeListener(tabChangeListener);
			tabChangeListener = null;
		}
		if (propertyChangeListener != null) {
			tabPane.removePropertyChangeListener(propertyChangeListener);
			propertyChangeListener = null;
		}

	}

	protected ChangeListener createChangeListener() {
		return new TabSelectionHandler();
	}

	protected void installKeyboardActions() {
		InputMap km = getMyInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);

		SwingUtilities.replaceUIInputMap(tabPane,
				JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, km);
		km = getMyInputMap(JComponent.WHEN_FOCUSED);
		SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, km);

		ActionMap am = createMyActionMap();

		SwingUtilities.replaceUIActionMap(tabPane, am);

		tabScroller.scrollForwardButton.setAction(am
				.get("scrollTabsForwardAction"));
		tabScroller.scrollBackwardButton.setAction(am
				.get("scrollTabsBackwardAction"));

	}

	InputMap getMyInputMap(int condition) {
		if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) {
			return (InputMap) UIManager.get("TabbedPane.ancestorInputMap");
		} else if (condition == JComponent.WHEN_FOCUSED) {
			return (InputMap) UIManager.get("TabbedPane.focusInputMap");
		}
		return null;
	}

	ActionMap createMyActionMap() {
		ActionMap map = new ActionMapUIResource();
		map.put("navigateNext", new NextAction());
		map.put("navigatePrevious", new PreviousAction());
		map.put("navigateRight", new RightAction());
		map.put("navigateLeft", new LeftAction());
		map.put("navigateUp", new UpAction());
		map.put("navigateDown", new DownAction());
		map.put("navigatePageUp", new PageUpAction());
		map.put("navigatePageDown", new PageDownAction());
		map.put("requestFocus", new RequestFocusAction());
		map.put("requestFocusForVisibleComponent",
				new RequestFocusForVisibleAction());
		map.put("setSelectedIndex", new SetSelectedIndexAction());
		map.put("scrollTabsForwardAction", new ScrollTabsForwardAction());
		map.put("scrollTabsBackwardAction", new ScrollTabsBackwardAction());
		return map;
	}

	protected void uninstallKeyboardActions() {
		SwingUtilities.replaceUIActionMap(tabPane, null);
		SwingUtilities.replaceUIInputMap(tabPane,
				JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
		SwingUtilities
				.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null);
	}

	/**
	 * Reloads the mnemonics. This should be invoked when a memonic changes,
	 * when the title of a mnemonic changes, or when tabs are added/removed.
	 */
	private void updateMnemonics() {
		resetMnemonics();
		for (int counter = tabPane.getTabCount() - 1; counter >= 0; counter--) {
			int mnemonic = tabPane.getMnemonicAt(counter);

			if (mnemonic > 0) {
				addMnemonic(counter, mnemonic);
			}
		}
	}

	/**
	 * Resets the mnemonics bindings to an empty state.
	 */
	private void resetMnemonics() {
		if (mnemonicToIndexMap != null) {
			mnemonicToIndexMap.clear();
			mnemonicInputMap.clear();
		}
	}

	/**
	 * Adds the specified mnemonic at the specified index.
	 */
	private void addMnemonic(int index, int mnemonic) {
		if (mnemonicToIndexMap == null) {
			initMnemonics();
		}
		mnemonicInputMap.put(KeyStroke.getKeyStroke(mnemonic, Event.ALT_MASK),
				"setSelectedIndex");
		mnemonicToIndexMap.put(new Integer(mnemonic), new Integer(index));
	}

	/**
	 * Installs the state needed for mnemonics.
	 */
	private void initMnemonics() {
		mnemonicToIndexMap = new Hashtable();
		mnemonicInputMap = new InputMapUIResource();
		mnemonicInputMap.setParent(SwingUtilities.getUIInputMap(tabPane,
				JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT));
		SwingUtilities
				.replaceUIInputMap(tabPane,
						JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
						mnemonicInputMap);
	}

	// UI Rendering

	public void paint(Graphics g, JComponent c) {
		int tc = tabPane.getTabCount();

		if (tabCount != tc) {
			tabCount = tc;
			updateMnemonics();
		}

		int selectedIndex = tabPane.getSelectedIndex();
		int tabPlacement = tabPane.getTabPlacement();

		ensureCurrentLayout();

		// Paint content border
		paintContentBorder(g, tabPlacement, selectedIndex);

	}

	protected void paintTab(Graphics g, int tabPlacement, Rectangle[] rects,
			int tabIndex, Rectangle iconRect, Rectangle textRect) {
		Rectangle tabRect = rects[tabIndex];
		int selectedIndex = tabPane.getSelectedIndex();
		boolean isSelected = selectedIndex == tabIndex;
		boolean isOver = overTabIndex == tabIndex;
		Graphics2D g2 = null;
		Shape save = null;
		boolean cropShape = false;
		int cropx = 0;
		int cropy = 0;

		if (g instanceof Graphics2D) {
			g2 = (Graphics2D) g;

			// Render visual for cropped tab edge...
			Rectangle viewRect = tabScroller.viewport.getViewRect();
			int cropline;

			cropline = viewRect.x + viewRect.width;
			if ((tabRect.x < cropline)
					&& (tabRect.x + tabRect.width > cropline)) {

				cropx = cropline - 1;
				cropy = tabRect.y;
				cropShape = true;
			}

			if (cropShape) {
				save = g2.getClip();
				g2
						.clipRect(tabRect.x, tabRect.y, tabRect.width,
								tabRect.height);

			}
		}

		paintTabBackground(g, tabPlacement, tabIndex, tabRect.x, tabRect.y,
				tabRect.width, tabRect.height, isSelected);

		paintTabBorder(g, tabPlacement, tabIndex, tabRect.x, tabRect.y,
				tabRect.width, tabRect.height, isSelected);

		String title = tabPane.getTitleAt(tabIndex);
		Font font = tabPane.getFont();
		FontMetrics metrics = g.getFontMetrics(font);
		Icon icon = getIconForTab(tabIndex);

		layoutLabel(tabPlacement, metrics, tabIndex, title, icon, tabRect,
				iconRect, textRect, isSelected);

		paintText(g, tabPlacement, font, metrics, tabIndex, title, textRect,
				isSelected);

		paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected);

		paintFocusIndicator(g, tabPlacement, rects, tabIndex, iconRect,
				textRect, isSelected);

		if (cropShape) {
			paintCroppedTabEdge(g, tabPlacement, tabIndex, isSelected, cropx,
					cropy);
			g2.setClip(save);

		} else if (isOver || isSelected) {

			int dx = tabRect.x + tabRect.width - BUTTONSIZE - WIDTHDELTA;
			int dy = (tabRect.y + tabRect.height) / 2 - 6;

			if (isCloseButtonEnabled)
				paintCloseIcon(g2, dx, dy, isOver);
			if (isMaxButtonEnabled)
				paintMaxIcon(g2, dx, dy, isOver);
		}

	}

	protected void paintCloseIcon(Graphics g, int dx, int dy, boolean isOver) {
		paintActionButton(g, dx, dy, closeIndexStatus, isOver, closeB,
				closeImgB);
		g.drawImage(closeImgI, dx, dy + 1, null);
	}

	protected void paintMaxIcon(Graphics g, int dx, int dy, boolean isOver) {
		if (isCloseButtonEnabled)
			dx -= BUTTONSIZE;

		paintActionButton(g, dx, dy, maxIndexStatus, isOver, maxB, maxImgB);
		g.drawImage(maxImgI, dx, dy + 1, null);
	}

	protected void paintActionButton(Graphics g, int dx, int dy, int status,
			boolean isOver, JButton button, BufferedImage image) {

		button.setBorder(null);

		if (isOver) {
			switch (status) {
			case OVER:
				button.setBorder(OVERBORDER);
				break;
			case PRESSED:
				button.setBorder(PRESSEDBORDER);
				break;
			}
		}

		button.setBackground(tabScroller.tabPanel.getBackground());
		button.paint(image.getGraphics());
		g.drawImage(image, dx, dy, null);
	}

	/*
	 * This method will create and return a polygon shape for the given tab
	 * rectangle which has been cropped at the specified cropline with a torn
	 * edge visual. e.g. A "File" tab which has cropped been cropped just after
	 * the "i": ------------- | ..... | | . | | ... . | | . . | | . . | | . . |
	 * --------------
	 *
	 * The x, y arrays below define the pattern used to create a "torn" edge
	 * segment which is repeated to fill the edge of the tab. For tabs placed on
	 * TOP and BOTTOM, this righthand torn edge is created by line segments
	 * which are defined by coordinates obtained by subtracting xCropLen[i] from
	 * (tab.x + tab.width) and adding yCroplen[i] to (tab.y). For tabs placed on
	 * LEFT or RIGHT, the bottom torn edge is created by subtracting xCropLen[i]
	 * from (tab.y + tab.height) and adding yCropLen[i] to (tab.x).
	 */

	private static final int CROP_SEGMENT = 12;

	private void paintCroppedTabEdge(Graphics g, int tabPlacement,
			int tabIndex, boolean isSelected, int x, int y) {

		g.setColor(shadow);
		g.drawLine(x, y, x, y + rects[tabIndex].height);

	}

	private void ensureCurrentLayout() {
		if (!tabPane.isValid()) {
			tabPane.validate();
		}
		/*
		 * If tabPane doesn't have a peer yet, the validate() call will silently
		 * fail. We handle that by forcing a layout if tabPane is still invalid.
		 * See bug 4237677.
		 */
		if (!tabPane.isValid()) {
			TabbedPaneLayout layout = (TabbedPaneLayout) tabPane.getLayout();
			layout.calculateLayoutInfo();
		}
	}

	/**
	 * Returns the bounds of the specified tab in the coordinate space of the
	 * JTabbedPane component. This is required because the tab rects are by
	 * default defined in the coordinate space of the component where they are
	 * rendered, which could be the JTabbedPane (for WRAP_TAB_LAYOUT) or a
	 * ScrollableTabPanel (SCROLL_TAB_LAYOUT). This method should be used
	 * whenever the tab rectangle must be relative to the JTabbedPane itself and
	 * the result should be placed in a designated Rectangle object (rather than
	 * instantiating and returning a new Rectangle each time). The tab index
	 * parameter must be a valid tabbed pane tab index (0 to tab count - 1,
	 * inclusive). The destination rectangle parameter must be a valid
	 * Rectangle instance. The handling of invalid parameters is
	 * unspecified.
	 *
	 * @param tabIndex
	 *            the index of the tab
	 * @param dest
	 *            the rectangle where the result should be placed
	 * @return the resulting rectangle
	 *
	 * @since 1.4
	 */

	protected Rectangle getTabBounds(int tabIndex, Rectangle dest) {
		dest.width = rects[tabIndex].width;
		dest.height = rects[tabIndex].height;

		Point vpp = tabScroller.viewport.getLocation();
		Point viewp = tabScroller.viewport.getViewPosition();
		dest.x = rects[tabIndex].x + vpp.x - viewp.x;
		dest.y = rects[tabIndex].y + vpp.y - viewp.y;

		return dest;
	}

	private int getTabAtLocation(int x, int y) {
		ensureCurrentLayout();

		int tabCount = tabPane.getTabCount();
		for (int i = 0; i < tabCount; i++) {
			if (rects[i].contains(x, y)) {
				return i;
			}
		}
		return -1;
	}

	public int getOverTabIndex(){
		return overTabIndex;
	}

	/**
	 * Returns the index of the tab closest to the passed in location, note that
	 * the returned tab may not contain the location x,y.
	 */
	private int getClosestTab(int x, int y) {
		int min = 0;
		int tabCount = Math.min(rects.length, tabPane.getTabCount());
		int max = tabCount;
		int tabPlacement = tabPane.getTabPlacement();
		boolean useX = (tabPlacement == TOP || tabPlacement == BOTTOM);
		int want = (useX) ? x : y;

		while (min != max) {
			int current = (max + min) / 2;
			int minLoc;
			int maxLoc;

			if (useX) {
				minLoc = rects[current].x;
				maxLoc = minLoc + rects[current].width;
			} else {
				minLoc = rects[current].y;
				maxLoc = minLoc + rects[current].height;
			}
			if (want < minLoc) {
				max = current;
				if (min == max) {
					return Math.max(0, current - 1);
				}
			} else if (want >= maxLoc) {
				min = current;
				if (max - min <= 1) {
					return Math.max(current + 1, tabCount - 1);
				}
			} else {
				return current;
			}
		}
		return min;
	}

	/**
	 * Returns a point which is translated from the specified point in the
	 * JTabbedPane's coordinate space to the coordinate space of the
	 * ScrollableTabPanel. This is used for SCROLL_TAB_LAYOUT ONLY.
	 */
	private Point translatePointToTabPanel(int srcx, int srcy, Point dest) {
		Point vpp = tabScroller.viewport.getLocation();
		Point viewp = tabScroller.viewport.getViewPosition();
		dest.x = srcx + vpp.x + viewp.x;
		dest.y = srcy + vpp.y + viewp.y;
		return dest;
	}

	// BasicTabbedPaneUI methods

	// Tab Navigation methods

	// REMIND(aim,7/29/98): This method should be made
	// protected in the next release where
	// API changes are allowed
	//
	boolean requestMyFocusForVisibleComponent() {
		Component visibleComponent = getVisibleComponent();
		if (visibleComponent.isFocusTraversable()) {
			visibleComponent.requestFocus();
			return true;
		} else if (visibleComponent instanceof JComponent) {
			if (((JComponent) visibleComponent).requestDefaultFocus()) {
				return true;
			}
		}
		return false;
	}

	private static class RightAction extends AbstractAction {
		public void actionPerformed(ActionEvent e) {
			JTabbedPane pane = (JTabbedPane) e.getSource();
			CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI();
			ui.navigateSelectedTab(EAST);
		}
	};

	private static class LeftAction extends AbstractAction {
		public void actionPerformed(ActionEvent e) {
			JTabbedPane pane = (JTabbedPane) e.getSource();
			CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI();
			ui.navigateSelectedTab(WEST);
		}
	};

	private static class UpAction extends AbstractAction {
		public void actionPerformed(ActionEvent e) {
			JTabbedPane pane = (JTabbedPane) e.getSource();
			CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI();
			ui.navigateSelectedTab(NORTH);
		}
	};

	private static class DownAction extends AbstractAction {
		public void actionPerformed(ActionEvent e) {
			JTabbedPane pane = (JTabbedPane) e.getSource();
			CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI();
			ui.navigateSelectedTab(SOUTH);
		}
	};

	private static class NextAction extends AbstractAction {
		public void actionPerformed(ActionEvent e) {
			JTabbedPane pane = (JTabbedPane) e.getSource();
			CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI();
			ui.navigateSelectedTab(NEXT);
		}
	};

	private static class PreviousAction extends AbstractAction {
		public void actionPerformed(ActionEvent e) {
			JTabbedPane pane = (JTabbedPane) e.getSource();
			CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI();
			ui.navigateSelectedTab(PREVIOUS);
		}
	};

	private static class PageUpAction extends AbstractAction {
		public void actionPerformed(ActionEvent e) {
			JTabbedPane pane = (JTabbedPane) e.getSource();
			CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI();
			int tabPlacement = pane.getTabPlacement();
			if (tabPlacement == TOP || tabPlacement == BOTTOM) {
				ui.navigateSelectedTab(WEST);
			} else {
				ui.navigateSelectedTab(NORTH);
			}
		}
	};

	private static class PageDownAction extends AbstractAction {
		public void actionPerformed(ActionEvent e) {
			JTabbedPane pane = (JTabbedPane) e.getSource();
			CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI();
			int tabPlacement = pane.getTabPlacement();
			if (tabPlacement == TOP || tabPlacement == BOTTOM) {
				ui.navigateSelectedTab(EAST);
			} else {
				ui.navigateSelectedTab(SOUTH);
			}
		}
	};

	private static class RequestFocusAction extends AbstractAction {
		public void actionPerformed(ActionEvent e) {
			JTabbedPane pane = (JTabbedPane) e.getSource();
			pane.requestFocus();
		}
	};

	private static class RequestFocusForVisibleAction extends AbstractAction {
		public void actionPerformed(ActionEvent e) {
			JTabbedPane pane = (JTabbedPane) e.getSource();
			CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI();
			ui.requestMyFocusForVisibleComponent();
		}
	};

	/**
	 * Selects a tab in the JTabbedPane based on the String of the action
	 * command. The tab selected is based on the first tab that has a mnemonic
	 * matching the first character of the action command.
	 */
	private static class SetSelectedIndexAction extends AbstractAction {
		public void actionPerformed(ActionEvent e) {
			JTabbedPane pane = (JTabbedPane) e.getSource();

			if (pane != null && (pane.getUI() instanceof CloseTabPaneUI)) {
				CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI();
				String command = e.getActionCommand();

				if (command != null && command.length() > 0) {
					int mnemonic = (int) e.getActionCommand().charAt(0);
					if (mnemonic >= 'a' && mnemonic <= 'z') {
						mnemonic -= ('a' - 'A');
					}
					Integer index = (Integer) ui.mnemonicToIndexMap
							.get(new Integer(mnemonic));
					if (index != null && pane.isEnabledAt(index.intValue())) {
						pane.setSelectedIndex(index.intValue());
					}
				}
			}
		}
	};

	private static class ScrollTabsForwardAction extends AbstractAction {
		public void actionPerformed(ActionEvent e) {
			JTabbedPane pane = null;
			Object src = e.getSource();
			if (src instanceof JTabbedPane) {
				pane = (JTabbedPane) src;
			} else if (src instanceof ScrollableTabButton) {
				pane = (JTabbedPane) ((ScrollableTabButton) src).getParent();
			} else {
				return; // shouldn't happen
			}
			CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI();

			ui.tabScroller.scrollForward(pane.getTabPlacement());

		}
	}

	private static class ScrollTabsBackwardAction extends AbstractAction {
		public void actionPerformed(ActionEvent e) {
			JTabbedPane pane = null;
			Object src = e.getSource();
			if (src instanceof JTabbedPane) {
				pane = (JTabbedPane) src;
			} else if (src instanceof ScrollableTabButton) {
				pane = (JTabbedPane) ((ScrollableTabButton) src).getParent();
			} else {
				return; // shouldn't happen
			}
			CloseTabPaneUI ui = (CloseTabPaneUI) pane.getUI();

			ui.tabScroller.scrollBackward(pane.getTabPlacement());

		}
	}

	/**
	 * This inner class is marked "public" due to a compiler bug. This
	 * class should be treated as a "protected" inner class.
	 * Instantiate it only within subclasses of BasicTabbedPaneUI.
	 */

	private class TabbedPaneScrollLayout extends TabbedPaneLayout {

		protected int preferredTabAreaHeight(int tabPlacement, int width) {
			return calculateMaxTabHeight(tabPlacement);
		}

		protected int preferredTabAreaWidth(int tabPlacement, int height) {
			return calculateMaxTabWidth(tabPlacement);
		}

		public void layoutContainer(Container parent) {
			int tabPlacement = tabPane.getTabPlacement();
			int tabCount = tabPane.getTabCount();
			Insets insets = tabPane.getInsets();
			int selectedIndex = tabPane.getSelectedIndex();
			Component visibleComponent = getVisibleComponent();

			calculateLayoutInfo();

			if (selectedIndex < 0) {
				if (visibleComponent != null) {
					// The last tab was removed, so remove the component
					setVisibleComponent(null);
				}
			} else {
				Component selectedComponent = tabPane
						.getComponentAt(selectedIndex);
				boolean shouldChangeFocus = false;

				// In order to allow programs to use a single component
				// as the display for multiple tabs, we will not change
				// the visible compnent if the currently selected tab
				// has a null component. This is a bit dicey, as we don't
				// explicitly state we support this in the spec, but since
				// programs are now depending on this, we're making it work.
				//
				if (selectedComponent != null) {
					if (selectedComponent != visibleComponent
							&& visibleComponent != null) {
						if (SwingUtilities.findFocusOwner(visibleComponent) != null) {
							shouldChangeFocus = true;
						}
					}
					setVisibleComponent(selectedComponent);
				}
				int tx, ty, tw, th; // tab area bounds
				int cx, cy, cw, ch; // content area bounds
				Insets contentInsets = getContentBorderInsets(tabPlacement);
				Rectangle bounds = tabPane.getBounds();
				int numChildren = tabPane.getComponentCount();

				if (numChildren > 0) {

					// calculate tab area bounds
					tw = bounds.width - insets.left - insets.right;
					th = calculateTabAreaHeight(tabPlacement, runCount,
							maxTabHeight);
					tx = insets.left;
					ty = insets.top;

					// calculate content area bounds
					cx = tx + contentInsets.left;
					cy = ty + th + contentInsets.top;
					cw = bounds.width - insets.left - insets.right
							- contentInsets.left - contentInsets.right;
					ch = bounds.height - insets.top - insets.bottom - th
							- contentInsets.top - contentInsets.bottom;

					for (int i = 0; i < numChildren; i++) {
						Component child = tabPane.getComponent(i);

						if (child instanceof ScrollableTabViewport) {
							JViewport viewport = (JViewport) child;
							Rectangle viewRect = viewport.getViewRect();
							int vw = tw;
							int vh = th;

							int totalTabWidth = rects[tabCount - 1].x
									+ rects[tabCount - 1].width;
							if (totalTabWidth > tw) {
								// Need to allow space for scrollbuttons
								vw = Math.max(tw - 36, 36);
								;
								if (totalTabWidth - viewRect.x <= vw) {
									// Scrolled to the end, so ensure the
									// viewport size is
									// such that the scroll offset aligns with a
									// tab
									vw = totalTabWidth - viewRect.x;
								}
							}

							child.setBounds(tx, ty, vw, vh);

						} else if (child instanceof ScrollableTabButton) {
							ScrollableTabButton scrollbutton = (ScrollableTabButton) child;
							Dimension bsize = scrollbutton.getPreferredSize();
							int bx = 0;
							int by = 0;
							int bw = bsize.width;
							int bh = bsize.height;
							boolean visible = false;

							int totalTabWidth = rects[tabCount - 1].x
									+ rects[tabCount - 1].width;

							if (totalTabWidth > tw) {
								int dir = scrollbutton.scrollsForward() ? EAST
										: WEST;
								scrollbutton.setDirection(dir);
								visible = true;
								bx = dir == EAST ? bounds.width - insets.left
										- bsize.width : bounds.width
										- insets.left - 2 * bsize.width;
								by = (tabPlacement == TOP ? ty + th
										- bsize.height : ty);
							}

							child.setVisible(visible);
							if (visible) {
								child.setBounds(bx, by, bw, bh);
							}

						} else {
							// All content children...
							child.setBounds(cx, cy, cw, ch);
						}
					}
					if (shouldChangeFocus) {
						if (!requestMyFocusForVisibleComponent()) {
							tabPane.requestFocus();
						}
					}
				}
			}
		}

		protected void calculateTabRects(int tabPlacement, int tabCount) {
			FontMetrics metrics = getFontMetrics();
			Dimension size = tabPane.getSize();
			Insets insets = tabPane.getInsets();
			Insets tabAreaInsets = getTabAreaInsets(tabPlacement);
			int fontHeight = metrics.getHeight();
			int selectedIndex = tabPane.getSelectedIndex();
			int i, j;

			int x = tabAreaInsets.left - 2;
			int y = tabAreaInsets.top;
			int totalWidth = 0;
			int totalHeight = 0;

			//
			// Calculate bounds within which a tab run must fit
			//

			maxTabHeight = calculateMaxTabHeight(tabPlacement);

			runCount = 0;
			selectedRun = -1;

			if (tabCount == 0) {
				return;
			}

			selectedRun = 0;
			runCount = 1;

			// Run through tabs and lay them out in a single run
			Rectangle rect;
			for (i = 0; i < tabCount; i++) {
				rect = rects[i];

				if (i > 0) {
					rect.x = rects[i - 1].x + rects[i - 1].width - 1;
				} else {
					tabRuns[0] = 0;
					maxTabWidth = 0;
					totalHeight += maxTabHeight;
					rect.x = x;
				}
				rect.width = calculateTabWidth(tabPlacement, i, metrics);
				totalWidth = rect.x + rect.width;
				maxTabWidth = Math.max(maxTabWidth, rect.width);

				rect.y = y;
				rect.height = maxTabHeight /* - 2 */;

			}

			//tabPanel.setSize(totalWidth, totalHeight);
			tabScroller.tabPanel.setPreferredSize(new Dimension(totalWidth,
					totalHeight));
		}
	}

	private class ScrollableTabSupport implements ChangeListener {
		public ScrollableTabViewport viewport;

		public ScrollableTabPanel tabPanel;

		public ScrollableTabButton scrollForwardButton;

		public ScrollableTabButton scrollBackwardButton;

		public int leadingTabIndex;

		private Point tabViewPosition = new Point(0, 0);

		ScrollableTabSupport(int tabPlacement) {
			viewport = new ScrollableTabViewport();
			tabPanel = new ScrollableTabPanel();
			viewport.setView(tabPanel);
			viewport.addChangeListener(this);

			scrollForwardButton = createScrollableTabButton(EAST);
			scrollBackwardButton = createScrollableTabButton(WEST);
			//			scrollForwardButton = new ScrollableTabButton(EAST);
			//			scrollBackwardButton = new ScrollableTabButton(WEST);
		}

		public void scrollForward(int tabPlacement) {
			Dimension viewSize = viewport.getViewSize();
			Rectangle viewRect = viewport.getViewRect();

			if (tabPlacement == TOP || tabPlacement == BOTTOM) {
				if (viewRect.width >= viewSize.width - viewRect.x) {
					return; // no room left to scroll
				}
			} else { // tabPlacement == LEFT || tabPlacement == RIGHT
				if (viewRect.height >= viewSize.height - viewRect.y) {
					return;
				}
			}
			setLeadingTabIndex(tabPlacement, leadingTabIndex + 1);
		}

		public void scrollBackward(int tabPlacement) {
			if (leadingTabIndex == 0) {
				return; // no room left to scroll
			}
			setLeadingTabIndex(tabPlacement, leadingTabIndex - 1);
		}

		public void setLeadingTabIndex(int tabPlacement, int index) {
			leadingTabIndex = index;
			Dimension viewSize = viewport.getViewSize();
			Rectangle viewRect = viewport.getViewRect();

			tabViewPosition.x = leadingTabIndex == 0 ? 0
					: rects[leadingTabIndex].x;

			if ((viewSize.width - tabViewPosition.x) < viewRect.width) {
				// We've scrolled to the end, so adjust the viewport size
				// to ensure the view position remains aligned on a tab boundary
				Dimension extentSize = new Dimension(viewSize.width
						- tabViewPosition.x, viewRect.height);
				viewport.setExtentSize(extentSize);
			}

			viewport.setViewPosition(tabViewPosition);
		}

		public void stateChanged(ChangeEvent e) {
			JViewport viewport = (JViewport) e.getSource();
			int tabPlacement = tabPane.getTabPlacement();
			int tabCount = tabPane.getTabCount();
			Rectangle vpRect = viewport.getBounds();
			Dimension viewSize = viewport.getViewSize();
			Rectangle viewRect = viewport.getViewRect();

			leadingTabIndex = getClosestTab(viewRect.x, viewRect.y);

			// If the tab isn't right aligned, adjust it.
			if (leadingTabIndex + 1 < tabCount) {

				if (rects[leadingTabIndex].x < viewRect.x) {
					leadingTabIndex++;
				}

			}
			Insets contentInsets = getContentBorderInsets(tabPlacement);

			tabPane.repaint(vpRect.x, vpRect.y + vpRect.height, vpRect.width,
					contentInsets.top);
			scrollBackwardButton.setEnabled(viewRect.x > 0);
			scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1
					&& viewSize.width - viewRect.x > viewRect.width);

		}

		public String toString() {
			return new String("viewport.viewSize=" + viewport.getViewSize()
					+ "\n" + "viewport.viewRectangle=" + viewport.getViewRect()
					+ "\n" + "leadingTabIndex=" + leadingTabIndex + "\n"
					+ "tabViewPosition=" + tabViewPosition);
		}

	}

	private class ScrollableTabViewport extends JViewport implements UIResource {
		public ScrollableTabViewport() {
			super();
			setScrollMode(SIMPLE_SCROLL_MODE);
		}
	}

	private class ScrollableTabPanel extends JPanel implements UIResource {
		public ScrollableTabPanel() {
			setLayout(null);
		}

		public void paintComponent(Graphics g) {
			super.paintComponent(g);
			CloseTabPaneUI.this.paintTabArea(g, tabPane.getTabPlacement(),
					tabPane.getSelectedIndex());

		}
	}

	protected class ScrollableTabButton extends BasicArrowButton implements
			UIResource, SwingConstants {
		public ScrollableTabButton(int direction) {
			super(direction, UIManager.getColor("TabbedPane.selected"),
					UIManager.getColor("TabbedPane.shadow"), UIManager
							.getColor("TabbedPane.darkShadow"), UIManager
							.getColor("TabbedPane.highlight"));

		}

		public boolean scrollsForward() {
			return direction == EAST || direction == SOUTH;
		}

	}

	/**
	 * This inner class is marked "public" due to a compiler bug. This
	 * class should be treated as a "protected" inner class.
	 * Instantiate it only within subclasses of BasicTabbedPaneUI.
	 */
	public class TabSelectionHandler implements ChangeListener {
		public void stateChanged(ChangeEvent e) {
			JTabbedPane tabPane = (JTabbedPane) e.getSource();
			tabPane.revalidate();
			tabPane.repaint();

			if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) {
				int index = tabPane.getSelectedIndex();
				if (index < rects.length && index != -1) {
					tabScroller.tabPanel.scrollRectToVisible(rects[index]);
				}
			}
		}
	}

	/**
	 * This inner class is marked "public" due to a compiler bug. This
	 * class should be treated as a "protected" inner class.
	 * Instantiate it only within subclasses of BasicTabbedPaneUI.
	 */

	/*
	 * GES 2/3/99: The container listener code was added to support HTML
	 * rendering of tab titles.
	 *
	 * Ideally, we would be able to listen for property changes when a tab is
	 * added or its text modified. At the moment there are no such events
	 * because the Beans spec doesn't allow 'indexed' property changes (i.e. tab
	 * 2's text changed from A to B).
	 *
	 * In order to get around this, we listen for tabs to be added or removed by
	 * listening for the container events. we then queue up a runnable (so the
	 * component has a chance to complete the add) which checks the tab title of
	 * the new component to see if it requires HTML rendering.
	 *
	 * The Views (one per tab title requiring HTML rendering) are stored in the
	 * htmlViews Vector, which is only allocated after the first time we run
	 * into an HTML tab. Note that this vector is kept in step with the number
	 * of pages, and nulls are added for those pages whose tab title do not
	 * require HTML rendering.
	 *
	 * This makes it easy for the paint and layout code to tell whether to
	 * invoke the HTML engine without having to check the string during
	 * time-sensitive operations.
	 *
	 * When we have added a way to listen for tab additions and changes to tab
	 * text, this code should be removed and replaced by something which uses
	 * that.
	 */

	private class ContainerHandler implements ContainerListener {
		public void componentAdded(ContainerEvent e) {
			JTabbedPane tp = (JTabbedPane) e.getContainer();
			Component child = e.getChild();
			if (child instanceof UIResource) {
				return;
			}
			int index = tp.indexOfComponent(child);
			String title = tp.getTitleAt(index);
			boolean isHTML = BasicHTML.isHTMLString(title);
			if (isHTML) {
				if (htmlViews == null) { // Initialize vector
					htmlViews = createHTMLVector();
				} else { // Vector already exists
					View v = BasicHTML.createHTMLView(tp, title);
					htmlViews.insertElementAt(v, index);
				}
			} else { // Not HTML
				if (htmlViews != null) { // Add placeholder
					htmlViews.insertElementAt(null, index);
				} // else nada!
			}
		}

		public void componentRemoved(ContainerEvent e) {
			JTabbedPane tp = (JTabbedPane) e.getContainer();
			Component child = e.getChild();
			if (child instanceof UIResource) {
				return;
			}

			// NOTE 4/15/2002 (joutwate):
			// This fix is implemented using client properties since there is
			// currently no IndexPropertyChangeEvent. Once
			// IndexPropertyChangeEvents have been added this code should be
			// modified to use it.
			Integer indexObj = (Integer) tp
					.getClientProperty("__index_to_remove__");
			if (indexObj != null) {
				int index = indexObj.intValue();
				if (htmlViews != null && htmlViews.size() >= index) {
					htmlViews.removeElementAt(index);
				}
			}
		}
	}

	private Vector createHTMLVector() {
		Vector htmlViews = new Vector();
		int count = tabPane.getTabCount();
		if (count > 0) {
			for (int i = 0; i < count; i++) {
				String title = tabPane.getTitleAt(i);
				if (BasicHTML.isHTMLString(title)) {
					htmlViews.addElement(BasicHTML.createHTMLView(tabPane,
							title));
				} else {
					htmlViews.addElement(null);
				}
			}
		}
		return htmlViews;
	}

	class MyMouseHandler extends MouseHandler {
		public MyMouseHandler() {
			super();
		}

		public void mousePressed(MouseEvent e) {
			if (closeIndexStatus == OVER) {
				closeIndexStatus = PRESSED;
				tabScroller.tabPanel.repaint();
				return;
			}

			if (maxIndexStatus == OVER) {
				maxIndexStatus = PRESSED;
				tabScroller.tabPanel.repaint();
				return;
			}

		}

		public void mouseClicked(MouseEvent e) {
			super.mousePressed(e);
			if (e.getClickCount() > 1 && overTabIndex != -1) {
				((CloseAndMaxTabbedPane) tabPane).fireDoubleClickTabEvent(e, overTabIndex);
			}
		}

		public void mouseReleased(MouseEvent e) {

			updateOverTab(e.getX(), e.getY());

			if (overTabIndex == -1) {
				if (e.isPopupTrigger())
					((CloseAndMaxTabbedPane) tabPane)
							.firePopupOutsideTabEvent(e);
				return;
			}

			if (isOneActionButtonEnabled() && e.isPopupTrigger()) {
				super.mousePressed(e);

				closeIndexStatus = INACTIVE; //Prevent undesired action when
				maxIndexStatus = INACTIVE; //right-clicking on icons

				actionPopupMenu.show(tabScroller.tabPanel, e.getX(), e.getY());
				return;
			}

			if (closeIndexStatus == PRESSED) {
				closeIndexStatus = OVER;
				tabScroller.tabPanel.repaint();
				((CloseAndMaxTabbedPane) tabPane).fireCloseTabEvent(e, overTabIndex);
				return;
			}

			if (maxIndexStatus == PRESSED) {
				maxIndexStatus = OVER;
				tabScroller.tabPanel.repaint();
				((CloseAndMaxTabbedPane) tabPane).fireMaxTabEvent(e, overTabIndex);
				return;
			}

		}

		public void mouseExited(MouseEvent e) {
			if (!mousePressed) {
				overTabIndex = -1;
				tabScroller.tabPanel.repaint();
			}
		}

	}

	class MyMouseMotionListener implements MouseMotionListener {

		public void mouseMoved(MouseEvent e) {
			if (actionPopupMenu.isVisible())
				return; //No updates when popup is visible
			mousePressed = false;
			setTabIcons(e.getX(), e.getY());
		}

		public void mouseDragged(MouseEvent e) {
			if (actionPopupMenu.isVisible())
				return; //No updates when popup is visible
			mousePressed = true;
			setTabIcons(e.getX(), e.getY());
		}
	}

}


text:
/*
 * Created on 13-Feb-2006
 */
package uk.org.ponder.rsf.flow.jsfnav.support;

import java.util.List;
import java.util.Map;

import uk.org.ponder.reflect.ReflectiveCache;
import uk.org.ponder.rsf.flow.jsfnav.NavigationCaseReceiver;

/** Maintains an application-wide pool of navigation cases reported by views. This
 * communicates with ViewProducers to receive any local definitions of NavigationCases
 * that the views have generated, in order to ease the common case of single-step
 * POSTS.
 *
Note that for efficiency reasons, this class operate VERY SPECIFIC SEMANTICS
 * on the contained objects.
 *
Firstly, it will apply object identity by reference
 * handle on the NavigationCase lists that it is supplied with - in the most
 * common case that the navigation cases have not changed since the last time
 * the ViewProducer was executed, this should be signalled by returning the
 * SELFSAME list handle to this class, which will then be able to avoid blocking
 * the ConcurrentHashMap it contains by issuing a write.
 *
Secondly, and as a consequence, NavigationCase lists, once supplied to,
 * or after delivered from this class, must NEVER be modified!! To change the
 * stored lists, supply a different object handle.
 * @author Antranig Basman (amb26@ponder.org.uk)
 */

public class NavigationCasePooler implements NavigationCaseReceiver {

  private Map pooledmap;

  public void setReflectiveCache(ReflectiveCache reflectivecache) {
    pooledmap = reflectivecache.getConcurrentMap(1);
  }

  public void receiveNavigationCases(String viewid, List navigationCases) {
    if (navigationCases != null) {
      Object oldcases = pooledmap.get(viewid);
      if (navigationCases != oldcases) {
        pooledmap.put(viewid, navigationCases);
      }
    }
  }

  public Map getPooledMap() {
    return pooledmap;
  }

}