use of com.ramussoft.gui.common.event.ActionEvent in project ramus by Vitaliy-Yakovchuk.
the class SelectRowPanel method createRightComponent.
private void createRightComponent() {
if (qualifierView == null)
return;
qualifier = qualifierView.getSelectedQualifier();
boolean b = qualifier != null;
if (b) {
framework.setOpenDynamikViewEvent(new ActionEvent(QualifierPlugin.OPEN_QUALIFIER, qualifier));
selectableTableView = new SelectableTableView(framework, dataPlugin.getEngine(), accessRules, qualifier) {
};
int dl = splitPane.getDividerLocation();
splitPane.setRightComponent(createComponent());
for (Row row : getSelectedRows(qualifier)) selectableTableView.getComponent().getModel().setSelectedRow(selectableTableView.getComponent().getRowSet().findRow(row.getElementId()), true);
splitPane.revalidate();
splitPane.repaint();
splitPane.setDividerLocation(dl);
selectableTableView.getComponent().getModel().addSelectionListener(selectionListener);
if (!getSelectType().equals(SelectType.CHECK))
selectableTableView.setSelectType(getSelectType());
}
}
use of com.ramussoft.gui.common.event.ActionEvent in project ramus by Vitaliy-Yakovchuk.
the class SelectRowDialog method createRightComponent.
private void createRightComponent() {
if (qualifierView == null)
return;
qualifier = qualifierView.getSelectedQualifier();
boolean b = qualifier != null;
addQualifier = b;
if (b) {
framework.setOpenDynamikViewEvent(new ActionEvent(QualifierPlugin.OPEN_QUALIFIER, qualifier));
selectableTableView = new SelectableTableView(framework, dataPlugin.getEngine(), accessRules, qualifier) {
};
int dl = splitPane.getDividerLocation();
splitPane.setRightComponent(createComponent());
for (Row row : getSelectedRows(qualifier)) selectableTableView.getComponent().getModel().setSelectedRow(row, true);
splitPane.revalidate();
splitPane.repaint();
splitPane.setDividerLocation(dl);
selectableTableView.getComponent().getModel().addSelectionListener(selectionListener);
if (!getSelectType().equals(SelectType.CHECK))
selectableTableView.setSelectType(getSelectType());
}
}
use of com.ramussoft.gui.common.event.ActionEvent in project ramus by Vitaliy-Yakovchuk.
the class ChartSourceSelectPanel method createRightPanel.
private void createRightPanel() {
if (qualifierView == null)
return;
Qualifier qualifier = qualifierView.getSelectedQualifier();
boolean b = qualifier != null;
if (b) {
framework.setOpenDynamikViewEvent(new ActionEvent(QualifierPlugin.OPEN_QUALIFIER, qualifier));
QualifierSource qualifierSource = null;
for (QualifierSource s : chartSource.getQualifierSources()) {
if (s.getQualifier().equals(qualifier)) {
qualifierSource = s;
break;
}
}
if (qualifierSource == null) {
qualifierSource = chartSource.createQualifierSource();
qualifierSource.setQualifier(qualifier);
chartSource.getQualifierSources().add(qualifierSource);
}
qualifierSelectPanel = new QualifierSourceSelectPanel(framework, qualifier, qualifierSource, (sourceType.getSelectedItem().equals(sourceTypeElements)) ? SelectType.CHECK : SelectType.RADIO);
int dl = pane.getDividerLocation();
pane.setRightComponent(qualifierSelectPanel);
pane.revalidate();
pane.repaint();
pane.setDividerLocation(dl);
}
}
use of com.ramussoft.gui.common.event.ActionEvent in project ramus by Vitaliy-Yakovchuk.
the class SimleGUIPluginFactory method initContent.
// @SuppressWarnings("deprecation")
private void initContent() {
control = new Control(plugableFrame, this);
// control.setTheme(control.getThemes().getFactory(2).create());
control.addControlListener(new ControlListener() {
@Override
public void closed(Control control, DFrame dockable) {
Boolean b = recHash.get(Thread.currentThread());
if (b != null)
return;
recHash.put(Thread.currentThread(), true);
List<TabView> list = new ArrayList<TabView>();
for (Entry<TabView, TabFrame> e : tabDockables.entrySet()) {
if (e.getValue().equals(dockable)) {
TabView view = e.getKey();
list.add(view);
}
}
for (TabView view : list) view.close();
recHash.remove(Thread.currentThread());
}
});
control.addFocusListener(new FrameFocusListener() {
@Override
public void focusGained(DFrame dockable) {
List<View> list = new ArrayList<View>();
for (Entry<TabView, TabFrame> e : tabDockables.entrySet()) {
if (e.getValue().equals(dockable)) {
TabView view = e.getKey();
list.add(view);
}
}
if (dockable instanceof UniqueDFrame) {
list.add(findUniqueView(((UniqueDFrame) dockable).getUniqueId()));
}
for (View view : list) {
lastActiveView = view;
view.focusGained();
plugableFrame.setViewActions(view.getGlobalActions());
if ((!(view instanceof UniqueView)) && (view instanceof TabView)) {
if (currentWorkspace != null)
workspaceViews.put(currentWorkspace, view);
}
}
}
@Override
public void focusLost(DFrame dockable) {
List<View> list = new ArrayList<View>();
for (Entry<TabView, TabFrame> e : tabDockables.entrySet()) {
if (e.getValue().equals(dockable)) {
TabView view = e.getKey();
list.add(view);
}
}
if (dockable instanceof UniqueDFrame) {
list.add(findUniqueView(((UniqueDFrame) dockable).getUniqueId()));
}
for (View view : list) view.focusLost();
plugableFrame.setViewActions(new String[] {});
}
});
// control.setTheme(ThemeMap.KEY_ECLIPSE_THEME);
contentArea = control.getContentArea();
plugableFrame.add(contentArea, BorderLayout.CENTER);
for (UniqueView view : uniqueViews) {
String id = view.getId();
final UniqueDFrame dockable = new UniqueDFrame(control, id, findPluginForViewId(id).getString(id), view);
dockable.setCloseable(true);
initActions(view.getId(), view, dockable);
control.add(dockable);
uniqueDockables.add(dockable);
framework.addActionListener(id, new ActionListener() {
@Override
public void onAction(ActionEvent event) {
dockable.setVisible(true);
}
});
if (currentWorkspace.equals(view.getDefaultWorkspace()))
dockable.setVisible(true);
}
control.commitUniqueViews();
for (TabbedView view : tabbedViews) {
String id = view.getId();
if (getWorkingArea(id) != null)
continue;
Area area = control.createWorkingArea(id);
uniqueWorkingAreas.add(area);
area.setVisible(true);
}
framework.setMainFrame(plugableFrame);
}
use of com.ramussoft.gui.common.event.ActionEvent in project ramus by Vitaliy-Yakovchuk.
the class GUIFramework method propertyChanged.
public void propertyChanged(String key, final Object value, Object metadata) {
ActionEvent event = new ActionEvent(key, value, metadata);
put(key, event);
for (ActionListener listener : getActionListeners()) {
listener.onAction(event);
}
EventListenerList list = keyListeners.get(key);
if (list != null) {
for (ActionListener listener : list.getListeners(ActionListener.class)) {
listener.onAction(event);
}
}
View activeView = getActiveView();
if (activeView != null)
for (String a : activeView.getGlobalActions()) {
if (a.equals(key)) {
activeView.onAction(event);
}
}
}
Aggregations