89 lines
2.9 KiB
Java
89 lines
2.9 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.space.Mark
|
|
* javax.baja.sys.BObject
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
* javax.baja.ui.CommandArtifact
|
|
* javax.baja.ui.transfer.TransferContext
|
|
* javax.baja.ui.transfer.TransferFormat
|
|
* javax.baja.ui.transfer.UnsupportedFormatException
|
|
* javax.baja.ui.util.UiLexicon
|
|
* javax.baja.workbench.mgr.BMgrTable
|
|
* javax.baja.workbench.mgr.MgrModel
|
|
*/
|
|
package com.tridium.program.ui;
|
|
|
|
import com.tridium.program.BProgram;
|
|
import javax.baja.space.Mark;
|
|
import javax.baja.sys.BObject;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
import javax.baja.ui.CommandArtifact;
|
|
import javax.baja.ui.transfer.TransferContext;
|
|
import javax.baja.ui.transfer.TransferFormat;
|
|
import javax.baja.ui.transfer.UnsupportedFormatException;
|
|
import javax.baja.ui.util.UiLexicon;
|
|
import javax.baja.workbench.mgr.BMgrTable;
|
|
import javax.baja.workbench.mgr.MgrModel;
|
|
|
|
public class BBuilderTable
|
|
extends BMgrTable {
|
|
public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$program$ui$BBuilderTable == null ? (class$com$tridium$program$ui$BBuilderTable = BBuilderTable.class$("com.tridium.program.ui.BBuilderTable")) : class$com$tridium$program$ui$BBuilderTable));
|
|
static /* synthetic */ Class class$com$tridium$program$ui$BBuilderTable;
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public BBuilderTable(MgrModel mgrModel) {
|
|
super(mgrModel);
|
|
}
|
|
|
|
public int getRowOfProgram(String string) {
|
|
int n = this.getModel().getRowCount();
|
|
for (int i = 0; i < n; ++i) {
|
|
if (!this.getComponentAt(i).getDisplayName(null).equals(string)) continue;
|
|
return i;
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
public int dragOver(TransferContext transferContext) {
|
|
return this.isAllPrograms(transferContext) ? super.dragOver(transferContext) : 0;
|
|
}
|
|
|
|
public boolean isPasteSpecialEnabled() {
|
|
return false;
|
|
}
|
|
|
|
public CommandArtifact insertTransferData(TransferContext transferContext) throws Exception {
|
|
if (!this.isAllPrograms(transferContext)) {
|
|
throw new UnsupportedFormatException(UiLexicon.bajaui().getText("command.paste.unsupportedFormat"));
|
|
}
|
|
return this.drop(transferContext);
|
|
}
|
|
|
|
private boolean isAllPrograms(TransferContext transferContext) {
|
|
Mark mark = (Mark)transferContext.getEnvelope().getData(TransferFormat.mark);
|
|
BObject[] bObjectArray = mark.getValues();
|
|
for (int i = 0; i < bObjectArray.length; ++i) {
|
|
if (bObjectArray[i] instanceof BProgram) continue;
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
static /* synthetic */ Class class$(String string) {
|
|
try {
|
|
return Class.forName(string);
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
}
|
|
|