This project has retired. For details please refer to its
Attic page.
CheckOutPanel xref
1/*2 * Licensed to the Apache Software Foundation (ASF) under one3 * or more contributor license agreements. See the NOTICE file4 * distributed with this work for additional information5 * regarding copyright ownership. The ASF licenses this file6 * to you under the Apache License, Version 2.0 (the7 * "License"); you may not use this file except in compliance8 * with the License. You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing,13 * software distributed under the License is distributed on an14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY15 * KIND, either express or implied. See the License for the16 * specific language governing permissions and limitations17 * under the License.18 */19package org.apache.chemistry.opencmis.workbench.actions;
2021import org.apache.chemistry.opencmis.client.api.Document;
22import org.apache.chemistry.opencmis.commons.enums.Action;
23import org.apache.chemistry.opencmis.workbench.model.ClientModel;
24import org.apache.chemistry.opencmis.workbench.swing.ActionPanel;
2526publicclassCheckOutPanelextendsActionPanel {
2728privatestaticfinallong serialVersionUID = 1L;
2930publicCheckOutPanel(ClientModel model) {
31super("Check-out Object", "Check-out", model);
32 }
3334 @Override
35protectedvoid createActionComponents() {
36 }
3738 @Override
39publicboolean isAllowed() {
40if ((getObject() == null) || !(getObject() instanceof Document)) {
41return false;
42 }
4344if ((getObject().getAllowableActions() == null)
45 || (getObject().getAllowableActions().getAllowableActions() == null)) {
46returntrue;
47 }
4849return getObject().getAllowableActions().getAllowableActions().contains(Action.CAN_CHECK_OUT);
50 }
5152 @Override
53publicboolean doAction() throws Exception {
54 ((Document) getObject()).checkOut();
55returntrue;
56 }
57 }