/** @see ResourceInfo#enabled() */ public boolean enabled() { StoreInfo store = getStore(); boolean storeEnabled = store != null && store.isEnabled(); return storeEnabled && this.isEnabled(); }
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof StoreInfo)) { return false; } final StoreInfo other = (StoreInfo) obj; if (connectionParameters == null) { if (other.getConnectionParameters() != null) return false; } else if (!connectionParameters.equals(other.getConnectionParameters())) return false; if (description == null) { if (other.getDescription() != null) return false; } else if (!description.equals(other.getDescription())) return false; if (enabled != other.isEnabled()) return false; if (id == null) { if (other.getId() != null) return false; } else if (!id.equals(other.getId())) return false; if (name == null) { if (other.getName() != null) return false; } else if (!name.equals(other.getName())) return false; if (workspace == null) { if (other.getWorkspace() != null) return false; } else if (!workspace.equals(other.getWorkspace())) return false; return true; } }
<T extends StoreInfo> void initStore( T s, Class<T> clazz, String sId, String name, WorkspaceInfo ws) { expect(s.getId()).andReturn(sId).anyTimes(); expect(s.getName()).andReturn(name).anyTimes(); expect(s.getWorkspace()).andReturn(ws).anyTimes(); expect(s.getCatalog()).andReturn(catalog).anyTimes(); expect(s.isEnabled()).andReturn(true).anyTimes(); expect(catalog.getStore(sId, clazz)).andReturn(s).anyTimes(); expect(catalog.getStore(sId, StoreInfo.class)).andReturn(s).anyTimes(); expect(catalog.getStoreByName(name, clazz)).andReturn(s).anyTimes(); expect(catalog.getStoreByName(name, StoreInfo.class)).andReturn(s).anyTimes(); expect(catalog.getStoreByName(ws.getName(), name, clazz)).andReturn(s).anyTimes(); expect(catalog.getStoreByName(ws.getName(), name, StoreInfo.class)).andReturn(s).anyTimes(); expect(catalog.getStoreByName(ws, name, clazz)).andReturn(s).anyTimes(); expect(catalog.getStoreByName(ws, name, StoreInfo.class)).andReturn(s).anyTimes(); }
@Override protected Component getComponentForProperty(String id, IModel itemModel, Property<StoreInfo> property) { final CatalogIconFactory icons = CatalogIconFactory.get(); if (property == StoreProvider.DATA_TYPE) { final StoreInfo storeInfo = (StoreInfo) itemModel.getObject(); ResourceReference storeIcon = icons.getStoreIcon(storeInfo); Fragment f = new Fragment(id, "iconFragment", StorePanel.this); f.add(new Image("storeIcon", storeIcon)); return f; } else if (property == WORKSPACE) { return workspaceLink(id, itemModel); } else if (property == NAME) { return storeNameLink(id, itemModel); } else if (property == ENABLED) { final StoreInfo storeInfo = (StoreInfo) itemModel.getObject(); ResourceReference enabledIcon; if (storeInfo.isEnabled()) { enabledIcon = icons.getEnabledIcon(); } else { enabledIcon = icons.getDisabledIcon(); } Fragment f = new Fragment(id, "iconFragment", StorePanel.this); f.add(new Image("storeIcon", enabledIcon)); return f; } return null; }
@Override protected Component getComponentForProperty( String id, IModel<StoreInfo> itemModel, Property<StoreInfo> property) { final CatalogIconFactory icons = CatalogIconFactory.get(); if (property == StoreProvider.DATA_TYPE) { final StoreInfo storeInfo = (StoreInfo) itemModel.getObject(); PackageResourceReference storeIcon = icons.getStoreIcon(storeInfo); Fragment f = new Fragment(id, "iconFragment", StorePanel.this); f.add(new Image("storeIcon", storeIcon)); return f; } else if (property == WORKSPACE) { return workspaceLink(id, itemModel); } else if (property == NAME) { return storeNameLink(id, itemModel); } else if (property == ENABLED) { final StoreInfo storeInfo = (StoreInfo) itemModel.getObject(); PackageResourceReference enabledIcon; if (storeInfo.isEnabled()) { enabledIcon = icons.getEnabledIcon(); } else { enabledIcon = icons.getDisabledIcon(); } Fragment f = new Fragment(id, "iconFragment", StorePanel.this); f.add(new Image("storeIcon", enabledIcon)); return f; } return null; }
void doIndirectImport(ImportTask task) throws IOException { if (!task.getStore().isEnabled()) { task.getStore().setEnabled(true);
void doIndirectImport(ImportTask task) throws IOException { if (!task.getStore().isEnabled()) { task.getStore().setEnabled(true);