use of com.ramussoft.gui.common.TabView in project ramus by Vitaliy-Yakovchuk.
the class QualifierPlugin method setFramework.
@Override
public void setFramework(final GUIFramework framework) {
super.setFramework(framework);
this.engine = framework.getEngine();
this.accessor = framework.getAccessRules();
framework.addActionListener(OPEN_QUALIFIER, new ActionListener() {
@Override
public void onAction(final ActionEvent event) {
if (framework.openView(event))
return;
final Data data = new Data();
data.qualifier = (Qualifier) event.getValue();
if (data.qualifier != null) {
data.qualifier = engine.getQualifier(data.qualifier.getId());
}
if (data.qualifier == null)
return;
data.listener = new QualifierAdapter() {
@Override
public void qualifierUpdated(QualifierEvent event) {
if (event.getNewQualifier().equals(data.qualifier)) {
ViewTitleEvent e = new ViewTitleEvent(data.view, event.getNewQualifier().getName());
data.view.titleChanged(e);
}
}
@Override
public void qualifierDeleted(QualifierEvent event) {
if (event.getOldQualifier().equals(data.qualifier)) {
data.view.close();
}
}
};
engine.addQualifierListener(data.listener);
data.view = new TableTabView(framework, engine, accessor, data.qualifier) {
@Override
public void close() {
super.close();
engine.removeQualifierListener(data.listener);
TabbedEvent tEvent = new TabbedEvent("TabbedTableView", this);
tabRemoved(tEvent);
}
@Override
public String getTitle() {
return qualifier.getName();
}
@Override
public ActionEvent getOpenAction() {
return new ActionEvent(OPEN_QUALIFIER, data.qualifier);
}
};
TabbedEvent tEvent = new TabbedEvent(TabbedTableView.MAIN_TABBED_VIEW, (TabView) data.view);
tabCreated(tEvent);
}
});
framework.setSystemAttributeName(StandardAttributesPlugin.getAttributeNameAttribute(engine), GlobalResourcesManager.getString("AttributeName"));
framework.setSystemAttributeName(StandardAttributesPlugin.getAttributeTypeNameAttribute(engine), GlobalResourcesManager.getString("AttributeTypeName"));
}
use of com.ramussoft.gui.common.TabView in project ramus by Vitaliy-Yakovchuk.
the class AbstractTableView method init.
private void init(HTMLPrintable printable) {
try {
String title;
if (this instanceof UniqueView) {
title = getString(((UniqueView) this).getId());
} else if (this instanceof TabView) {
title = ((TabView) this).getTitle();
} else {
title = getQualifier().getName();
}
OutputStream os = printable.getOutputStream();
String top = "<html>\n<head>\n<title>" + title + "</title>\n</head>\n\n<body>\n";
os.write(top.getBytes());
os.write(table.getBodyText(title).getBytes());
os.write("</body>\n</html>\n".getBytes());
os.close();
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations