use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject in project convertigo by convertigo.
the class ProjectExplorerView method findTreeObjectByUserObject.
private DatabaseObjectTreeObject findTreeObjectByUserObject(DatabaseObject databaseObject, ProjectTreeObject projectTreeObject) {
DatabaseObjectTreeObject databaseObjectTreeObject = null;
if (projectTreeObject.getObject().equals(databaseObject)) {
databaseObjectTreeObject = projectTreeObject;
} else {
DatabaseObject parentDatabaseObject = databaseObject.getParent();
DatabaseObjectTreeObject parentDatabaseObjectTreeObject = findTreeObjectByUserObjectFromCache(parentDatabaseObject);
if (parentDatabaseObjectTreeObject == null) {
parentDatabaseObjectTreeObject = findTreeObjectByUserObject(parentDatabaseObject, projectTreeObject);
}
if (parentDatabaseObjectTreeObject != null) {
databaseObjectTreeObject = parentDatabaseObjectTreeObject.findDatabaseObjectTreeObjectChild(databaseObject);
}
}
if (databaseObjectTreeObject != null) {
databaseObjectTreeObjectCache.put(databaseObject, databaseObjectTreeObject);
}
return databaseObjectTreeObject;
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject in project convertigo by convertigo.
the class ProjectExplorerView method updateDatabaseObject.
public void updateDatabaseObject(DatabaseObject databaseObject) {
DatabaseObjectTreeObject treeObject = (DatabaseObjectTreeObject) findTreeObjectByUserObject(databaseObject);
updateTreeObject(treeObject);
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject in project convertigo by convertigo.
the class CommentColumnLabelProvider method getText.
@Override
public String getText(Object element) {
if (element instanceof DatabaseObjectTreeObject) {
DatabaseObjectTreeObject dbot = (DatabaseObjectTreeObject) element;
DatabaseObject dbo = dbot.getObject();
String comment = dbo.getComment();
if (!StringUtils.isBlank(comment)) {
int i = comment.indexOf('\n');
if (i != -1) {
comment = comment.substring(0, i);
}
return "// " + comment;
}
if (dbot.isSelected()) {
return "…";
}
}
return "";
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject in project convertigo by convertigo.
the class ViewImageProvider method getImageData.
/**
* Dispose all loaded images
*/
/*public static void dispose() {
String imageName = null;
Image image = null;
for (Enumeration e = imagesCache.keys(); e.hasMoreElements(); ) {
imageName = (String) e.nextElement();
if (imageName != null) {
image = (Image) imagesCache.get(imageName);
imagesCache.put(imageName, null);
}
if (image != null)
image.dispose();
}
}*/
private static ImageData getImageData(Image image, Object object) {
ImageData imageData = image.getImageData();
DatabaseObjectTreeObject databaseObjectTreeObject = null;
if (object instanceof DatabaseObjectTreeObject) {
databaseObjectTreeObject = (DatabaseObjectTreeObject) object;
} else if (object instanceof PropertyTableTreeObject) {
PropertyTableTreeObject table = (PropertyTableTreeObject) object;
if (table != null) {
databaseObjectTreeObject = (DatabaseObjectTreeObject) table.getTreeObjectOwner();
}
} else if (object instanceof PropertyTableRowTreeObject) {
PropertyTableTreeObject table = ((PropertyTableRowTreeObject) object).getParentTable();
if (table != null) {
databaseObjectTreeObject = (DatabaseObjectTreeObject) table.getTreeObjectOwner();
}
} else if (object instanceof PropertyTableColumnTreeObject) {
PropertyTableTreeObject table = ((PropertyTableColumnTreeObject) object).getParentTable();
if (table != null) {
databaseObjectTreeObject = (DatabaseObjectTreeObject) table.getTreeObjectOwner();
}
} else if (object instanceof FolderTreeObject) {
FolderTreeObject t_folder = (FolderTreeObject) object;
if (t_folder.getParent() instanceof DatabaseObjectTreeObject) {
databaseObjectTreeObject = (DatabaseObjectTreeObject) t_folder.getParent();
}
} else if (object instanceof DesignDocumentViewTreeObject) {
DesignDocumentViewTreeObject ddvto = (DesignDocumentViewTreeObject) object;
if (ddvto != null) {
databaseObjectTreeObject = (DatabaseObjectTreeObject) ddvto.getTreeObjectOwner();
}
} else if (object instanceof DesignDocumentFunctionTreeObject) {
DesignDocumentFunctionTreeObject ddfto = (DesignDocumentFunctionTreeObject) object;
if (ddfto != null) {
databaseObjectTreeObject = (DatabaseObjectTreeObject) ddfto.getTreeObjectOwner();
}
}
if (databaseObjectTreeObject != null) {
// GIF style
if (imageData.palette.colors != null) {
for (int i = 0; i < imageData.palette.colors.length; i++) {
if (i != imageData.transparentPixel) {
RGB rgb = imageData.palette.colors[i];
imageData.palette.colors[i] = changeHue(rgb, databaseObjectTreeObject);
}
}
} else // PNG style and Linux
{
for (int i = 0; i < imageData.height; i++) {
for (int j = 0; j < imageData.width; j++) {
RGB rgb = imageData.palette.getRGB(imageData.getPixel(j, i));
imageData.setPixel(j, i, imageData.palette.getPixel(changeHue(rgb, databaseObjectTreeObject)));
}
}
}
}
return imageData;
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject in project convertigo by convertigo.
the class ViewLabelProvider method getText.
@Override
public String getText(Object obj) {
if (obj instanceof DatabaseObjectTreeObject) {
DatabaseObject dbo = ((DatabaseObjectTreeObject) obj).getObject();
if (dbo.isSymbolError() || (dbo instanceof Project && ((Project) dbo).undefinedGlobalSymbols)) {
return obj.toString() + " (! undefined symbol !)";
}
String osname = System.getProperty("os.name");
String version = System.getProperty("os.version");
boolean notShownSpecialChar = osname.toLowerCase().startsWith("windows") && Double.parseDouble(version) < 6.2;
boolean isMac = osname.toLowerCase().startsWith("mac");
if (dbo instanceof RequestableObject && !notShownSpecialChar) {
return (((RequestableObject) dbo).getAccessibility() == Accessibility.Private ? "🔒 " : (((RequestableObject) dbo).getAccessibility() == Accessibility.Hidden ? "👓 " : (isMac ? "🚪 " : " 🚪 "))) + (dbo instanceof Sequence ? (((Sequence) dbo).isAutoStart() ? "💡 " : "") : "") + obj.toString();
}
}
return obj.toString();
}
Aggregations